diff --git a/.github/workflows/AzureDevOps.yml b/.github/workflows/AzureDevOps.yml
new file mode 100644
index 0000000000..43b7bfde40
--- /dev/null
+++ b/.github/workflows/AzureDevOps.yml
@@ -0,0 +1,25 @@
+name: Sync issue to Azure DevOps work item
+
+on:
+ issues:
+ types:
+ [labeled] #, opened, edited, deleted, closed, reopened, labeled, unlabeled, assigned
+
+jobs:
+ updateAzDO:
+ if: github.event.label.name == 'sprint'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: pavelhorak/github-actions-issue-to-work-item@master
+ env:
+ ado_token: "${{ secrets.ADO_PERSONAL_ACCESS_TOKEN }}"
+ github_token: "${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}"
+ ado_organization: "${{ secrets.ADO_ORGANIZATION }}"
+ ado_project: "${{ secrets.ADO_PROJECT }}"
+ ado_area_path: "${{ secrets.ADO_AREA_PATH }}"
+ ado_iteration_path: ${{ secrets.ADO_ITERATION_PATH }}" # this doesn't work: "@CurrentIteration('[DevDiv]\\.NET DevExp Prague')"
+ ado_wit: "User Story"
+ ado_new_state: "Committed"
+ ado_active_state: "In Progress"
+ ado_close_state: "Completed"
+ ado_bypassrules: false
diff --git a/.gitignore b/.gitignore
index 9523d94f87..845632e36a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,6 +32,7 @@ build*.log
build*.wrn
build*.err
*.binlog
+*.svclog
# MSTest test Results
[Tt]est[Rr]esult*/
diff --git a/NuGet.config b/NuGet.config
index e369b7fa35..449aa3d8e0 100644
--- a/NuGet.config
+++ b/NuGet.config
@@ -13,10 +13,9 @@
-
-
-
-
+
+
+
diff --git a/README.md b/README.md
index 949ff88427..a7f543766c 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ The Visual Studio Test Platform is an open and extensible test platform that ena
The Test Platform currently ships as part Visual Studio 2017, and in the .NET Core Tools Preview 3.
### Build status
-[![Build Status](https://dev.azure.com/vstestplatform/TestPlatform/_apis/build/status/TestPlatform.CI?branchName=master)](https://dev.azure.com/vstestplatform/TestPlatform/_build/latest?definitionId=9&branchName=master)
+[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/Microsoft/vstest/microsoft.vstest.ci?branchName=master)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=935&branchName=master)
### Contributing
There are many ways to contribute to VSTest
diff --git a/TestPlatform.sln b/TestPlatform.sln
index 26a8b21bb6..321f401295 100644
--- a/TestPlatform.sln
+++ b/TestPlatform.sln
@@ -15,7 +15,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "datacollector", "src\dataco
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Build", "src\Microsoft.TestPlatform.Build\Microsoft.TestPlatform.Build.csproj", "{6F5EC38C-4A11-40D3-827C-F607B90BEFF0}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Logger", "Logger", "{5E7F18A8-F843-4C8A-AB02-4C7D9205C6CF}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Loggers", "Loggers", "{5E7F18A8-F843-4C8A-AB02-4C7D9205C6CF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Client", "src\Microsoft.TestPlatform.Client\Microsoft.TestPlatform.Client.csproj", "{E19B5128-3469-492E-82E1-725631C4A68C}"
EndProject
@@ -41,10 +41,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "vstest.console", "src\vstes
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Integration", "Integration", "{46250E12-4CF1-4051-B4A7-80C8C06E0068}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Logger", "Logger", "{020E15EA-731F-4667-95AF-226671E0C3AE}"
- ProjectSection(SolutionItems) = preProject
- test\Microsoft.TestPlatform.AcceptanceTests\TestResults.html = test\Microsoft.TestPlatform.AcceptanceTests\TestResults.html
- EndProjectSection
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Loggers", "Loggers", "{020E15EA-731F-4667-95AF-226671E0C3AE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Performance", "Performance", "{595BE9C1-E10F-4E50-938A-E6C248D3F950}"
EndProject
@@ -68,6 +65,20 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "vstest.console.UnitTests",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests", "test\Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests\Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests.csproj", "{BFF7714C-E5A3-4EEB-B04B-5FA47F29AD03}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "perf", "perf", "{0D4DF78D-7E5F-4516-B19F-E6AA71A1DBF4}"
+ ProjectSection(SolutionItems) = preProject
+ scripts\perf\perf.ps1 = scripts\perf\perf.ps1
+ scripts\perf\perfconfig.csv = scripts\perf\perfconfig.csv
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{DED1590A-ED25-413B-8590-006A4DD5B2FD}"
+ ProjectSection(SolutionItems) = preProject
+ scripts\build\TestPlatform.Dependencies.props = scripts\build\TestPlatform.Dependencies.props
+ scripts\build\TestPlatform.Localization.targets = scripts\build\TestPlatform.Localization.targets
+ scripts\build\TestPlatform.Settings.targets = scripts\build\TestPlatform.Settings.targets
+ scripts\build\TestPlatform.targets = scripts\build\TestPlatform.targets
+ EndProjectSection
+EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{EE49F5DC-5835-4AE3-B3BA-8BDE0AD56330}"
ProjectSection(SolutionItems) = preProject
scripts\build.ps1 = scripts\build.ps1
@@ -76,6 +87,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{EE49
scripts\stylecop.test.ruleset = scripts\stylecop.test.ruleset
scripts\test.ps1 = scripts\test.ps1
scripts\verify-sign.ps1 = scripts\verify-sign.ps1
+ scripts\verify-nupkgs.ps1 = scripts\verify-nupkgs.ps1
+ scripts\PortableToFullPdb.ps1 = scripts\PortableToFullPdb.ps1
+ scripts\vsts-prebuild.ps1 = scripts\vsts-prebuild.ps1
+ scripts\write-release-notes.ps1 = scripts\write-release-notes.ps1
+ scripts\build.sh = scripts\build.sh
+ scripts\test.sh = scripts\test.sh
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E344E0A2-7715-4C7F-BAF7-D64EA94CB19B}"
@@ -103,14 +120,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "datacollector.PlatformTests
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Platform", "Platform", "{7D4082EA-7AC9-4DFB-98E8-C5E08BDC0EC3}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{DED1590A-ED25-413B-8590-006A4DD5B2FD}"
- ProjectSection(SolutionItems) = preProject
- scripts\build\TestPlatform.Dependencies.props = scripts\build\TestPlatform.Dependencies.props
- scripts\build\TestPlatform.Localization.targets = scripts\build\TestPlatform.Localization.targets
- scripts\build\TestPlatform.Settings.targets = scripts\build\TestPlatform.Settings.targets
- scripts\build\TestPlatform.targets = scripts\build\TestPlatform.targets
- EndProjectSection
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "package", "src\package\package\package.csproj", "{E141A226-CC0A-4F26-BD17-4AE427D81C3B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Platform", "Platform", "{376C19DE-31E2-4FF6-88FC-0D0D6233C999}"
@@ -135,20 +144,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataCollectors", "DataColle
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Extensions.EventLogCollector.UnitTests", "test\DataCollectors\Microsoft.TestPlatform.Extensions.EventLogCollector.UnitTests\Microsoft.TestPlatform.Extensions.EventLogCollector.UnitTests.csproj", "{21DB138B-85B7-479E-91FE-01E0F972EC56}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "perf", "perf", "{0D4DF78D-7E5F-4516-B19F-E6AA71A1DBF4}"
- ProjectSection(SolutionItems) = preProject
- scripts\perf\perf.ps1 = scripts\perf\perf.ps1
- scripts\perf\perfconfig.csv = scripts\perf\perfconfig.csv
- EndProjectSection
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "vstest.console.PlatformTests", "test\vstest.console.PlatformTests\vstest.console.PlatformTests.csproj", "{8C068694-23A2-47A2-A0DD-DB82D0AF0142}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Common.PlatformTests", "test\Microsoft.TestPlatform.Common.PlatformTests\Microsoft.TestPlatform.Common.PlatformTests.csproj", "{24C7683D-2607-4901-B8EB-83A57E49E93D}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudio.TraceDataCollector", "src\DataCollectors\TraceDataCollector\Microsoft.VisualStudio.TraceDataCollector.csproj", "{32BD96BD-16FB-43F0-B952-E7EEDB6DD813}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.TraceDataCollector.UnitTests", "test\DataCollectors\TraceDataCollector.UnitTests\Microsoft.TestPlatform.TraceDataCollector.UnitTests.csproj", "{A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SettingsMigrator", "src\SettingsMigrator\SettingsMigrator.csproj", "{69F5FF81-5615-4F06-B83C-FCF979BB84CA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SettingsMigrator.UnitTests", "test\SettingsMigrator.UnitTests\SettingsMigrator.UnitTests.csproj", "{E7D4921C-F12D-4E1C-85AC-8B7F91C59B0E}"
@@ -159,7 +158,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Exte
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.collector", "test\coverlet.collector\coverlet.collector.csproj", "{074F5BD6-DC05-460B-B78F-044D125FD787}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.ObjectModel.ManagedNameUtilities.UnitTests", "test\Microsoft.TestPlatform.ObjectModel.ManagedNameUtilities.UnitTests\Microsoft.TestPlatform.ObjectModel.ManagedNameUtilities.UnitTests.csproj", "{DCD0C39E-C78C-4A44-B0BD-7325254A2E97}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.AdapterUtilities.UnitTests", "test\Microsoft.TestPlatform.AdapterUtilities.UnitTests\Microsoft.TestPlatform.AdapterUtilities.UnitTests.csproj", "{DCD0C39E-C78C-4A44-B0BD-7325254A2E97}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.AdapterUtilities", "src\Microsoft.TestPlatform.AdapterUtilities\Microsoft.TestPlatform.AdapterUtilities.csproj", "{2DE99835-A3A3-4922-82AD-6D10D284816D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -699,30 +700,6 @@ Global
{24C7683D-2607-4901-B8EB-83A57E49E93D}.Release|x64.Build.0 = Release|Any CPU
{24C7683D-2607-4901-B8EB-83A57E49E93D}.Release|x86.ActiveCfg = Release|Any CPU
{24C7683D-2607-4901-B8EB-83A57E49E93D}.Release|x86.Build.0 = Release|Any CPU
- {32BD96BD-16FB-43F0-B952-E7EEDB6DD813}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {32BD96BD-16FB-43F0-B952-E7EEDB6DD813}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {32BD96BD-16FB-43F0-B952-E7EEDB6DD813}.Debug|x64.ActiveCfg = Debug|Any CPU
- {32BD96BD-16FB-43F0-B952-E7EEDB6DD813}.Debug|x64.Build.0 = Debug|Any CPU
- {32BD96BD-16FB-43F0-B952-E7EEDB6DD813}.Debug|x86.ActiveCfg = Debug|Any CPU
- {32BD96BD-16FB-43F0-B952-E7EEDB6DD813}.Debug|x86.Build.0 = Debug|Any CPU
- {32BD96BD-16FB-43F0-B952-E7EEDB6DD813}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {32BD96BD-16FB-43F0-B952-E7EEDB6DD813}.Release|Any CPU.Build.0 = Release|Any CPU
- {32BD96BD-16FB-43F0-B952-E7EEDB6DD813}.Release|x64.ActiveCfg = Release|Any CPU
- {32BD96BD-16FB-43F0-B952-E7EEDB6DD813}.Release|x64.Build.0 = Release|Any CPU
- {32BD96BD-16FB-43F0-B952-E7EEDB6DD813}.Release|x86.ActiveCfg = Release|Any CPU
- {32BD96BD-16FB-43F0-B952-E7EEDB6DD813}.Release|x86.Build.0 = Release|Any CPU
- {A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3}.Debug|x64.ActiveCfg = Debug|Any CPU
- {A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3}.Debug|x64.Build.0 = Debug|Any CPU
- {A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3}.Debug|x86.Build.0 = Debug|Any CPU
- {A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3}.Release|Any CPU.Build.0 = Release|Any CPU
- {A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3}.Release|x64.ActiveCfg = Release|Any CPU
- {A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3}.Release|x64.Build.0 = Release|Any CPU
- {A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3}.Release|x86.ActiveCfg = Release|Any CPU
- {A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3}.Release|x86.Build.0 = Release|Any CPU
{69F5FF81-5615-4F06-B83C-FCF979BB84CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69F5FF81-5615-4F06-B83C-FCF979BB84CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69F5FF81-5615-4F06-B83C-FCF979BB84CA}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -795,22 +772,34 @@ Global
{DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Release|x64.Build.0 = Release|Any CPU
{DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Release|x86.ActiveCfg = Release|Any CPU
{DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Release|x86.Build.0 = Release|Any CPU
+ {2DE99835-A3A3-4922-82AD-6D10D284816D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2DE99835-A3A3-4922-82AD-6D10D284816D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2DE99835-A3A3-4922-82AD-6D10D284816D}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {2DE99835-A3A3-4922-82AD-6D10D284816D}.Debug|x64.Build.0 = Debug|Any CPU
+ {2DE99835-A3A3-4922-82AD-6D10D284816D}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {2DE99835-A3A3-4922-82AD-6D10D284816D}.Debug|x86.Build.0 = Debug|Any CPU
+ {2DE99835-A3A3-4922-82AD-6D10D284816D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2DE99835-A3A3-4922-82AD-6D10D284816D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2DE99835-A3A3-4922-82AD-6D10D284816D}.Release|x64.ActiveCfg = Release|Any CPU
+ {2DE99835-A3A3-4922-82AD-6D10D284816D}.Release|x64.Build.0 = Release|Any CPU
+ {2DE99835-A3A3-4922-82AD-6D10D284816D}.Release|x86.ActiveCfg = Release|Any CPU
+ {2DE99835-A3A3-4922-82AD-6D10D284816D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {50C00046-0DA3-4B5C-9F6F-7BE1145E156A} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
- {01409D95-A5F1-4EBE-94B1-909D5D2D0DC3} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
+ {50C00046-0DA3-4B5C-9F6F-7BE1145E156A} = {7D4082EA-7AC9-4DFB-98E8-C5E08BDC0EC3}
+ {01409D95-A5F1-4EBE-94B1-909D5D2D0DC3} = {376C19DE-31E2-4FF6-88FC-0D0D6233C999}
{2C7CE1F8-E73E-4987-8023-B5A0EBAC86E8} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
{6F5EC38C-4A11-40D3-827C-F607B90BEFF0} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
{5E7F18A8-F843-4C8A-AB02-4C7D9205C6CF} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
{E19B5128-3469-492E-82E1-725631C4A68C} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
- {68ADC720-316E-4895-9F8E-C3CCADD262BE} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
- {1621415E-7723-4F46-A589-4C4620C0751A} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
- {987898D9-724E-4324-BF91-77B1A6DBE8F1} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
- {FD63F778-3938-45D2-900B-51EC770F70E5} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
- {61F7F446-9EF3-4768-B33A-4D75F60E1059} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
+ {68ADC720-316E-4895-9F8E-C3CCADD262BE} = {7D4082EA-7AC9-4DFB-98E8-C5E08BDC0EC3}
+ {1621415E-7723-4F46-A589-4C4620C0751A} = {7D4082EA-7AC9-4DFB-98E8-C5E08BDC0EC3}
+ {987898D9-724E-4324-BF91-77B1A6DBE8F1} = {7D4082EA-7AC9-4DFB-98E8-C5E08BDC0EC3}
+ {FD63F778-3938-45D2-900B-51EC770F70E5} = {7D4082EA-7AC9-4DFB-98E8-C5E08BDC0EC3}
+ {61F7F446-9EF3-4768-B33A-4D75F60E1059} = {7D4082EA-7AC9-4DFB-98E8-C5E08BDC0EC3}
{D5296435-3A3F-4B1A-81D1-434EC9E97DEF} = {5E7F18A8-F843-4C8A-AB02-4C7D9205C6CF}
{790B8030-00C2-4121-B125-EDC4CE329BA3} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
{27DFBD04-64B2-4F1B-82B2-006620CCA6F8} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
@@ -820,12 +809,12 @@ Global
{020E15EA-731F-4667-95AF-226671E0C3AE} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
{595BE9C1-E10F-4E50-938A-E6C248D3F950} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
{0D59BA81-6279-4650-AEBB-4EA735C28A1A} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
- {DE730F17-7D5C-4D9D-B479-025024BF4F1D} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
- {E062FFD6-DEB1-4DB4-8B6E-ADBF04129545} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
- {F582949D-8B92-47BD-9DD7-9F2BFCCC290C} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
- {376A7588-50DF-46CD-955B-0309F491D830} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
+ {DE730F17-7D5C-4D9D-B479-025024BF4F1D} = {376C19DE-31E2-4FF6-88FC-0D0D6233C999}
+ {E062FFD6-DEB1-4DB4-8B6E-ADBF04129545} = {376C19DE-31E2-4FF6-88FC-0D0D6233C999}
+ {F582949D-8B92-47BD-9DD7-9F2BFCCC290C} = {376C19DE-31E2-4FF6-88FC-0D0D6233C999}
+ {376A7588-50DF-46CD-955B-0309F491D830} = {376C19DE-31E2-4FF6-88FC-0D0D6233C999}
{5DF3CF65-3E11-4639-964D-7BEB4109DCF9} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
- {D3E8A13B-92EE-45A8-BB24-40EC3CC9DB34} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
+ {D3E8A13B-92EE-45A8-BB24-40EC3CC9DB34} = {376C19DE-31E2-4FF6-88FC-0D0D6233C999}
{9EFCEFB5-253E-4DE2-8A70-821D7B8189DF} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
{3A8080FB-9C93-45B9-8EB5-828DDC31FDF0} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
{BFF7714C-E5A3-4EEB-B04B-5FA47F29AD03} = {020E15EA-731F-4667-95AF-226671E0C3AE}
@@ -847,7 +836,7 @@ Global
{7B48115A-B766-4B55-93A8-C08A42C37710} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
{FBF74C8F-695C-4967-84AC-358EEFB1376D} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
{11ECCB8B-6958-42A7-BD58-88C09CB149B2} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
- {76D4BB7E-D981-42D5-BE96-6FAD8DEF9A4A} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
+ {76D4BB7E-D981-42D5-BE96-6FAD8DEF9A4A} = {B705537C-B82C-4A30-AFA5-6244D9A7DAEB}
{488675EC-C8BB-40E0-AD4F-91F623D548B3} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
{B705537C-B82C-4A30-AFA5-6244D9A7DAEB} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
{65A25D6E-C9CC-4F45-8925-04087AC82634} = {B705537C-B82C-4A30-AFA5-6244D9A7DAEB}
@@ -856,14 +845,13 @@ Global
{0D4DF78D-7E5F-4516-B19F-E6AA71A1DBF4} = {EE49F5DC-5835-4AE3-B3BA-8BDE0AD56330}
{8C068694-23A2-47A2-A0DD-DB82D0AF0142} = {376C19DE-31E2-4FF6-88FC-0D0D6233C999}
{24C7683D-2607-4901-B8EB-83A57E49E93D} = {376C19DE-31E2-4FF6-88FC-0D0D6233C999}
- {32BD96BD-16FB-43F0-B952-E7EEDB6DD813} = {B705537C-B82C-4A30-AFA5-6244D9A7DAEB}
- {A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3} = {D9A30E32-D466-4EC5-B4F2-62E17562279B}
{69F5FF81-5615-4F06-B83C-FCF979BB84CA} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959}
{E7D4921C-F12D-4E1C-85AC-8B7F91C59B0E} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
{236A71E3-01DA-4679-9DFF-16A8E079ACFF} = {5E7F18A8-F843-4C8A-AB02-4C7D9205C6CF}
{41248B96-6E15-4E5E-A78F-859897676814} = {020E15EA-731F-4667-95AF-226671E0C3AE}
- {074F5BD6-DC05-460B-B78F-044D125FD787} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
+ {074F5BD6-DC05-460B-B78F-044D125FD787} = {D9A30E32-D466-4EC5-B4F2-62E17562279B}
{DCD0C39E-C78C-4A44-B0BD-7325254A2E97} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
+ {2DE99835-A3A3-4922-82AD-6D10D284816D} = {7D4082EA-7AC9-4DFB-98E8-C5E08BDC0EC3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0541B30C-FF51-4E28-B172-83F5F3934BCD}
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index b8b5333e1d..e59f2b8b75 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -33,6 +33,13 @@ jobs:
modifyEnvironment: false
failOnStandardError: true
+ - task: PublishTestResults@2
+ displayName: 'Publish Test Results **\*.trx'
+ inputs:
+ testResultsFormat: VSTest
+ testResultsFiles: '**\*.trx'
+ condition: succeededOrFailed()
+
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)\artifacts'
@@ -124,16 +131,25 @@ jobs:
steps:
- script: ./build.sh -c $(buildConfiguration)
displayName: 'Build'
+
- script: ./test.sh -c $(buildConfiguration) -p Unit
displayName: 'Unit tests'
+
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'testArtifacts'
targetPath: '$(Build.SourcesDirectory)/artifacts'
+
- script: ./tools/dotnet-linux/dotnet build -c $(buildConfiguration) ./test/TestAssets/TestAssets.sln
displayName: 'Build test assets'
+
- script: ./test.sh -c $(buildConfiguration) -p Acceptance
displayName: 'Acceptance tests'
-
-
+
+ - task: PublishTestResults@2
+ displayName: 'Publish Test Results **/*.trx'
+ inputs:
+ testResultsFormat: VSTest
+ testResultsFiles: '**/*.trx'
+ condition: succeededOrFailed()
\ No newline at end of file
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 0ac3fbcb4b..bcc7c5c8a9 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -3,25 +3,25 @@
-
+ https://github.com/dotnet/arcade
- 1ceac96c54fcf33eb745649c4e7b8d7507a9b730
+ 620462dd065490620c03a80cea8e251004f6bf21
-
+ https://github.com/dotnet/arcade
- 1ceac96c54fcf33eb745649c4e7b8d7507a9b730
+ 620462dd065490620c03a80cea8e251004f6bf21
-
+ https://github.com/dotnet/arcade
- 1ceac96c54fcf33eb745649c4e7b8d7507a9b730
+ 620462dd065490620c03a80cea8e251004f6bf21
-
+ https://github.com/dotnet/arcade
- 1ceac96c54fcf33eb745649c4e7b8d7507a9b730
+ 620462dd065490620c03a80cea8e251004f6bf21
-
+ https://github.com/dotnet/arcade
- 1ceac96c54fcf33eb745649c4e7b8d7507a9b730
+ 620462dd065490620c03a80cea8e251004f6bf21https://github.com/dotnet/arcade-services
@@ -36,7 +36,7 @@
-
+ https://github.com/dotnet/symreader-converterc5ba7c88f92e2dde156c324a8c8edc04d9fa4fe0
diff --git a/eng/Versions.props b/eng/Versions.props
index e708d770fc..9c7b7e66bd 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -60,8 +60,8 @@
2.4.12.0.32.4.1
- 2.2.0-beta.20570.10
- 1.0.0-beta.20570.10
+ 2.2.0-beta.21072.7
+ 1.0.0-beta.21072.71.22.01.1.22.0.0
@@ -73,7 +73,7 @@
1.7.01.1.0-beta.19556.41.0.0-beta2-19554-01
- 1.0.0-beta.20570.10
+ 1.0.0-beta.21072.71.0.0-beta.20055.1
+ .NETFramework
+ v4.5.1
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/ManagedNameMessages.Designer.cs b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/Resources.Designer.cs
similarity index 57%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/ManagedNameMessages.Designer.cs
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/Resources.Designer.cs
index 266ad299d1..19827c698e 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/ManagedNameMessages.Designer.cs
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/Resources.Designer.cs
@@ -1,118 +1,135 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Resources {
- using System;
+namespace Microsoft.TestPlatform.AdapterUtilities.Resources
+{
using System.Reflection;
///
/// A strongly-typed resource class, for looking up localized strings, etc.
///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class ManagedNameMessages {
-
+ internal class Resources
+ {
+
private static global::System.Resources.ResourceManager resourceMan;
-
+
private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal ManagedNameMessages() {
+
+ internal Resources()
+ {
}
-
+
///
/// Returns the cached ResourceManager instance used by this class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.VisualStudio.TestPlatform.ObjectModel.Resources.ManagedNameMessages", typeof(ManagedNameMessages).GetTypeInfo().Assembly);
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if (object.ReferenceEquals(resourceMan, null))
+ {
+#if NET20 || NET35
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.TestPlatform.AdapterUtilities.Resources.Resources", typeof(Resources).Assembly);
+#else
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.TestPlatform.AdapterUtilities.Resources.Resources", typeof(Resources).GetTypeInfo().Assembly);
+#endif
resourceMan = temp;
}
return resourceMan;
}
}
-
+
///
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
return resourceCulture;
}
- set {
+ set
+ {
resourceCulture = value;
}
}
-
+
///
/// Looks up a localized string similar to ManagedName is incomplete.
///
- internal static string ErrorIncompleteManagedName {
- get {
+ internal static string ErrorIncompleteManagedName
+ {
+ get
+ {
return ResourceManager.GetString("ErrorIncompleteManagedName", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Method arity must be numeric.
///
- internal static string ErrorMethodArityMustBeNumeric {
- get {
+ internal static string ErrorMethodArityMustBeNumeric
+ {
+ get
+ {
return ResourceManager.GetString("ErrorMethodArityMustBeNumeric", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Method '{0}' not found on type '{1}'.
///
- internal static string ErrorMethodNotFound {
- get {
+ internal static string ErrorMethodNotFound
+ {
+ get
+ {
return ResourceManager.GetString("ErrorMethodNotFound", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Type '{0}' not found.
///
- internal static string ErrorTypeNotFound {
- get {
+ internal static string ErrorTypeNotFound
+ {
+ get
+ {
return ResourceManager.GetString("ErrorTypeNotFound", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Unexpected characters after the end of the ManagedName (pos: {0}).
///
- internal static string ErrorUnexpectedCharactersAtEnd {
- get {
+ internal static string ErrorUnexpectedCharactersAtEnd
+ {
+ get
+ {
return ResourceManager.GetString("ErrorUnexpectedCharactersAtEnd", resourceCulture);
}
}
-
+
///
/// Looks up a localized string similar to Whitespace is not valid in a ManagedName (pos: {0}).
///
- internal static string ErrorWhitespaceNotValid {
- get {
+ internal static string ErrorWhitespaceNotValid
+ {
+ get
+ {
return ResourceManager.GetString("ErrorWhitespaceNotValid", resourceCulture);
}
}
+
+ ///
+ /// Looks up a localized string similar to '{0}.{1}' is not implemented on this platform!.
+ ///
+ internal static string MethodNotImplementedOnPlatform
+ {
+ get
+ {
+ return ResourceManager.GetString("MethodNotImplementedOnPlatform", resourceCulture);
+ }
+ }
}
}
diff --git a/src/DataCollectors/TraceDataCollector/Resources/Resources.resx b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/Resources.resx
similarity index 81%
rename from src/DataCollectors/TraceDataCollector/Resources/Resources.resx
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/Resources.resx
index bec54d6610..da81725acf 100644
--- a/src/DataCollectors/TraceDataCollector/Resources/Resources.resx
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/Resources.resx
@@ -117,22 +117,32 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- Failed to create directory: {0} with error:{1}
+
+ ManagedName is incomplete
-
- Failed to initialize code coverage datacollector with error: {0}
+
+ Method arity must be numeric
-
- Running event not received from CodeCoverage.exe. Check eventlogs for failure reason.
+
+ Method '{0}' not found on type '{1}'
+ {0} is the method name, {1} is the full type name.
-
- Cannot find CodeCoverage.exe at {0}
+
+ Type '{0}' not found
+ {0} is the full type name.
-
- Failed to receive running event from CodeCoverage.exe in {0} seconds, This may occur due to machine slowness, please set environment variable {1} to increase timeout.
+
+ Unexpected characters after the end of the ManagedName (pos: {0})
+ {0} is the position of unexpected characters
-
- No code coverage data available. Code coverage is currently supported only on Windows.
+
+ Whitespace is not valid in a ManagedName (pos: {0})
+ {0} is the position of invalid whitespace
+
+
+ '{0}.{1}' is not implemented on this platform!
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.cs.xlf b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.cs.xlf
similarity index 72%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.cs.xlf
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.cs.xlf
index 22dd7bfd1a..77e0cf29b0 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.cs.xlf
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.cs.xlf
@@ -1,10 +1,10 @@
-
+
- PlněKvalifikovanýNázev je neúplný.
+ Název ManagedName není úplný.
@@ -24,14 +24,21 @@
- Neočekávané znaky na konci položky PlněKvalifikovanýNázev (pos: {0})
+ Neočekávané znaky na konci položky ManagedName (pozice: {0}){0} is the position of unexpected characters
- V položce PlněKvalifikovanýNázev není povolena mezera (pos: {0}).
+ V ManagedName se nepovoluje mezera (pozice: {0}).{0} is the position of invalid whitespace
+
+
+ Metoda {0}.{1} není na této platformě implementována.
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.de.xlf b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.de.xlf
similarity index 72%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.de.xlf
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.de.xlf
index 173142e423..cc3be8f402 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.de.xlf
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.de.xlf
@@ -1,10 +1,10 @@
-
+
- ManagedName ist unvollständig.
+ ManagedName unvollständig
@@ -24,14 +24,21 @@
- Nach dem Ende von ManagedName (Pos: {0}) wurden unerwartete Zeichen gefunden.
+ Unerwartetes Zeichen nach dem Ende von ManagedName (Position: {0}).{0} is the position of unexpected characters
- Leerzeichen sind in einem ManagedName (Pos: {0}) unzulässig.
+ Leerzeichen sind in einem ManagedName unzulässig (Position: {0}).{0} is the position of invalid whitespace
+
+
+ "{0}.{1}" ist auf dieser Plattform nicht implementiert!
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.es.xlf b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.es.xlf
similarity index 74%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.es.xlf
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.es.xlf
index 61a0a28563..111e6b9dd4 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.es.xlf
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.es.xlf
@@ -1,10 +1,10 @@
-
+
- ManagedName está incompleto
+ ManagedName está incompleto.
@@ -24,14 +24,21 @@
- Caracteres inesperados después del final de ManagedName (pos: {0})
+ Caracteres inesperados después del final de ManagedName (posición: {0}){0} is the position of unexpected characters
- El espacio en blanco no es válido en un elemento ManagedName (pos: {0})
+ El espacio en blanco no es válido en un elemento ManagedName (posición: {0}){0} is the position of invalid whitespace
+
+
+ "{0}.{1}" no se ha implementado en esta plataforma.
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.fr.xlf b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.fr.xlf
similarity index 77%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.fr.xlf
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.fr.xlf
index 7f48d41414..13be1b762b 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.fr.xlf
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.fr.xlf
@@ -1,6 +1,6 @@
-
+
@@ -24,14 +24,21 @@
- Caractères inattendus après la fin du ManagedName (pos : {0})
+ Caractères inattendus après la fin de ManagedName (pos. : {0}){0} is the position of unexpected characters
- Les espaces blancs ne sont pas valides dans un ManagedName (pos : {0})
+ Les espaces blancs ne sont pas valides dans un ManagedName (pos. : {0}){0} is the position of invalid whitespace
+
+
+ '{0}.{1}' n'est pas implémenté sur cette plateforme !
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.it.xlf b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.it.xlf
similarity index 82%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.it.xlf
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.it.xlf
index cd33cbb7ea..1602378445 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.it.xlf
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.it.xlf
@@ -1,6 +1,6 @@
-
+
@@ -32,6 +32,13 @@
Gli spazi vuoti non sono validi in un elemento ManagedName (pos.: {0}){0} is the position of invalid whitespace
+
+
+ '{0}.{1}' non è implementato in questa piattaforma.
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.ja.xlf b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.ja.xlf
similarity index 72%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.ja.xlf
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.ja.xlf
index 804c2891ba..2bc25ce3ae 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.ja.xlf
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.ja.xlf
@@ -1,10 +1,10 @@
-
+
- ManagedName が不完全です。
+ ManagedName が不完全です
@@ -24,14 +24,21 @@
- ManagedName (pos: {0}) の末尾の後ろに予期しない文字があります
+ ManagedName の末尾の後ろに予期しない文字があります (位置: {0}){0} is the position of unexpected characters
- ManagedName (pos: {0}) では空白は無効です
+ ManagedName では空白は無効です (位置: {0}){0} is the position of invalid whitespace
+
+
+ '{0}.{1}' はこのプラットフォームに実装されていません。
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.ko.xlf b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.ko.xlf
similarity index 78%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.ko.xlf
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.ko.xlf
index f10f8d5bd8..2ef4e1cdc3 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.ko.xlf
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.ko.xlf
@@ -1,10 +1,10 @@
-
+
- ManagedName이 불완전합니다.
+ ManagedName이 불완전함
@@ -32,6 +32,13 @@
ManagedName에서 공백은 유효하지 않습니다(pos: {0}).{0} is the position of invalid whitespace
+
+
+ '{0}.{1}'이(가)이 플랫폼에서 구현되지 않았습니다.
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.pl.xlf b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.pl.xlf
similarity index 76%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.pl.xlf
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.pl.xlf
index 33f316fc55..9f40119244 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.pl.xlf
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.pl.xlf
@@ -1,10 +1,10 @@
-
+
- Wartość ManagedName jest niepełna
+ Wartość ManagedName jest niekompletna
@@ -24,7 +24,7 @@
- Nieoczekiwane znaki za końcem wartości ManagedName (pozycja: {0})
+ Nieoczekiwane znaki po zakończeniu wartości ManagedName (pozycja: {0}){0} is the position of unexpected characters
@@ -32,6 +32,13 @@
Biały znak jest niedozwolony w wartości ManagedName (pozycja: {0}){0} is the position of invalid whitespace
+
+
+ Element „{0}.{1}” nie jest zaimplementowany na tej platformie.
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.pt-BR.xlf b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.pt-BR.xlf
similarity index 71%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.pt-BR.xlf
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.pt-BR.xlf
index 0fa9a17b35..6e08e8348c 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.pt-BR.xlf
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.pt-BR.xlf
@@ -1,10 +1,10 @@
-
+
- ManagedName está incompleto
+ O ManagedName está incompleto
@@ -24,14 +24,21 @@
- Caracteres inesperados após o fnal de ManagedName (pos: {0})
+ Caracteres inesperados após o final de ManagedName (posição: {0}){0} is the position of unexpected characters
- Espaço em branco não é válido em um ManagedName (pos: {0})
+ O espaço em branco não é válido em um ManagedName (posição: {0}){0} is the position of invalid whitespace
+
+
+ '{0}.{1}' não está implementado nesta plataforma.
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.ru.xlf b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.ru.xlf
similarity index 71%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.ru.xlf
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.ru.xlf
index 542202b6a2..98ab3c94da 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.ru.xlf
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.ru.xlf
@@ -1,10 +1,10 @@
-
+
- ManagedName (Полное имя) содержит не все данные
+ ManagedName является неполным.
@@ -24,14 +24,21 @@
- Непредусмотренные символы после ManagedName (Полного имени), позиция: {0}
+ Неожиданные символы после окончания ManagedName (позиция: {0}).{0} is the position of unexpected characters
- Пробел в ManagedName (Полном имени) недопустим, позиция: {0}
+ Пробел в ManagedName (позиция: {0}) не допускается.{0} is the position of invalid whitespace
+
+
+ '{0}.{1}' bu platformda uygulanmıyor!
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.tr.xlf b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.tr.xlf
similarity index 70%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.tr.xlf
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.tr.xlf
index 393b2edd77..fb6cc464b2 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.tr.xlf
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.tr.xlf
@@ -1,10 +1,10 @@
-
+
- ManagedName eksik
+ ManagedName tamamlanmadı
@@ -24,14 +24,21 @@
- ManagedName’den sonra beklenmeyen karakterler (konum: {0})
+ ManagedName'den sonra beklenmeyen karakterler var (konum: {0}){0} is the position of unexpected characters
- ManagedName’de boşluk geçersizdir (konum: {0})
+ ManagedName'de boşluk geçersiz (konum: {0}){0} is the position of invalid whitespace
+
+
+ '{0}.{1}' bu platformda uygulanmıyor!
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.xlf b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.xlf
similarity index 74%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.xlf
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.xlf
index 6b76894923..232d95bf2d 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.xlf
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.xlf
@@ -1,6 +1,6 @@
-
+
@@ -26,6 +26,13 @@
{0} is the position of invalid whitespace
+
+
+ '{0}.{1}' is not implemented on this platform!
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.zh-Hans.xlf b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.zh-Hans.xlf
similarity index 73%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.zh-Hans.xlf
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.zh-Hans.xlf
index 2ed7fcaeab..2a3e79c29d 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.zh-Hans.xlf
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.zh-Hans.xlf
@@ -1,6 +1,6 @@
-
+
@@ -24,14 +24,21 @@
- ManagedName (pos: {0}) 末尾后有不需要的字符
+ ManagedName 末尾后面有不需要的字符(位置: {0}){0} is the position of unexpected characters
- ManagedName (pos: {0}) 中空白无效
+ ManagedName 中空白无效(位置: {0}){0} is the position of invalid whitespace
+
+
+ 未在此平台上实现 "{0}.{1}"!
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.zh-Hant.xlf b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.zh-Hant.xlf
similarity index 73%
rename from src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.zh-Hant.xlf
rename to src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.zh-Hant.xlf
index b3dcdd91cd..b722fc446f 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Resources/xlf/ManagedNameMessages.zh-Hant.xlf
+++ b/src/Microsoft.TestPlatform.AdapterUtilities/Resources/xlf/Resources.zh-Hant.xlf
@@ -1,6 +1,6 @@
-
+
@@ -24,14 +24,21 @@
- ManagedName (pos: {0}) 的結尾出現未預期的字元
+ ManagedName 的結尾後出現非預期的字元 (位置: {0}){0} is the position of unexpected characters
- 空白字元在 ManagedName (pos: {0}) 中無效
+ 空白字元在 ManagedName 中無效 (位置: {0}){0} is the position of invalid whitespace
+
+
+ '{0}.{1}' 未在此平台上實作!
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs b/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs
index 565cf31578..31812dacfa 100644
--- a/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs
+++ b/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs
@@ -9,6 +9,8 @@ namespace Microsoft.VisualStudio.TestPlatform.Client.DesignMode
using System.Net;
using System.Threading;
using System.Threading.Tasks;
+
+ using Microsoft.VisualStudio.TestPlatform.Client;
using Microsoft.VisualStudio.TestPlatform.Client.TestRunAttachmentsProcessing;
using Microsoft.VisualStudio.TestPlatform.Client.RequestHelper;
using Microsoft.VisualStudio.TestPlatform.Common.Logging;
@@ -17,11 +19,14 @@ namespace Microsoft.VisualStudio.TestPlatform.Client.DesignMode
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces;
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.CoreUtilities.Helpers;
+ using Microsoft.VisualStudio.TestPlatform.CrossPlatEngine;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
+ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.Payloads;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions;
using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces;
+
using CommunicationUtilitiesResources = CommunicationUtilities.Resources.Resources;
///
@@ -32,7 +37,7 @@ public class DesignModeClient : IDesignModeClient
private readonly ICommunicationManager communicationManager;
private readonly IDataSerializer dataSerializer;
- private ProtocolConfig protocolConfig = Constants.DefaultProtocolConfig;
+ private ProtocolConfig protocolConfig = ObjectModel.Constants.DefaultProtocolConfig;
private IEnvironment platformEnvironment;
private TestSessionMessageLogger testSessionMessageLogger;
private object lockObject = new object();
@@ -170,6 +175,20 @@ private void ProcessRequests(ITestRequestManager testRequestManager)
break;
}
+ case MessageType.StartTestSession:
+ {
+ var testSessionPayload = this.communicationManager.DeserializePayload(message);
+ this.StartTestSession(testSessionPayload, testRequestManager);
+ break;
+ }
+
+ case MessageType.StopTestSession:
+ {
+ var testSessionInfo = this.communicationManager.DeserializePayload(message);
+ this.StopTestSession(testSessionInfo);
+ break;
+ }
+
case MessageType.StartDiscovery:
{
var discoveryPayload = this.dataSerializer.DeserializePayload(message);
@@ -183,7 +202,7 @@ private void ProcessRequests(ITestRequestManager testRequestManager)
var testRunPayload =
this.communicationManager.DeserializePayload(
message);
- this.StartTestRun(testRunPayload, testRequestManager, skipTestHostLaunch: true);
+ this.StartTestRun(testRunPayload, testRequestManager, shouldLaunchTesthost: true);
break;
}
@@ -193,7 +212,7 @@ private void ProcessRequests(ITestRequestManager testRequestManager)
var testRunPayload =
this.communicationManager.DeserializePayload(
message);
- this.StartTestRun(testRunPayload, testRequestManager, skipTestHostLaunch: false);
+ this.StartTestRun(testRunPayload, testRequestManager, shouldLaunchTesthost: false);
break;
}
@@ -322,7 +341,7 @@ public bool AttachDebuggerToProcess(int pid, CancellationToken cancellationToken
// If an attach request is issued but there is no support for attaching on the other
// side of the communication channel, we simply return and let the caller know the
// request failed.
- if (this.protocolConfig.Version < Constants.MinimumProtocolVersionWithDebugSupport)
+ if (this.protocolConfig.Version < ObjectModel.Constants.MinimumProtocolVersionWithDebugSupport)
{
return false;
}
@@ -408,7 +427,7 @@ public void TestRunMessageHandler(object sender, TestRunMessageEventArgs e)
}
}
- private void StartTestRun(TestRunRequestPayload testRunPayload, ITestRequestManager testRequestManager, bool skipTestHostLaunch)
+ private void StartTestRun(TestRunRequestPayload testRunPayload, ITestRequestManager testRequestManager, bool shouldLaunchTesthost)
{
Task.Run(
() =>
@@ -417,8 +436,15 @@ private void StartTestRun(TestRunRequestPayload testRunPayload, ITestRequestMana
{
testRequestManager.ResetOptions();
- var customLauncher = skipTestHostLaunch ?
- DesignModeTestHostLauncherFactory.GetCustomHostLauncherForTestRun(this, testRunPayload) : null;
+ // We must avoid re-launching the test host if the test run payload already
+ // contains test session info. Test session info being present is an indicative
+ // of an already running test host spawned by a start test session call.
+ var customLauncher =
+ shouldLaunchTesthost && testRunPayload.TestSessionInfo == null
+ ? DesignModeTestHostLauncherFactory.GetCustomHostLauncherForTestRun(
+ this,
+ testRunPayload.DebuggingEnabled)
+ : null;
testRequestManager.RunTests(testRunPayload, customLauncher, new DesignModeTestEventsRegistrar(this), this.protocolConfig);
}
@@ -497,6 +523,53 @@ private void StartTestRunAttachmentsProcessing(TestRunAttachmentsProcessingPaylo
});
}
+ private void StartTestSession(StartTestSessionPayload payload, ITestRequestManager requestManager)
+ {
+ Task.Run(() =>
+ {
+ var eventsHandler = new TestSessionEventsHandler(this.communicationManager);
+
+ try
+ {
+ var customLauncher = payload.HasCustomHostLauncher
+ ? DesignModeTestHostLauncherFactory.GetCustomHostLauncherForTestRun(this, payload.IsDebuggingEnabled)
+ : null;
+
+ requestManager.ResetOptions();
+ requestManager.StartTestSession(payload, customLauncher, eventsHandler, this.protocolConfig);
+ }
+ catch (Exception ex)
+ {
+ EqtTrace.Error("DesignModeClient: Exception in StartTestSession: " + ex);
+
+ eventsHandler.HandleLogMessage(TestMessageLevel.Error, ex.ToString());
+ eventsHandler.HandleStartTestSessionComplete(null);
+ }
+ });
+ }
+
+ private void StopTestSession(TestSessionInfo testSessionInfo)
+ {
+ Task.Run(() =>
+ {
+ var eventsHandler = new TestSessionEventsHandler(this.communicationManager);
+
+ try
+ {
+ var stopped = TestSessionPool.Instance.KillSession(testSessionInfo);
+
+ eventsHandler.HandleStopTestSessionComplete(testSessionInfo, stopped);
+ }
+ catch (Exception ex)
+ {
+ EqtTrace.Error("DesignModeClient: Exception in StopTestSession: " + ex);
+
+ eventsHandler.HandleLogMessage(TestMessageLevel.Error, ex.ToString());
+ eventsHandler.HandleStopTestSessionComplete(testSessionInfo, false);
+ }
+ });
+ }
+
#region IDisposable Support
private bool disposedValue = false; // To detect redundant calls
diff --git a/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeTestHostLauncherFactory.cs b/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeTestHostLauncherFactory.cs
index 8edec80450..5b92bc54ba 100644
--- a/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeTestHostLauncherFactory.cs
+++ b/src/Microsoft.TestPlatform.Client/DesignMode/DesignModeTestHostLauncherFactory.cs
@@ -14,11 +14,11 @@ public static class DesignModeTestHostLauncherFactory
private static ITestHostLauncher defaultLauncher;
private static ITestHostLauncher debugLauncher;
- public static ITestHostLauncher GetCustomHostLauncherForTestRun(IDesignModeClient designModeClient, TestRunRequestPayload testRunRequestPayload)
+ public static ITestHostLauncher GetCustomHostLauncherForTestRun(IDesignModeClient designModeClient, bool debuggingEnabled)
{
ITestHostLauncher testHostLauncher = null;
- if (!testRunRequestPayload.DebuggingEnabled)
+ if (!debuggingEnabled)
{
testHostLauncher = defaultLauncher = defaultLauncher ?? new DesignModeTestHostLauncher(designModeClient);
}
diff --git a/src/Microsoft.TestPlatform.Client/RequestHelper/ITestRequestManager.cs b/src/Microsoft.TestPlatform.Client/RequestHelper/ITestRequestManager.cs
index 0a0e68e301..714e1df9cb 100644
--- a/src/Microsoft.TestPlatform.Client/RequestHelper/ITestRequestManager.cs
+++ b/src/Microsoft.TestPlatform.Client/RequestHelper/ITestRequestManager.cs
@@ -5,69 +5,105 @@ namespace Microsoft.VisualStudio.TestPlatform.Client.RequestHelper
{
using System;
using System.Collections.Generic;
-
+ using Microsoft.VisualStudio.TestPlatform.Client;
using Microsoft.VisualStudio.TestPlatform.Common.Interfaces;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.Interfaces;
+ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.Payloads;
///
- /// Defines the contract that command line
+ /// Defines the contract for running various requests.
///
public interface ITestRequestManager : IDisposable
{
///
- /// Initializes the extensions while probing additional paths
+ /// Initializes the extensions while probing additional paths.
///
- /// Paths to Additional extensions
- /// Skip extension filtering by name (if true)
- void InitializeExtensions(IEnumerable pathToAdditionalExtensions, bool skipExtensionFilters);
+ ///
+ /// Paths to additional extensions.
+ /// Skip extension filtering by name if true.
+ void InitializeExtensions(
+ IEnumerable pathToAdditionalExtensions,
+ bool skipExtensionFilters);
///
- /// Resets Vstest.console.exe Options
+ /// Resets vstest.console.exe options.
///
void ResetOptions();
///
- /// Discover Tests given a list of sources, runsettings
+ /// Discovers tests given a list of sources and some run settings.
+ ///
+ ///
+ /// Discovery payload.
+ /// Discovery events registrar.
+ /// Protocol related information.
+ void DiscoverTests(
+ DiscoveryRequestPayload discoveryPayload,
+ ITestDiscoveryEventsRegistrar disoveryEventsRegistrar,
+ ProtocolConfig protocolConfig);
+
+ ///
+ /// Runs tests given a list of sources and some run settings.
///
- /// Discovery payload
- /// Discovery events registrar - registers and unregisters discovery events
- /// Protocol related information
- void DiscoverTests(DiscoveryRequestPayload discoveryPayload, ITestDiscoveryEventsRegistrar disoveryEventsRegistrar, ProtocolConfig protocolConfig);
+ ///
+ /// Test run request payload.
+ /// Custom test host launcher for the run.
+ /// Run events registrar.
+ /// Protocol related information.
+ void RunTests(
+ TestRunRequestPayload testRunRequestPayLoad,
+ ITestHostLauncher customTestHostLauncher,
+ ITestRunEventsRegistrar testRunEventsRegistrar,
+ ProtocolConfig protocolConfig);
///
- /// Run Tests with given a test of sources
+ /// Processes test run attachments.
///
- /// Test Run Request payload
- /// Custom testHostLauncher for the run
- /// RunEvents registrar
- /// Protocol related information
- void RunTests(TestRunRequestPayload testRunRequestPayLoad, ITestHostLauncher customTestHostLauncher, ITestRunEventsRegistrar testRunEventsRegistrar, ProtocolConfig protocolConfig);
+ ///
+ ///
+ /// Test run attachments processing payload.
+ ///
+ ///
+ /// Test run attachments processing events handler.
+ ///
+ /// Protocol related information.
+ void ProcessTestRunAttachments(
+ TestRunAttachmentsProcessingPayload testRunAttachmentsProcessingPayload,
+ ITestRunAttachmentsProcessingEventsHandler testRunAttachmentsProcessingEventsHandler,
+ ProtocolConfig protocolConfig);
///
- /// Processes test run attachments
+ /// Starts a test session.
///
- /// Test run attachments processing payload
- /// Test run attachments processing events handler
- void ProcessTestRunAttachments(TestRunAttachmentsProcessingPayload testRunAttachmentsProcessingPayload, ITestRunAttachmentsProcessingEventsHandler testRunAttachmentsProcessingEventsHandler, ProtocolConfig protocolConfig);
+ ///
+ /// The start test session payload.
+ /// The custom test host launcher.
+ /// The events handler.
+ /// Protocol related information.
+ void StartTestSession(
+ StartTestSessionPayload payload,
+ ITestHostLauncher testHostLauncher,
+ ITestSessionEventsHandler eventsHandler,
+ ProtocolConfig protocolConfig);
///
- /// Cancel the current TestRun request
+ /// Cancel the current test run request.
///
void CancelTestRun();
///
- /// Abort the current TestRun
+ /// Abort the current test run.
///
void AbortTestRun();
///
- /// Cancels the current discovery request
+ /// Cancels the current discovery request.
///
void CancelDiscovery();
///
- /// Cancels the current test run attachments processing request
+ /// Cancels the current test run attachments processing request.
///
void CancelTestRunAttachmentsProcessing();
}
diff --git a/src/Microsoft.TestPlatform.Client/TestPlatform.cs b/src/Microsoft.TestPlatform.Client/TestPlatform.cs
index 8a24a51a4f..1f2915f065 100644
--- a/src/Microsoft.TestPlatform.Client/TestPlatform.cs
+++ b/src/Microsoft.TestPlatform.Client/TestPlatform.cs
@@ -29,7 +29,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Client
using ClientResources = Resources.Resources;
///
- /// Implementation for TestPlatform
+ /// Implementation for TestPlatform.
///
internal class TestPlatform : ITestPlatform
{
@@ -39,32 +39,34 @@ internal class TestPlatform : ITestPlatform
static TestPlatform()
{
- // TODO This is not the right away to force initialization of default extensions. Test runtime providers
- // require this today. They're getting initialized even before test adapter paths are provided, which is
- // incorrect.
+ // TODO: This is not the right way to force initialization of default extensions.
+ // Test runtime providers require this today. They're getting initialized even before
+ // test adapter paths are provided, which is incorrect.
AddExtensionAssembliesFromExtensionDirectory();
}
///
/// Initializes a new instance of the class.
///
- public TestPlatform() : this(new TestEngine(), new FileHelper(), TestRuntimeProviderManager.Instance)
+ public TestPlatform()
+ : this(
+ new TestEngine(),
+ new FileHelper(),
+ TestRuntimeProviderManager.Instance)
{
}
///
/// Initializes a new instance of the class.
///
- ///
- /// The test engine.
- ///
- ///
- /// The file helper.
- ///
- ///
- /// The data.
- ///
- protected TestPlatform(ITestEngine testEngine, IFileHelper filehelper, TestRuntimeProviderManager testHostProviderManager)
+ ///
+ /// The test engine.
+ /// The file helper.
+ /// The data.
+ protected TestPlatform(
+ ITestEngine testEngine,
+ IFileHelper filehelper,
+ TestRuntimeProviderManager testHostProviderManager)
{
this.TestEngine = testEngine;
this.fileHelper = filehelper;
@@ -72,36 +74,32 @@ protected TestPlatform(ITestEngine testEngine, IFileHelper filehelper, TestRunti
}
///
- /// Gets or sets Test Engine instance
+ /// Gets or sets the test engine instance.
///
private ITestEngine TestEngine { get; set; }
- ///
- /// The create discovery request.
- ///
- /// Request data.
- /// The discovery criteria.
- /// Test platform options.
- /// The .
- /// Throws if parameter is null.
- public IDiscoveryRequest CreateDiscoveryRequest(IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options)
+ ///
+ public IDiscoveryRequest CreateDiscoveryRequest(
+ IRequestData requestData,
+ DiscoveryCriteria discoveryCriteria,
+ TestPlatformOptions options)
{
if (discoveryCriteria == null)
{
throw new ArgumentNullException(nameof(discoveryCriteria));
}
- // Update cache with Extension Folder's files
+ // Update cache with Extension folder's files.
this.AddExtensionAssemblies(discoveryCriteria.RunSettings);
// Update extension assemblies from source when design mode is false.
var runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(discoveryCriteria.RunSettings);
- if (runConfiguration.DesignMode == false)
+ if (!runConfiguration.DesignMode)
{
this.AddExtensionAssembliesFromSource(discoveryCriteria.Sources);
}
- // Initialize loggers
+ // Initialize loggers.
var loggerManager = this.TestEngine.GetLoggerManager(requestData);
loggerManager.Initialize(discoveryCriteria.RunSettings);
@@ -116,15 +114,11 @@ public IDiscoveryRequest CreateDiscoveryRequest(IRequestData requestData, Discov
return new DiscoveryRequest(requestData, discoveryCriteria, discoveryManager, loggerManager);
}
- ///
- /// The create test run request.
- ///
- /// Request data.
- /// The test run criteria.
- /// Test platform options.
- /// The .
- /// Throws if parameter is null.
- public ITestRunRequest CreateTestRunRequest(IRequestData requestData, TestRunCriteria testRunCriteria, TestPlatformOptions options)
+ ///
+ public ITestRunRequest CreateTestRunRequest(
+ IRequestData requestData,
+ TestRunCriteria testRunCriteria,
+ TestPlatformOptions options)
{
if (testRunCriteria == null)
{
@@ -141,7 +135,7 @@ public ITestRunRequest CreateTestRunRequest(IRequestData requestData, TestRunCri
this.AddExtensionAssembliesFromSource(testRunCriteria);
}
- // Initialize loggers
+ // Initialize loggers.
var loggerManager = this.TestEngine.GetLoggerManager(requestData);
loggerManager.Initialize(testRunCriteria.TestRunSettings);
@@ -150,6 +144,7 @@ public ITestRunRequest CreateTestRunRequest(IRequestData requestData, TestRunCri
testHostManager.Initialize(TestSessionMessageLogger.Instance, testRunCriteria.TestRunSettings);
+ // NOTE: The custom launcher should not be set when we have test session info available.
if (testRunCriteria.TestHostLauncher != null)
{
testHostManager.SetCustomLauncher(testRunCriteria.TestHostLauncher);
@@ -161,6 +156,60 @@ public ITestRunRequest CreateTestRunRequest(IRequestData requestData, TestRunCri
return new TestRunRequest(requestData, testRunCriteria, executionManager, loggerManager);
}
+ ///
+ public void StartTestSession(
+ IRequestData requestData,
+ StartTestSessionCriteria testSessionCriteria,
+ ITestSessionEventsHandler eventsHandler)
+ {
+ if (testSessionCriteria == null)
+ {
+ throw new ArgumentNullException(nameof(testSessionCriteria));
+ }
+
+ this.AddExtensionAssemblies(testSessionCriteria.RunSettings);
+
+ var runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(testSessionCriteria.RunSettings);
+
+ // Update extension assemblies from source when design mode is false.
+ //
+ // TODO (copoiena): Is it possible for this code to run if we're not in design mode ?
+ // An use case for this would be when running tests with "dotnet test". Usually there's
+ // a build involved then.
+ if (!runConfiguration.DesignMode)
+ {
+ return;
+ }
+
+ // Initialize loggers.
+ var loggerManager = this.TestEngine.GetLoggerManager(requestData);
+ loggerManager.Initialize(testSessionCriteria.RunSettings);
+
+ var testHostManager = this.testHostProviderManager.GetTestHostManagerByRunConfiguration(testSessionCriteria.RunSettings);
+ ThrowExceptionIfTestHostManagerIsNull(testHostManager, testSessionCriteria.RunSettings);
+
+ testHostManager.Initialize(TestSessionMessageLogger.Instance, testSessionCriteria.RunSettings);
+
+ if (testSessionCriteria.TestHostLauncher != null)
+ {
+ testHostManager.SetCustomLauncher(testSessionCriteria.TestHostLauncher);
+ }
+
+ var testSessionManager = this.TestEngine.GetTestSessionManager(requestData, testHostManager, testSessionCriteria);
+ if (testSessionManager == null)
+ {
+ // The test session manager is null because the combination of runsettings and
+ // sources tells us we should run in-process (i.e. in vstest.console). Because
+ // of this no session will be created because there's no testhost to be launched.
+ // Expecting a subsequent call to execute tests with the same set of parameters.
+ eventsHandler.HandleStartTestSessionComplete(null);
+ return;
+ }
+
+ testSessionManager.Initialize(false);
+ testSessionManager.StartSession(testSessionCriteria, eventsHandler);
+ }
+
///
/// The dispose.
///
@@ -169,25 +218,23 @@ public void Dispose()
throw new NotImplementedException();
}
- ///
- /// The update extensions.
- ///
- /// The path to additional extensions.
- /// Skips filtering by name (if true).
- public void UpdateExtensions(IEnumerable pathToAdditionalExtensions, bool skipExtensionFilters)
+ ///
+ public void UpdateExtensions(
+ IEnumerable pathToAdditionalExtensions,
+ bool skipExtensionFilters)
{
this.TestEngine.GetExtensionManager().UseAdditionalExtensions(pathToAdditionalExtensions, skipExtensionFilters);
}
- ///
- /// Clears the cached extensions
- ///
+ ///
public void ClearExtensions()
{
this.TestEngine.GetExtensionManager().ClearExtensions();
}
- private void ThrowExceptionIfTestHostManagerIsNull(ITestRuntimeProvider testHostManager, string settingXml)
+ private void ThrowExceptionIfTestHostManagerIsNull(
+ ITestRuntimeProvider testHostManager,
+ string settingXml)
{
if (testHostManager == null)
{
@@ -197,11 +244,11 @@ private void ThrowExceptionIfTestHostManagerIsNull(ITestRuntimeProvider testHost
}
///
- /// Update the test adapter paths provided through run settings to be used by the test service
+ /// Updates the test adapter paths provided through run settings to be used by the test
+ /// service.
///
- ///
- /// The run Settings.
- ///
+ ///
+ /// The run settings.
private void AddExtensionAssemblies(string runSettings)
{
IEnumerable customTestAdaptersPaths = RunSettingsUtilities.GetTestAdaptersPaths(runSettings);
@@ -221,11 +268,14 @@ private void AddExtensionAssemblies(string runSettings)
continue;
}
- var extensionAssemblies = new List(this.fileHelper.EnumerateFiles(adapterPath, SearchOption.AllDirectories,
- TestPlatformConstants.TestAdapterEndsWithPattern,
- TestPlatformConstants.TestLoggerEndsWithPattern,
- TestPlatformConstants.DataCollectorEndsWithPattern,
- TestPlatformConstants.RunTimeEndsWithPattern));
+ var extensionAssemblies = new List(
+ this.fileHelper.EnumerateFiles(
+ adapterPath,
+ SearchOption.AllDirectories,
+ TestPlatformConstants.TestAdapterEndsWithPattern,
+ TestPlatformConstants.TestLoggerEndsWithPattern,
+ TestPlatformConstants.DataCollectorEndsWithPattern,
+ TestPlatformConstants.RunTimeEndsWithPattern));
if (extensionAssemblies.Count > 0)
{
@@ -236,17 +286,16 @@ private void AddExtensionAssemblies(string runSettings)
}
///
- /// Update the extension assemblies from source directory
+ /// Updates the extension assemblies from source directory.
///
- ///
- /// The test Run Criteria.
- ///
+ ///
+ /// The test run criteria.
private void AddExtensionAssembliesFromSource(TestRunCriteria testRunCriteria)
{
IEnumerable sources = testRunCriteria.Sources;
if (testRunCriteria.HasSpecificTests)
{
- // If the test execution is with a test filter, group them by sources
+ // If the test execution is with a test filter, group them by sources.
sources = testRunCriteria.Tests.Select(tc => tc.Source).Distinct();
}
@@ -254,20 +303,26 @@ private void AddExtensionAssembliesFromSource(TestRunCriteria testRunCriteria)
}
///
- /// Update the test logger paths from source directory
+ /// Updates the test logger paths from source directory.
///
- ///
+ ///
+ /// The list of sources.
private void AddExtensionAssembliesFromSource(IEnumerable sources)
{
- // Currently we support discovering loggers only from Source directory
+ // Currently we support discovering loggers only from Source directory.
var loggersToUpdate = new List();
foreach (var source in sources)
{
var sourceDirectory = Path.GetDirectoryName(source);
- if (!string.IsNullOrEmpty(sourceDirectory) && this.fileHelper.DirectoryExists(sourceDirectory))
+ if (!string.IsNullOrEmpty(sourceDirectory)
+ && this.fileHelper.DirectoryExists(sourceDirectory))
{
- loggersToUpdate.AddRange(this.fileHelper.EnumerateFiles(sourceDirectory, SearchOption.TopDirectoryOnly, TestPlatformConstants.TestLoggerEndsWithPattern));
+ loggersToUpdate.AddRange(
+ this.fileHelper.EnumerateFiles(
+ sourceDirectory,
+ SearchOption.TopDirectoryOnly,
+ TestPlatformConstants.TestLoggerEndsWithPattern));
}
}
@@ -278,16 +333,26 @@ private void AddExtensionAssembliesFromSource(IEnumerable sources)
}
///
- /// Find all test platform extensions from the `.\Extensions` directory. This is used to load the inbox extensions like
- /// Trx logger and legacy test extensions like mstest v1, mstest c++ etc..
+ /// Finds all test platform extensions from the `.\Extensions` directory. This is used to
+ /// load the inbox extensions like TrxLogger and legacy test extensions like MSTest v1,
+ /// MSTest C++, etc..
///
private static void AddExtensionAssembliesFromExtensionDirectory()
{
var fileHelper = new FileHelper();
- var extensionsFolder = Path.Combine(Path.GetDirectoryName(typeof(TestPlatform).GetTypeInfo().Assembly.GetAssemblyLocation()), "Extensions");
+ var extensionsFolder = Path.Combine(
+ Path.GetDirectoryName(
+ typeof(TestPlatform).GetTypeInfo().Assembly.GetAssemblyLocation()),
+ "Extensions");
+
if (fileHelper.DirectoryExists(extensionsFolder))
{
- var defaultExtensionPaths = fileHelper.EnumerateFiles(extensionsFolder, SearchOption.TopDirectoryOnly, ".dll", ".exe");
+ var defaultExtensionPaths = fileHelper.EnumerateFiles(
+ extensionsFolder,
+ SearchOption.TopDirectoryOnly,
+ ".dll",
+ ".exe");
+
TestPluginCache.Instance.DefaultExtensionPaths = defaultExtensionPaths;
}
}
diff --git a/src/Microsoft.TestPlatform.Client/TestSession/TestSessionEventsHandler.cs b/src/Microsoft.TestPlatform.Client/TestSession/TestSessionEventsHandler.cs
new file mode 100644
index 0000000000..d5eaa5e6cc
--- /dev/null
+++ b/src/Microsoft.TestPlatform.Client/TestSession/TestSessionEventsHandler.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+namespace Microsoft.VisualStudio.TestPlatform.Client
+{
+ using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces;
+ using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel;
+ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
+ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.Payloads;
+ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
+
+ ///
+ /// Defines the way in which test session events should be handled.
+ ///
+ internal class TestSessionEventsHandler : ITestSessionEventsHandler
+ {
+ private readonly ICommunicationManager communicationManager;
+
+ ///
+ /// Creates an instance of the current class.
+ ///
+ ///
+ ///
+ /// The communication manager used for passing messages around.
+ ///
+ public TestSessionEventsHandler(ICommunicationManager communicationManager)
+ {
+ this.communicationManager = communicationManager;
+ }
+
+ ///
+ public void HandleStartTestSessionComplete(TestSessionInfo testSessionInfo)
+ {
+ var ackPayload = new StartTestSessionAckPayload()
+ {
+ TestSessionInfo = testSessionInfo
+ };
+
+ this.communicationManager.SendMessage(MessageType.StartTestSessionCallback, ackPayload);
+ }
+
+ ///
+ public void HandleStopTestSessionComplete(TestSessionInfo testSessionInfo, bool stopped)
+ {
+ var ackPayload = new StopTestSessionAckPayload()
+ {
+ TestSessionInfo = testSessionInfo,
+ IsStopped = stopped
+ };
+
+ this.communicationManager.SendMessage(MessageType.StopTestSessionCallback, ackPayload);
+ }
+
+ ///
+ public void HandleLogMessage(TestMessageLevel level, string message)
+ {
+ var messagePayload = new TestMessagePayload()
+ {
+ MessageLevel = level,
+ Message = message
+ };
+
+ this.communicationManager.SendMessage(MessageType.TestMessage, messagePayload);
+ }
+
+ ///
+ public void HandleRawMessage(string rawMessage)
+ {
+ // No-op.
+ }
+ }
+}
diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/AfterTestRunEndResult.cs b/src/Microsoft.TestPlatform.Common/DataCollection/AfterTestRunEndResult.cs
new file mode 100644
index 0000000000..1c65bb13d6
--- /dev/null
+++ b/src/Microsoft.TestPlatform.Common/DataCollection/AfterTestRunEndResult.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+namespace Microsoft.VisualStudio.TestPlatform.Common.DataCollection
+{
+ using Microsoft.VisualStudio.TestPlatform.ObjectModel;
+ using System.Collections.Generic;
+ using System.Collections.ObjectModel;
+ using System.Runtime.Serialization;
+
+ ///
+ /// Payload object that is used to exchange data between datacollector process and runner process.
+ ///
+ [DataContract]
+ public class AfterTestRunEndResult
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The collection of attachment sets.
+ ///
+ ///
+ /// The metrics.
+ ///
+ public AfterTestRunEndResult(Collection attachmentSets, IDictionary metrics)
+ {
+ this.AttachmentSets = attachmentSets;
+ this.Metrics = metrics;
+ }
+
+ [DataMember]
+ public Collection AttachmentSets { get; private set; }
+
+ [DataMember]
+ public IDictionary Metrics { get; private set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs
index fe3d2aa44c..401782efd3 100644
--- a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs
+++ b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs
@@ -8,12 +8,12 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.DataCollector
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
-
using Microsoft.VisualStudio.TestPlatform.Common.DataCollector.Interfaces;
using Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework;
using Microsoft.VisualStudio.TestPlatform.Common.Logging;
using Microsoft.VisualStudio.TestPlatform.Common.Utilities;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
+ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities;
@@ -61,13 +61,18 @@ internal class DataCollectionManager : IDataCollectionManager
///
private DataCollectorExtensionManager dataCollectorExtensionManager;
+ ///
+ /// Request data
+ ///
+ private IDataCollectionTelemetryManager dataCollectionTelemetryManager;
+
///
/// Initializes a new instance of the class.
///
///
/// The message Sink.
///
- internal DataCollectionManager(IMessageSink messageSink) : this(new DataCollectionAttachmentManager(), messageSink)
+ internal DataCollectionManager(IMessageSink messageSink, IRequestData requestData) : this(new DataCollectionAttachmentManager(), messageSink, new DataCollectionTelemetryManager(requestData))
{
}
@@ -83,13 +88,14 @@ internal DataCollectionManager(IMessageSink messageSink) : this(new DataCollecti
///
/// The constructor is not public because the factory method should be used to get instances of this class.
///
- protected DataCollectionManager(IDataCollectionAttachmentManager datacollectionAttachmentManager, IMessageSink messageSink)
+ protected DataCollectionManager(IDataCollectionAttachmentManager datacollectionAttachmentManager, IMessageSink messageSink, IDataCollectionTelemetryManager dataCollectionTelemetryManager)
{
this.attachmentManager = datacollectionAttachmentManager;
this.messageSink = messageSink;
this.events = new TestPlatformDataCollectionEvents();
this.dataCollectorExtensionManager = null;
this.RunDataCollectors = new Dictionary();
+ this.dataCollectionTelemetryManager = dataCollectionTelemetryManager;
}
///
@@ -128,7 +134,7 @@ private DataCollectorExtensionManager DataCollectorExtensionManager
///
/// The .
///
- public static DataCollectionManager Create(IMessageSink messageSink)
+ public static DataCollectionManager Create(IMessageSink messageSink, IRequestData requestData)
{
if (Instance == null)
{
@@ -136,7 +142,7 @@ public static DataCollectionManager Create(IMessageSink messageSink)
{
if (Instance == null)
{
- Instance = new DataCollectionManager(messageSink);
+ Instance = new DataCollectionManager(messageSink, requestData);
}
}
}
@@ -673,6 +679,8 @@ private void AddCollectorEnvironmentVariables(
dataCollectionWrapper.Logger.LogError(this.dataCollectionEnvironmentContext.SessionDataCollectionContext, message);
}
}
+
+ dataCollectionTelemetryManager.RecordEnvironmentVariableConflict(dataCollectionWrapper, namevaluepair.Key, namevaluepair.Value, alreadyRequestedVariable.Value);
}
else
{
@@ -685,6 +693,8 @@ private void AddCollectorEnvironmentVariables(
dataCollectorEnvironmentVariables.Add(
namevaluepair.Key,
new DataCollectionEnvironmentVariable(namevaluepair, collectorFriendlyName));
+
+ dataCollectionTelemetryManager.RecordEnvironmentVariableAddition(dataCollectionWrapper, namevaluepair.Key, namevaluepair.Value);
}
}
}
diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionTelemetryManager.cs b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionTelemetryManager.cs
new file mode 100644
index 0000000000..9396a17dc0
--- /dev/null
+++ b/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionTelemetryManager.cs
@@ -0,0 +1,102 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.VisualStudio.TestPlatform.Common.DataCollector.Interfaces;
+using Microsoft.VisualStudio.TestPlatform.Common.Telemetry;
+using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
+using System;
+using System.Linq;
+
+namespace Microsoft.VisualStudio.TestPlatform.Common.DataCollector
+{
+ ///
+ /// Stores and provides telemetry information for data collection.
+ ///
+ internal class DataCollectionTelemetryManager : IDataCollectionTelemetryManager
+ {
+ private const string CorProfilerVariable = "COR_PROFILER";
+ private const string CoreClrProfilerVariable = "CORECLR_PROFILER";
+ private const string ClrIeInstrumentationMethodConfigurationPrefix32Variable = "MicrosoftInstrumentationEngine_ConfigPath32_";
+ private const string ClrIeInstrumentationMethodConfigurationPrefix64Variable = "MicrosoftInstrumentationEngine_ConfigPath64_";
+
+ private static readonly Guid ClrIeProfilerGuid = Guid.Parse("{324f817a-7420-4e6d-b3c1-143fbed6d855}");
+ private const string OverwrittenProfilerName = "overwritten";
+
+ private readonly IRequestData requestData;
+
+ internal DataCollectionTelemetryManager(IRequestData requestData)
+ {
+ this.requestData = requestData;
+ }
+
+ ///
+ public void RecordEnvironmentVariableAddition(DataCollectorInformation dataCollectorInformation, string name, string value)
+ {
+ RecordProfilerMetricForNewVariable(CorProfilerVariable, TelemetryDataConstants.DataCollectorsCorProfiler, dataCollectorInformation, name, value);
+ RecordProfilerMetricForNewVariable(CoreClrProfilerVariable, TelemetryDataConstants.DataCollectorsCoreClrProfiler, dataCollectorInformation, name, value);
+ }
+
+ ///
+ public void RecordEnvironmentVariableConflict(DataCollectorInformation dataCollectorInformation, string name, string value, string existingValue)
+ {
+ RecordProfilerMetricForConflictedVariable(CorProfilerVariable, TelemetryDataConstants.DataCollectorsCorProfiler, dataCollectorInformation, name, value, existingValue);
+ RecordProfilerMetricForConflictedVariable(CoreClrProfilerVariable, TelemetryDataConstants.DataCollectorsCoreClrProfiler, dataCollectorInformation, name, value, existingValue);
+ }
+
+ private void RecordProfilerMetricForNewVariable(string profilerVariable, string telemetryPrefix, DataCollectorInformation dataCollectorInformation, string name, string value)
+ {
+ if (!string.Equals(profilerVariable, name, StringComparison.Ordinal))
+ {
+ return;
+ }
+
+ requestData.MetricsCollection.Add(GetTelemetryKey(telemetryPrefix, dataCollectorInformation), GetProfilerGuid(value).ToString());
+ }
+
+ private void RecordProfilerMetricForConflictedVariable(string profilerVariable, string telemetryPrefix, DataCollectorInformation dataCollectorInformation, string name, string value, string existingValue)
+ {
+ // If data collector is requesting same profiler record it same as new
+ if (string.Equals(value, existingValue, StringComparison.OrdinalIgnoreCase))
+ {
+ RecordProfilerMetricForNewVariable(profilerVariable, telemetryPrefix, dataCollectorInformation, name, value);
+ return;
+ }
+
+ if (!string.Equals(profilerVariable, name, StringComparison.Ordinal))
+ {
+ return;
+ }
+
+ var existingProfilerGuid = GetProfilerGuid(existingValue);
+
+ if (ClrIeProfilerGuid == existingProfilerGuid)
+ {
+ if (dataCollectorInformation.TestExecutionEnvironmentVariables != null &&
+ dataCollectorInformation.TestExecutionEnvironmentVariables.Any(pair => pair.Key.StartsWith(ClrIeInstrumentationMethodConfigurationPrefix32Variable)) &&
+ dataCollectorInformation.TestExecutionEnvironmentVariables.Any(pair => pair.Key.StartsWith(ClrIeInstrumentationMethodConfigurationPrefix64Variable)))
+ {
+ requestData.MetricsCollection.Add(GetTelemetryKey(telemetryPrefix, dataCollectorInformation), ClrIeProfilerGuid.ToString());
+ return;
+ }
+ }
+
+ requestData.MetricsCollection.Add(GetTelemetryKey(telemetryPrefix, dataCollectorInformation), $"{existingProfilerGuid}({OverwrittenProfilerName}:{GetProfilerGuid(value)})");
+ }
+
+ private static Guid GetProfilerGuid(string profilerGuid)
+ {
+ Guid guid;
+ if (Guid.TryParse(profilerGuid, out guid))
+ {
+ return guid;
+ }
+
+ return Guid.Empty;
+ }
+
+ private static string GetTelemetryKey(string telemetryPrefix, DataCollectorInformation dataCollectorInformation)
+ {
+ return string.Format("{0}.{1}", telemetryPrefix, dataCollectorInformation.DataCollectorConfig?.TypeUri?.ToString());
+ }
+ }
+}
diff --git a/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionTelemetryManager.cs b/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionTelemetryManager.cs
new file mode 100644
index 0000000000..9bc3550914
--- /dev/null
+++ b/src/Microsoft.TestPlatform.Common/DataCollection/Interfaces/IDataCollectionTelemetryManager.cs
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+namespace Microsoft.VisualStudio.TestPlatform.Common.DataCollector.Interfaces
+{
+ ///
+ /// The IDataCollectionTelemetryManager Interface.
+ ///
+ internal interface IDataCollectionTelemetryManager
+ {
+ ///
+ /// Record telemetry regarding environment variable added.
+ ///
+ ///
+ /// Data collector information which requested environment variable.
+ ///
+ ///
+ /// Environment variable name.
+ ///
+ ///
+ /// Environment variable value.
+ ///
+ void RecordEnvironmentVariableAddition(DataCollectorInformation dataCollectorInformation, string name, string value);
+
+ ///
+ /// Record telemetry regarding environment variable is conflicting.
+ ///
+ ///
+ /// Data collector information which requested environment variable.
+ ///
+ ///
+ /// Environment variable name.
+ ///
+ ///
+ /// Environment variable value.
+ ///
+ ///
+ /// Environment variable value that was requested previously.
+ ///
+ void RecordEnvironmentVariableConflict(DataCollectorInformation dataCollectorInformation, string name, string value, string existingValue);
+ }
+}
diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs
index 3d845df33a..f08f565394 100644
--- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs
+++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs
@@ -18,6 +18,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities;
using CommonResources = Resources.Resources;
+ using Microsoft.VisualStudio.TestPlatform.Common.Utilities;
///
/// Discovers test extensions in a directory.
@@ -108,8 +109,6 @@ private void AddKnownExtensions(ref IEnumerable extensionPaths)
///
/// Test plugins collection to add to.
///
- [SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId = "System.Reflection.Assembly.LoadFrom")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "We would like to continue discovering all plugins even if some dll in Extensions folder is not able to be load properly")]
private void GetTestExtensionsFromFiles(
string[] files,
Dictionary pluginInfos) where TPluginInfo : TestPluginInformation
@@ -167,13 +166,10 @@ private void GetTestExtensionsFromAssembly(Assembly ass
Type extension = typeof(TExtension);
try
- {
- var customAttribute = CustomAttributeExtensions.GetCustomAttribute(assembly, typeof(TypesToLoadAttribute)) as TypesToLoadAttribute;
- if (customAttribute != null)
- {
- types = customAttribute.Types;
- }
- else
+ {
+ types = TypesToLoadUtilities.GetTypesToLoad(assembly);
+
+ if (!types.Any())
{
types = assembly.GetTypes().Where(type => type.GetTypeInfo().IsClass && !type.GetTypeInfo().IsAbstract);
}
diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginManager.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginManager.cs
index ae780aa7a3..b322d75fd7 100644
--- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginManager.cs
+++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginManager.cs
@@ -5,7 +5,6 @@ namespace Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework
{
using System;
using System.Collections.Generic;
- using System.Diagnostics;
using System.Reflection;
using Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.Utilities;
diff --git a/src/Microsoft.TestPlatform.Common/Friends.cs b/src/Microsoft.TestPlatform.Common/Friends.cs
index e767fb98ad..fb645969e2 100644
--- a/src/Microsoft.TestPlatform.Common/Friends.cs
+++ b/src/Microsoft.TestPlatform.Common/Friends.cs
@@ -24,5 +24,5 @@
[assembly: InternalsVisibleTo("Microsoft.TestPlatform.Client.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
[assembly: InternalsVisibleTo("Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
[assembly: InternalsVisibleTo("Microsoft.TestPlatform.TestUtilities, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
-
+[assembly: InternalsVisibleTo("Microsoft.TestPlatform.AcceptanceTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
#endregion
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IProxyTestSessionManager.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IProxyTestSessionManager.cs
new file mode 100644
index 0000000000..415974639d
--- /dev/null
+++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/IProxyTestSessionManager.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Engine
+{
+ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
+
+ ///
+ /// Orchestrates test session related functionality for the engine communicating with the
+ /// client.
+ ///
+ public interface IProxyTestSessionManager
+ {
+ ///
+ /// Initialize the proxy.
+ ///
+ ///
+ /// Skip default adapters flag.
+ void Initialize(bool skipDefaultAdapters);
+
+ ///
+ /// Starts the test session based on the test session criteria.
+ ///
+ ///
+ /// The test session criteria.
+ ///
+ /// Event handler for handling events fired during test session management operations.
+ ///
+ void StartSession(
+ StartTestSessionCriteria criteria,
+ ITestSessionEventsHandler eventsHandler);
+
+ ///
+ /// Stops the test session.
+ ///
+ void StopSession();
+ }
+}
diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/ITestEngine.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/ITestEngine.cs
index 431c7c3ef1..03f2e222fb 100644
--- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/ITestEngine.cs
+++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/ClientProtocol/ITestEngine.cs
@@ -12,37 +12,76 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Engine
public interface ITestEngine
{
///
- /// Fetches the DiscoveryManager for this engine. This manager would provide all functionality required for discovery.
+ /// Fetches the DiscoveryManager for this engine. This manager would provide all
+ /// functionality required for discovery.
///
- /// The Request Data for providing discovery services and data.
+ ///
+ ///
+ /// The request data for providing discovery services and data.
+ ///
/// Test host manager for the current test discovery.
- /// The discovery Criteria.
- ///
- /// ITestDiscoveryManager object that can do discovery
- ///
- IProxyDiscoveryManager GetDiscoveryManager(IRequestData requestData, ITestRuntimeProvider testHostManager, DiscoveryCriteria discoveryCriteria);
+ /// The discovery criteria.
+ ///
+ /// An IProxyDiscoveryManager object that can do discovery.
+ IProxyDiscoveryManager GetDiscoveryManager(
+ IRequestData requestData,
+ ITestRuntimeProvider testHostManager,
+ DiscoveryCriteria discoveryCriteria);
///
- /// Fetches the ExecutionManager for this engine. This manager would provide all functionality required for execution.
+ /// Fetches the ExecutionManager for this engine. This manager would provide all
+ /// functionality required for execution.
///
- /// The request data for providing common execution services and data
- /// Test host manager for current test run.
- /// TestRunCriteria of the current test run
- /// ITestExecutionManager object that can do execution
- IProxyExecutionManager GetExecutionManager(IRequestData requestData, ITestRuntimeProvider testHostManager, TestRunCriteria testRunCriteria);
+ ///
+ ///
+ /// The request data for providing common execution services and data.
+ ///
+ /// Test host manager for the current test run.
+ /// Test run criteria of the current test run.
+ ///
+ /// An IProxyExecutionManager object that can do execution.
+ IProxyExecutionManager GetExecutionManager(
+ IRequestData requestData,
+ ITestRuntimeProvider testHostManager,
+ TestRunCriteria testRunCriteria);
+
+ ///
+ /// Fetches the TestSessionManager for this engine. This manager would provide all
+ /// functionality required for test session management.
+ ///
+ ///
+ ///
+ /// The request data for providing test session services and data.
+ ///
+ /// Test host manager for the current test session.
+ ///
+ /// Test session criteria of the current test session.
+ ///
+ ///
+ /// An IProxyTestSessionManager object that can manage test sessions.
+ IProxyTestSessionManager GetTestSessionManager(
+ IRequestData requestData,
+ ITestRuntimeProvider testHostManager,
+ StartTestSessionCriteria testSessionCriteria);
///
/// Fetches the extension manager for this engine. This manager would provide extensibility
/// features that this engine supports.
///
- /// ITestExtensionManager object that helps with extensibility
+ ///
+ /// An ITestExtensionManager object that helps with extensibility.
ITestExtensionManager GetExtensionManager();
///
- /// Fetches the logger manager for this engine. This manager will provide logger extensibility features that this engine supports.
+ /// Fetches the logger manager for this engine. This manager will provide logger
+ /// extensibility features that this engine supports.
///
- /// The request data for providing common execution services and data
- /// ITestLoggerManager object that helps with logger extensibility.
+ ///
+ ///
+ /// The request data for providing common execution services and data.
+ ///
+ ///
+ /// An ITestLoggerManager object that helps with logger extensibility.
ITestLoggerManager GetLoggerManager(IRequestData requestData);
}
}
diff --git a/src/Microsoft.TestPlatform.Common/RequestData.cs b/src/Microsoft.TestPlatform.Common/RequestData.cs
index 14f2ae0033..128bc3fc5f 100644
--- a/src/Microsoft.TestPlatform.Common/RequestData.cs
+++ b/src/Microsoft.TestPlatform.Common/RequestData.cs
@@ -4,7 +4,7 @@
namespace Microsoft.VisualStudio.TestPlatform.Common
{
using System;
-
+ using Microsoft.VisualStudio.TestPlatform.Common.Telemetry;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
///
@@ -23,6 +23,15 @@ public class RequestData : IRequestData
///
private ProtocolConfig protocolConfig;
+ ///
+ /// The default constructor for request data.
+ ///
+ public RequestData()
+ {
+ this.MetricsCollection = new NoOpMetricsCollection();
+ this.IsTelemetryOptedIn = false;
+ }
+
///
/// Gets or sets the metrics collection.
///
diff --git a/src/Microsoft.TestPlatform.Common/Telemetry/TelemetryDataConstants.cs b/src/Microsoft.TestPlatform.Common/Telemetry/TelemetryDataConstants.cs
index be35c610c2..0b1ca41424 100644
--- a/src/Microsoft.TestPlatform.Common/Telemetry/TelemetryDataConstants.cs
+++ b/src/Microsoft.TestPlatform.Common/Telemetry/TelemetryDataConstants.cs
@@ -26,6 +26,10 @@ public static class TelemetryDataConstants
public static string DataCollectorsEnabled = "VS.TestRun.DataCollectorsEnabled";
+ internal const string DataCollectorsCorProfiler = "VS.TestPlatform.DataCollector.CorProfiler";
+
+ internal const string DataCollectorsCoreClrProfiler = "VS.TestPlatform.DataCollector.CoreClrProfiler";
+
public static string RunState = "VS.TestRun.RunState";
public static string NumberOfSourcesSentForRun = "VS.TestRun.NumberOfSources";
@@ -68,6 +72,8 @@ public static class TelemetryDataConstants
public static string ParallelEnabledDuringDiscovery = "VS.TestDiscovery.ParallelEnabled";
+ public static string ParallelEnabledDuringStartTestSession = "VS.StartTestSession.ParallelEnabled";
+
// All the times are in sec
public static string TimeTakenInSecForDiscovery = "VS.TestDiscovery.TotalTimeTakenInSec";
@@ -104,5 +110,7 @@ public static class TelemetryDataConstants
public static string TestExecutionCompleteEvent = "vs/testplatform/testrunsession";
public static string TestAttachmentsProcessingCompleteEvent = "vs/testplatform/testattachmentsprocessingsession";
+
+ public static string StartTestSessionCompleteEvent = "vs/testplatform/starttestsession";
}
}
diff --git a/src/Microsoft.TestPlatform.Common/Utilities/TypesToLoadUtilities.cs b/src/Microsoft.TestPlatform.Common/Utilities/TypesToLoadUtilities.cs
new file mode 100644
index 0000000000..22f568f399
--- /dev/null
+++ b/src/Microsoft.TestPlatform.Common/Utilities/TypesToLoadUtilities.cs
@@ -0,0 +1,42 @@
+// Copyright(c) Microsoft Corporation.All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+namespace Microsoft.VisualStudio.TestPlatform.Common.Utilities
+{
+ using Microsoft.VisualStudio.TestPlatform.ObjectModel;
+ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities;
+
+ using System;
+ using System.Collections.Generic;
+ using System.Reflection;
+ using System.Linq;
+
+ internal static class TypesToLoadUtilities
+ {
+ public const string TypesToLoadAttributeFullName = "Microsoft.VisualStudio.TestPlatform.TestExtensionTypesAttribute";
+
+ internal static IEnumerable GetTypesToLoad(Assembly assembly)
+ {
+ ValidateArg.NotNull(assembly, nameof(assembly));
+
+ var typesToLoad = assembly
+ .GetCustomAttributes(TypesToLoadAttributeFullName)
+ .SelectMany(i => GetTypesToLoad(i));
+
+ return typesToLoad;
+ }
+
+ private static IEnumerable GetTypesToLoad(Attribute attribute)
+ {
+ if (attribute == null)
+ return Enumerable.Empty();
+
+ var type = attribute.GetType();
+ var typesProperty = type.GetProperty("Types");
+ if(typesProperty == null)
+ return Enumerable.Empty();
+
+ return typesProperty.GetValue(attribute) as Type[];
+ }
+ }
+}
diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestHandler.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestHandler.cs
index ee319c2744..7add8c6308 100644
--- a/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestHandler.cs
+++ b/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestHandler.cs
@@ -16,11 +16,13 @@ namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.DataCollect
using Microsoft.VisualStudio.TestPlatform.Common.DataCollector;
using Microsoft.VisualStudio.TestPlatform.Common.DataCollector.Interfaces;
using Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework;
+ using Microsoft.VisualStudio.TestPlatform.Common.Telemetry;
using Microsoft.VisualStudio.TestPlatform.Common.Utilities;
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.DataCollection.Interfaces;
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces;
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
+ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
using Microsoft.VisualStudio.TestPlatform.Utilities.Helpers;
@@ -49,6 +51,8 @@ internal class DataCollectionRequestHandler : IDataCollectionRequestHandler, IDi
private IFileHelper fileHelper;
+ private IRequestData requestData;
+
///
/// Use to cancel data collection test case events monitoring if test run is canceled.
///
@@ -60,14 +64,18 @@ internal class DataCollectionRequestHandler : IDataCollectionRequestHandler, IDi
///
/// The message sink.
///
- protected DataCollectionRequestHandler(IMessageSink messageSink)
+ ///
+ /// The request data.
+ ///
+ protected DataCollectionRequestHandler(IMessageSink messageSink, IRequestData requestData)
: this(
new SocketCommunicationManager(),
messageSink,
- DataCollectionManager.Create(messageSink),
+ DataCollectionManager.Create(messageSink, requestData),
new DataCollectionTestCaseEventHandler(),
JsonDataSerializer.Instance,
- new FileHelper())
+ new FileHelper(),
+ requestData)
{
this.messageSink = messageSink;
}
@@ -93,13 +101,17 @@ protected DataCollectionRequestHandler(IMessageSink messageSink)
///
/// File Helper
///
+ ///
+ /// Request data
+ ///
protected DataCollectionRequestHandler(
ICommunicationManager communicationManager,
IMessageSink messageSink,
IDataCollectionManager dataCollectionManager,
IDataCollectionTestCaseEventHandler dataCollectionTestCaseEventHandler,
IDataSerializer dataSerializer,
- IFileHelper fileHelper)
+ IFileHelper fileHelper,
+ IRequestData requestData)
{
this.communicationManager = communicationManager;
this.messageSink = messageSink;
@@ -108,6 +120,7 @@ protected DataCollectionRequestHandler(
this.dataCollectionTestCaseEventHandler = dataCollectionTestCaseEventHandler;
this.cancellationTokenSource = new CancellationTokenSource();
this.fileHelper = fileHelper;
+ this.requestData = requestData;
}
///
@@ -139,13 +152,16 @@ public static DataCollectionRequestHandler Create(
{
if (Instance == null)
{
+ var requestData = new RequestData();
+
Instance = new DataCollectionRequestHandler(
communicationManager,
messageSink,
- DataCollectionManager.Create(messageSink),
+ DataCollectionManager.Create(messageSink, requestData),
new DataCollectionTestCaseEventHandler(),
JsonDataSerializer.Instance,
- new FileHelper());
+ new FileHelper(),
+ requestData);
}
}
}
@@ -295,6 +311,7 @@ private void HandleBeforeTestRunStart(Message message)
{
// Initialize datacollectors and get environment variables.
var payload = this.dataSerializer.DeserializePayload(message);
+ this.UpdateRequestData(payload.IsTelemetryOptedIn);
this.AddExtensionAssemblies(payload);
var envVariables = this.dataCollectionManager.InitializeDataCollectors(payload.SettingsXml);
@@ -372,17 +389,27 @@ private void HandleAfterTestRunEnd(Message message)
}
var attachmentsets = this.dataCollectionManager.SessionEnded(isCancelled);
+ var afterTestRunEndResult = new AfterTestRunEndResult(attachmentsets, this.requestData.MetricsCollection.Metrics);
// Dispose all datacollectors before sending attachments to vstest.console process.
// As datacollector process exits itself on parent process(vstest.console) exits.
this.dataCollectionManager?.Dispose();
- this.communicationManager.SendMessage(MessageType.AfterTestRunEndResult, attachmentsets);
+ this.communicationManager.SendMessage(MessageType.AfterTestRunEndResult, afterTestRunEndResult);
EqtTrace.Info("DataCollectionRequestHandler.ProcessRequests : Session End message received from server. Closing the connection.");
this.Close();
EqtTrace.Info("DataCollectionRequestHandler.ProcessRequests : DataCollection completed");
}
+
+ private void UpdateRequestData(bool isTelemetryOptedIn)
+ {
+ if (isTelemetryOptedIn != this.requestData.IsTelemetryOptedIn)
+ {
+ this.requestData.MetricsCollection = isTelemetryOptedIn ? (IMetricsCollection)new MetricsCollection() : new NoOpMetricsCollection();
+ this.requestData.IsTelemetryOptedIn = isTelemetryOptedIn;
+ }
+ }
}
}
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestSender.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestSender.cs
index 0da7ea32d2..f51e3b7d5d 100644
--- a/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestSender.cs
+++ b/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestSender.cs
@@ -4,7 +4,6 @@
namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.DataCollection
{
using System.Collections.Generic;
- using System.Collections.ObjectModel;
using System.Globalization;
using System.Net;
@@ -108,7 +107,7 @@ public void SendTestHostLaunched(TestHostLaunchedPayload testHostLaunchedPayload
}
///
- public BeforeTestRunStartResult SendBeforeTestRunStartAndGetResult(string settingsXml, IEnumerable sources, ITestMessageEventHandler runEventsHandler)
+ public BeforeTestRunStartResult SendBeforeTestRunStartAndGetResult(string settingsXml, IEnumerable sources, bool isTelemetryOptedIn, ITestMessageEventHandler runEventsHandler)
{
var isDataCollectionStarted = false;
BeforeTestRunStartResult result = null;
@@ -121,7 +120,8 @@ public BeforeTestRunStartResult SendBeforeTestRunStartAndGetResult(string settin
var payload = new BeforeTestRunStartPayload
{
SettingsXml = settingsXml,
- Sources = sources
+ Sources = sources,
+ IsTelemetryOptedIn = isTelemetryOptedIn
};
this.communicationManager.SendMessage(MessageType.BeforeTestRunStart, payload);
@@ -151,10 +151,10 @@ public BeforeTestRunStartResult SendBeforeTestRunStartAndGetResult(string settin
}
///
- public Collection SendAfterTestRunEndAndGetResult(ITestMessageEventHandler runEventsHandler, bool isCancelled)
+ public AfterTestRunEndResult SendAfterTestRunEndAndGetResult(ITestMessageEventHandler runEventsHandler, bool isCancelled)
{
var isDataCollectionComplete = false;
- Collection attachmentSets = null;
+ AfterTestRunEndResult result = null;
if (EqtTrace.IsVerboseEnabled)
{
@@ -181,12 +181,12 @@ public Collection SendAfterTestRunEndAndGetResult(ITestMessageEve
}
else if (message.MessageType == MessageType.AfterTestRunEndResult)
{
- attachmentSets = this.dataSerializer.DeserializePayload>(message);
+ result = this.dataSerializer.DeserializePayload(message);
isDataCollectionComplete = true;
}
}
- return attachmentSets;
+ return result;
}
private void LogDataCollectorMessage(DataCollectionMessageEventArgs dataCollectionMessageEventArgs, ITestMessageEventHandler requestHandler)
diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionRequestSender.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionRequestSender.cs
index 4e70e5ea41..5dd36660b1 100644
--- a/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionRequestSender.cs
+++ b/src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/IDataCollectionRequestSender.cs
@@ -4,11 +4,9 @@
namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.DataCollection.Interfaces
{
using System.Collections.Generic;
- using System.Collections.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.Common.DataCollection;
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel;
- using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
///
@@ -51,13 +49,16 @@ internal interface IDataCollectionRequestSender
///
/// Test run sources
///
+ ///
+ /// Telemetry opted in flag.
+ ///
///
/// Test message event handler for handling messages.
///
///
/// BeforeTestRunStartResult containing environment variables
///
- BeforeTestRunStartResult SendBeforeTestRunStartAndGetResult(string settingXml, IEnumerable sources, ITestMessageEventHandler runEventsHandler);
+ BeforeTestRunStartResult SendBeforeTestRunStartAndGetResult(string settingXml, IEnumerable sources, bool isTelemetryOptedIn, ITestMessageEventHandler runEventsHandler);
///
/// Sends the AfterTestRunEnd event and waits for result
@@ -69,8 +70,8 @@ internal interface IDataCollectionRequestSender
/// The value to specify whether the test run is canceled or not.
///
///
- /// DataCollector attachments
+ /// AfterTestRunEndResult containing dataCollector attachments and metrics
///
- Collection SendAfterTestRunEndAndGetResult(ITestMessageEventHandler runEventsHandler, bool isCancelled);
+ AfterTestRunEndResult SendAfterTestRunEndAndGetResult(ITestMessageEventHandler runEventsHandler, bool isCancelled);
}
}
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/JsonDataSerializer.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/JsonDataSerializer.cs
index 5eea4ca571..db7e58a08f 100644
--- a/src/Microsoft.TestPlatform.CommunicationUtilities/JsonDataSerializer.cs
+++ b/src/Microsoft.TestPlatform.CommunicationUtilities/JsonDataSerializer.cs
@@ -229,6 +229,7 @@ private JsonSerializer GetPayloadSerializer(int? version)
return payloadSerializer;
case 2:
case 4:
+ case 5:
return payloadSerializer2;
default:
throw new NotSupportedException($"Protocol version {version} is not supported. " +
diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/Messages/BeforeTestRunStartPayload.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/Messages/BeforeTestRunStartPayload.cs
index c6150547fd..a8872140fe 100644
--- a/src/Microsoft.TestPlatform.CommunicationUtilities/Messages/BeforeTestRunStartPayload.cs
+++ b/src/Microsoft.TestPlatform.CommunicationUtilities/Messages/BeforeTestRunStartPayload.cs
@@ -19,5 +19,10 @@ public class BeforeTestRunStartPayload
/// Gets or sets list of test sources.
///
public IEnumerable Sources { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether telemetry is enabled.
+ ///
+ public bool IsTelemetryOptedIn { get; set; }
}
}
diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/Messages/MessageType.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/Messages/MessageType.cs
index 76cfeec873..0a92bbc38b 100644
--- a/src/Microsoft.TestPlatform.CommunicationUtilities/Messages/MessageType.cs
+++ b/src/Microsoft.TestPlatform.CommunicationUtilities/Messages/MessageType.cs
@@ -193,6 +193,26 @@ public static class MessageType
///
public const string DataCollectionMessage = "DataCollection.SendMessage";
+ ///
+ /// StartTestSession message.
+ ///
+ public const string StartTestSession = "TestSession.StartTestSession";
+
+ ///
+ /// StartTestSession callback message.
+ ///
+ public const string StartTestSessionCallback = "TestSession.StartTestSessionCallback";
+
+ ///
+ /// StopTestSession message.
+ ///
+ public const string StopTestSession = "TestSession.StopTestSession";
+
+ ///
+ /// StopTestSession callback message.
+ ///
+ public const string StopTestSessionCallback = "TestSession.StopTestSessionCallback";
+
#region DataCollector messages
///
diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs
index e0896ab338..df3bc35603 100644
--- a/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs
+++ b/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs
@@ -52,8 +52,9 @@ public class TestRequestSender : ITestRequestSender
// that implies host is using version 1.
private int protocolVersion = 1;
- // Also check TestRequestHandler.
- private int highestSupportedVersion = 4;
+ // Must be in sync with the highest supported version in
+ // src/Microsoft.TestPlatform.CrossPlatEngine/EventHandlers/TestRequestHandler.cs file.
+ private int highestSupportedVersion = 5;
private TestHostConnectionInfo connectionInfo;
@@ -733,4 +734,4 @@ private void SetCommunicationEndPoint()
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Resources/Resources.resx b/src/Microsoft.TestPlatform.CoreUtilities/Resources/Resources.resx
index 27a397f0d5..ba520ac0b1 100644
--- a/src/Microsoft.TestPlatform.CoreUtilities/Resources/Resources.resx
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Resources/Resources.resx
@@ -165,10 +165,4 @@
Error getting process name.
-
- '{0}.{1}' is not implemented on this platform!
- '{className}.{methodName}' is not implemented on this platform!
-
-Example: 'System.Reflection.MethodBase' is not implemented on this platform!
-
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Resources/xlf/Resources.cs.xlf b/src/Microsoft.TestPlatform.CoreUtilities/Resources/xlf/Resources.cs.xlf
index 47832fc031..d3fcf4893f 100644
--- a/src/Microsoft.TestPlatform.CoreUtilities/Resources/xlf/Resources.cs.xlf
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Resources/xlf/Resources.cs.xlf
@@ -160,13 +160,6 @@
Hostitele {0} nešlo najít. Ujistěte se, jestli je {0} nainstalovaný na počítači a dostupný v cestě určené proměnnou prostředí PATH.
-
-
- '{0}.{1}' is not implemented on this platform!
- '{className}.{methodName}' is not implemented on this platform!
-
-Example: 'System.Reflection.MethodBase' is not implemented on this platform!
-