Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,19 @@
"id": "restoreNugetPackages",
"continueOnError": true
},
{
"condition": "(TestRunner == \"Microsoft.Testing.Platform\")",
"description": "Create or update 'dotnet.config' file required by Microsoft.Testing.Platform.",
"manualInstructions": [{ "text": "Manually create 'dotnet.config' file setting the test runner to Microsoft.Testing.Platform" }],
"actionId": "597E7933-0D87-452C-B094-8FA0EEF7FD97",
"id": "createOrUpdateDotnetConfig",
"args": {
"section": "dotnet.test.runner",
"key": "name",
"value": "Microsoft.Testing.Platform",
},
"continueOnError": true
},
{
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
"description": "Opens Test1.cs in the editor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,19 @@
"id": "restoreNugetPackages",
"continueOnError": true
},
{
"condition": "(TestRunner == \"Microsoft.Testing.Platform\")",
"description": "Create or update 'dotnet.config' file required by Microsoft.Testing.Platform.",
"manualInstructions": [{ "text": "Manually create 'dotnet.config' file setting the test runner to Microsoft.Testing.Platform" }],
"actionId": "597E7933-0D87-452C-B094-8FA0EEF7FD97",
"id": "createOrUpdateDotnetConfig",
"args": {
"section": "dotnet.test.runner",
"key": "name",
"value": "Microsoft.Testing.Platform",
},
"continueOnError": true
},
{
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
"description": "Opens Test1.fs in the editor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,19 @@
"id": "restoreNugetPackages",
"continueOnError": true
},
{
"condition": "(TestRunner == \"Microsoft.Testing.Platform\")",
"description": "Create or update 'dotnet.config' file required by Microsoft.Testing.Platform.",
"manualInstructions": [{ "text": "Manually create 'dotnet.config' file setting the test runner to Microsoft.Testing.Platform" }],
"actionId": "597E7933-0D87-452C-B094-8FA0EEF7FD97",
"id": "createOrUpdateDotnetConfig",
"args": {
"section": "dotnet.test.runner",
"key": "name",
"value": "Microsoft.Testing.Platform",
},
"continueOnError": true
},
{
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
"description": "Opens Test1.vb in the editor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,19 @@
"id": "restoreNugetPackages",
"continueOnError": true
},
{
"condition": "(TestRunner == \"Microsoft.Testing.Platform\")",
"description": "Create or update 'dotnet.config' file required by Microsoft.Testing.Platform.",
"manualInstructions": [{ "text": "Manually create 'dotnet.config' file setting the test runner to Microsoft.Testing.Platform" }],
"actionId": "597E7933-0D87-452C-B094-8FA0EEF7FD97",
"id": "createOrUpdateDotnetConfig",
"args": {
"section": "dotnet.test.runner",
"key": "name",
"value": "Microsoft.Testing.Platform",
},
"continueOnError": true
},
{
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
"description": "Opens Test1.cs in the editor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ public void MSTestAndPlaywrightProjectTemplate_WithCoverageToolAndTestRunner_Can
{
string testProjectName = GenerateTestProjectName();
string outputDirectory = CreateTemporaryFolder(folderName: "Home");

// Prevent the dotnet.config post action from walking up the directory parents up to our own solution root, which would affect other tests.
Directory.CreateDirectory(Path.Combine(outputDirectory, ".git"));

string workingDirectory = CreateTemporaryFolder();

// Create new test project: dotnet new <projectTemplate> -n <testProjectName> -f <targetFramework> -lang <language> --coverage-tool <coverageTool> --test-runner <testRunner>
Expand All @@ -196,10 +200,7 @@ public void MSTestAndPlaywrightProjectTemplate_WithCoverageToolAndTestRunner_Can
var isMTP = testRunner == "Microsoft.Testing.Platform";
if (isMTP)
{
File.WriteAllText(Path.Combine(outputDirectory, "dotnet.config"), """
[dotnet.test.runner]
name = "Microsoft.Testing.Platform"
""");
File.Exists(Path.Combine(outputDirectory, "dotnet.config")).Should().BeTrue();
}

var result = new DotnetTestCommand(_log, false)
Expand Down
Loading