Skip to content

Commit baa6d97

Browse files
authored
Cleanup new dotnet test tests (#47547)
1 parent c74c63b commit baa6d97

9 files changed

+0
-60
lines changed

test/Microsoft.NET.TestFramework/Commands/TestCommand.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ public TestCommand WithTraceOutput()
6161
return this;
6262
}
6363

64-
public TestCommand WithEnableTestingPlatform()
65-
{
66-
WithEnvironmentVariable("DOTNET_CLI_TESTINGPLATFORM_ENABLE", "1");
67-
return this;
68-
}
69-
7064
private SdkCommandSpec CreateCommandSpec(IEnumerable<string> args)
7165
{
7266
var commandSpec = CreateCommand(args);

test/dotnet-test.Tests/GivenDotnetTestBuildsAndDiscoversTests.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public void DiscoverTestProjectWithNoTests_ShouldReturnExitCodeGenericFailure(st
2121

2222
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
2323
.WithWorkingDirectory(testInstance.Path)
24-
.WithEnableTestingPlatform()
2524
.Execute(TestingPlatformOptions.ListTestsOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration);
2625

2726
if (!TestContext.IsLocalized())
@@ -45,7 +44,6 @@ public void DiscoverMultipleTestProjectsWithNoTests_ShouldReturnExitCodeGenericF
4544

4645
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
4746
.WithWorkingDirectory(testInstance.Path)
48-
.WithEnableTestingPlatform()
4947
.Execute(TestingPlatformOptions.ListTestsOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration);
5048

5149
if (!TestContext.IsLocalized())
@@ -69,7 +67,6 @@ public void DiscoverTestProjectWithTests_ShouldReturnExitCodeSuccess(string conf
6967

7068
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
7169
.WithWorkingDirectory(testInstance.Path)
72-
.WithEnableTestingPlatform()
7370
.Execute(TestingPlatformOptions.ListTestsOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration);
7471

7572
if (!TestContext.IsLocalized())
@@ -91,7 +88,6 @@ public void DiscoverMultipleTestProjectsWithTests_ShouldReturnExitCodeSuccess(st
9188

9289
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
9390
.WithWorkingDirectory(testInstance.Path)
94-
.WithEnableTestingPlatform()
9591
.Execute(TestingPlatformOptions.ListTestsOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration);
9692

9793
if (!TestContext.IsLocalized())
@@ -115,7 +111,6 @@ public void DiscoverProjectWithMSTestMetaPackageAndMultipleTFMsWithTests_ShouldR
115111

116112
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
117113
.WithWorkingDirectory(testInstance.Path)
118-
.WithEnableTestingPlatform()
119114
.Execute(TestingPlatformOptions.ListTestsOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration);
120115

121116
if (!TestContext.IsLocalized())
@@ -137,7 +132,6 @@ public void DiscoverTestProjectsWithHybridModeTestRunners_ShouldReturnExitCodeGe
137132

138133
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
139134
.WithWorkingDirectory(testInstance.Path)
140-
.WithEnableTestingPlatform()
141135
.Execute(TestingPlatformOptions.ListTestsOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration);
142136

143137
if (!TestContext.IsLocalized())

test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsHelp.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public void RunHelpOnTestProject_ShouldReturnExitCodeSuccess(string configuratio
2121

2222
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
2323
.WithWorkingDirectory(testInstance.Path)
24-
.WithEnableTestingPlatform()
2524
.Execute(TestingPlatformOptions.HelpOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration);
2625

2726
if (!TestContext.IsLocalized())
@@ -44,7 +43,6 @@ public void RunHelpOnMultipleTestProjects_ShouldReturnExitCodeSuccess(string con
4443

4544
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
4645
.WithWorkingDirectory(testInstance.Path)
47-
.WithEnableTestingPlatform()
4846
.Execute(TestingPlatformOptions.HelpOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration);
4947

5048
if (!TestContext.IsLocalized())

test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public void RunTestProjectWithFilterOfDll_ShouldReturnExitCodeSuccess()
2626

2727
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
2828
.WithWorkingDirectory(testInstance.Path)
29-
.WithEnableTestingPlatform()
3029
.Execute(TestingPlatformOptions.TestModulesFilterOption.Name, $"**/bin/**/Debug/{ToolsetInfo.CurrentTargetFramework}/TestProject.dll".Replace('/', Path.DirectorySeparatorChar));
3130

3231
// Assert that the bin folder hasn't been modified
@@ -69,7 +68,6 @@ public void RunTestProjectsWithFilterOfDll_ShouldReturnExitCodeGenericFailure()
6968

7069
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
7170
.WithWorkingDirectory(testInstance.Path)
72-
.WithEnableTestingPlatform()
7371
.Execute(TestingPlatformOptions.TestModulesFilterOption.Name, filterExpression);
7472

7573
// Assert that the bin folder hasn't been modified
@@ -104,7 +102,6 @@ public void RunTestProjectWithFilterOfDllWithRootDirectory_ShouldReturnExitCodeS
104102

105103
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
106104
.WithWorkingDirectory(testInstance.Path)
107-
.WithEnableTestingPlatform()
108105
.WithTraceOutput()
109106
.Execute(TestingPlatformOptions.TestModulesFilterOption.Name, $"**/bin/**/Debug/{ToolsetInfo.CurrentTargetFramework}/TestProject.dll".Replace('/', Path.DirectorySeparatorChar),
110107
TestingPlatformOptions.TestModulesRootDirectoryOption.Name, testInstance.TestRoot);

test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTests.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public void RunTestProjectWithNoTests_ShouldReturnExitCodeGenericFailure(string
2121

2222
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
2323
.WithWorkingDirectory(testInstance.Path)
24-
.WithEnableTestingPlatform()
2524
.Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration);
2625

2726
if (!TestContext.IsLocalized())
@@ -47,7 +46,6 @@ public void RunMultipleTestProjectsWithNoTests_ShouldReturnExitCodeGenericFailur
4746

4847
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
4948
.WithWorkingDirectory(testInstance.Path)
50-
.WithEnableTestingPlatform()
5149
.Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration);
5250

5351
if (!TestContext.IsLocalized())
@@ -73,7 +71,6 @@ public void RunTestProjectWithTests_ShouldReturnExitCodeSuccess(string configura
7371

7472
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
7573
.WithWorkingDirectory(testInstance.Path)
76-
.WithEnableTestingPlatform()
7774
.Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration);
7875

7976
if (!TestContext.IsLocalized())
@@ -100,7 +97,6 @@ public void RunMultipleTestProjectsWithFailingTests_ShouldReturnExitCodeGenericF
10097

10198
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
10299
.WithWorkingDirectory(testInstance.Path)
103-
.WithEnableTestingPlatform()
104100
.Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration);
105101

106102
if (!TestContext.IsLocalized())
@@ -126,7 +122,6 @@ public void RunMultipleTestProjectsWithDifferentFailures_ShouldReturnExitCodeGen
126122

127123
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
128124
.WithWorkingDirectory(testInstance.Path)
129-
.WithEnableTestingPlatform()
130125
.Execute("--minimum-expected-tests 2",
131126
TestingPlatformOptions.ConfigurationOption.Name, configuration);
132127

@@ -157,7 +152,6 @@ public void RunTestProjectsWithHybridModeTestRunners_ShouldReturnExitCodeGeneric
157152

158153
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
159154
.WithWorkingDirectory(testInstance.Path)
160-
.WithEnableTestingPlatform()
161155
.Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration);
162156

163157
if (!TestContext.IsLocalized())
@@ -178,7 +172,6 @@ public void RunOnEmptyFolder_ShouldReturnExitCodeGenericFailure(string configura
178172

179173
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
180174
.WithWorkingDirectory(testInstance.Path)
181-
.WithEnableTestingPlatform()
182175
.Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration);
183176

184177
if (!TestContext.IsLocalized())
@@ -199,7 +192,6 @@ public void RunOnMultipleProjectFoldersWithoutSolutionFile_ShouldReturnExitCodeG
199192

200193
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
201194
.WithWorkingDirectory(testInstance.Path)
202-
.WithEnableTestingPlatform()
203195
.Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration);
204196

205197
if (!TestContext.IsLocalized())
@@ -220,7 +212,6 @@ public void RunOnProjectWithSolutionFile_ShouldReturnExitCodeGenericFailure(stri
220212

221213
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
222214
.WithWorkingDirectory(testInstance.Path)
223-
.WithEnableTestingPlatform()
224215
.Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration);
225216

226217
if (!TestContext.IsLocalized())
@@ -241,7 +232,6 @@ public void RunOnProjectWithClassLibrary_ShouldReturnExitCodeSuccess(string conf
241232

242233
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
243234
.WithWorkingDirectory(testInstance.Path)
244-
.WithEnableTestingPlatform()
245235
.Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration);
246236

247237
if (!TestContext.IsLocalized())
@@ -268,7 +258,6 @@ public void RunningWithGlobalPropertyShouldProperlyPropagate(string configuratio
268258

269259
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
270260
.WithWorkingDirectory(testInstance.Path)
271-
.WithEnableTestingPlatform()
272261
.Execute(
273262
TestingPlatformOptions.ConfigurationOption.Name, configuration,
274263
CommonOptions.PropertiesOption.Name, "PROPERTY_TO_ENABLE_MTP=1");

test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestsForMultipleTFMs.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public void RunMultipleProjectWithDifferentTFMs_ShouldReturnExitCodeGenericFailu
2323

2424
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
2525
.WithWorkingDirectory(testInstance.Path)
26-
.WithEnableTestingPlatform()
2726
.Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration);
2827

2928
if (!TestContext.IsLocalized())
@@ -62,7 +61,6 @@ public void RunProjectWithMultipleTFMs_ShouldReturnExitCodeGenericFailure(string
6261

6362
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
6463
.WithWorkingDirectory(testInstance.Path)
65-
.WithEnableTestingPlatform()
6664
.Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration);
6765

6866
if (!TestContext.IsLocalized())
@@ -110,7 +108,6 @@ public void RunProjectWithMultipleTFMsWithArchOption_ShouldReturnExitCodeGeneric
110108

111109
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
112110
.WithWorkingDirectory(testInstance.Path)
113-
.WithEnableTestingPlatform()
114111
.Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration,
115112
CommonOptions.ArchitectureOption.Name, arch);
116113

@@ -138,7 +135,6 @@ public void RunProjectWithMSTestMetaPackageAndMultipleTFMs_ShouldReturnExitCodeG
138135

139136
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
140137
.WithWorkingDirectory(testInstance.Path)
141-
.WithEnableTestingPlatform()
142138
.Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration);
143139

144140
if (!TestContext.IsLocalized())

test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestsWithArtifacts.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public void RunTestProjectWithFailingTestsAndFileArtifacts_ShouldReturnExitCodeG
2222

2323
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
2424
.WithWorkingDirectory(testInstance.Path)
25-
.WithEnableTestingPlatform()
2625
.Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration);
2726

2827
if (!TestContext.IsLocalized())
@@ -60,7 +59,6 @@ public void RunTestProjectWithCodeCoverage_ShouldReturnExitCodeGenericFailure(st
6059

6160
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
6261
.WithWorkingDirectory(testInstance.Path)
63-
.WithEnableTestingPlatform()
6462
.Execute("--coverage", TestingPlatformOptions.ConfigurationOption.Name, configuration);
6563

6664
if (!TestContext.IsLocalized())

0 commit comments

Comments
 (0)