Skip to content

Commit e5e4503

Browse files
authored
Unskip test command tests on macOS (#50701)
1 parent cb2c757 commit e5e4503

6 files changed

+23
-41
lines changed

test/Microsoft.NET.TestFramework/Utilities/RegexPatternHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static string GenerateProjectRegexPattern(string projectName, string resu
1616
string.Empty;
1717

1818
string exitCodePattern = exitCode == null ? string.Empty : $@"[\s\S]*?Exit\s+code: {exitCode}";
19-
return $@".+{configuration}{PathUtility.GetDirectorySeparatorChar()}{version}{PathUtility.GetDirectorySeparatorChar()}{runtimeIdentifier}{projectName}(\.dll|\.exe)?\s+\({version}\|[a-zA-Z][1-9]+\)\s{result}{exitCodePattern}";
19+
return $@".+{configuration}{PathUtility.GetDirectorySeparatorChar()}{version}{PathUtility.GetDirectorySeparatorChar()}{runtimeIdentifier}{projectName}(\.dll|\.exe)?\s+\({version}\|[a-zA-Z]+[1-9]+\)\s{result}{exitCodePattern}";
2020
}
2121

2222
public static string GenerateProjectRegexPattern(string projectName, bool useCurrentVersion, string configuration, string prefix, List<string>? suffix = null, bool addVersionAndArchPattern = true)
@@ -26,7 +26,7 @@ public static string GenerateProjectRegexPattern(string projectName, bool useCur
2626

2727
if (addVersionAndArchPattern)
2828
{
29-
pattern += @$"\s+\({version}\|[a-zA-Z][1-9]+\)";
29+
pattern += @$"\s+\({version}\|[a-zA-Z]+[1-9]+\)";
3030
}
3131

3232
if (suffix == null)

test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndDiscoversTests.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ public GivenDotnetTestBuildsAndDiscoversTests(ITestOutputHelper log) : base(log)
1414
{
1515
}
1616

17-
// https://github.com/dotnet/sdk/issues/49665
1817
[InlineData(TestingConstants.Debug)]
1918
[InlineData(TestingConstants.Release)]
20-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
19+
[Theory]
2120
public void DiscoverTestProjectWithNoTests_ShouldReturnExitCodeGenericFailure(string configuration)
2221
{
2322
TestAsset testInstance = _testAssetsManager.CopyTestAsset("TestProjectSolution", Guid.NewGuid().ToString())
@@ -38,10 +37,9 @@ public void DiscoverTestProjectWithNoTests_ShouldReturnExitCodeGenericFailure(st
3837
result.ExitCode.Should().Be(ExitCodes.ZeroTests);
3938
}
4039

41-
// https://github.com/dotnet/sdk/issues/49665
4240
[InlineData(TestingConstants.Debug)]
4341
[InlineData(TestingConstants.Release)]
44-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
42+
[Theory]
4543
public void DiscoverMultipleTestProjectsWithNoTests_ShouldReturnExitCodeGenericFailure(string configuration)
4644
{
4745
TestAsset testInstance = _testAssetsManager.CopyTestAsset("MultipleTestProjectSolution", Guid.NewGuid().ToString())
@@ -62,10 +60,9 @@ public void DiscoverMultipleTestProjectsWithNoTests_ShouldReturnExitCodeGenericF
6260
result.ExitCode.Should().Be(ExitCodes.ZeroTests);
6361
}
6462

65-
// https://github.com/dotnet/sdk/issues/49665
6663
[InlineData(TestingConstants.Debug)]
6764
[InlineData(TestingConstants.Release)]
68-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
65+
[Theory]
6966
public void DiscoverTestProjectWithTests_ShouldReturnExitCodeSuccess(string configuration)
7067
{
7168
TestAsset testInstance = _testAssetsManager.CopyTestAsset("TestProjectWithDiscoveredTests", Guid.NewGuid().ToString())
@@ -84,10 +81,9 @@ public void DiscoverTestProjectWithTests_ShouldReturnExitCodeSuccess(string conf
8481
result.ExitCode.Should().Be(ExitCodes.Success);
8582
}
8683

87-
// https://github.com/dotnet/sdk/issues/49665
8884
[InlineData(TestingConstants.Debug)]
8985
[InlineData(TestingConstants.Release)]
90-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
86+
[Theory]
9187
public void DiscoverMultipleTestProjectsWithTests_ShouldReturnExitCodeSuccess(string configuration)
9288
{
9389
TestAsset testInstance = _testAssetsManager.CopyTestAsset("MultiTestProjectSolutionWithDiscoveredTests", Guid.NewGuid().ToString())

test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ public GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter(ITestOutputHelper l
1313
{
1414
}
1515

16-
// https://github.com/dotnet/sdk/issues/49665
17-
[PlatformSpecificFact(TestPlatforms.Any & ~TestPlatforms.OSX)]
16+
[Fact]
1817
public void RunTestProjectWithFilterOfDll_ShouldReturnExitCodeSuccess()
1918
{
2019
TestAsset testInstance = _testAssetsManager.CopyTestAsset("TestProjectWithTests", Guid.NewGuid().ToString())
@@ -50,8 +49,7 @@ public void RunTestProjectWithFilterOfDll_ShouldReturnExitCodeSuccess()
5049
result.ExitCode.Should().Be(ExitCodes.Success);
5150
}
5251

53-
// https://github.com/dotnet/sdk/issues/49665
54-
[PlatformSpecificFact(TestPlatforms.Any & ~TestPlatforms.OSX)]
52+
[Fact]
5553
public void RunTestProjectsWithFilterOfDll_ShouldReturnExitCodeGenericFailure()
5654
{
5755
TestAsset testInstance = _testAssetsManager.CopyTestAsset("MultiTestProjectSolutionWithTests", Guid.NewGuid().ToString())
@@ -97,8 +95,7 @@ public void RunTestProjectsWithFilterOfDll_ShouldReturnExitCodeGenericFailure()
9795
}
9896

9997

100-
// https://github.com/dotnet/sdk/issues/49665
101-
[PlatformSpecificFact(TestPlatforms.Any & ~TestPlatforms.OSX)]
98+
[Fact]
10299
public void RunTestProjectWithFilterOfDllWithRootDirectory_ShouldReturnExitCodeSuccess()
103100
{
104101
TestAsset testInstance = _testAssetsManager.CopyTestAsset("TestProjectWithTests", Guid.NewGuid().ToString())

test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,9 @@ public void RunMultipleTestProjectsWithFailingTests_ShouldReturnExitCodeAtLeastO
214214
result.ExitCode.Should().Be(ExitCodes.AtLeastOneTestFailed);
215215
}
216216

217-
// https://github.com/dotnet/sdk/issues/49665
218217
[InlineData(TestingConstants.Debug)]
219218
[InlineData(TestingConstants.Release)]
220-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
219+
[Theory]
221220
public void RunMultipleTestProjectsWithDifferentFailures_ShouldReturnExitCodeGenericFailure(string configuration)
222221
{
223222
TestAsset testInstance = _testAssetsManager.CopyTestAsset("MultiTestProjectSolutionWithDifferentFailures", Guid.NewGuid().ToString())

test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsForMultipleTFMs.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public void RunMultipleProjectWithDifferentTFMs_ShouldReturnExitCodeGenericFailu
5555
}
5656

5757
// https://github.com/dotnet/sdk/issues/49665
58+
// Failed to load /private/tmp/helix/working/A83B08FB/p/d/shared/Microsoft.NETCore.App/9.0.0/libhostpolicy.dylib, error: dlopen(/private/tmp/helix/working/A83B08FB/p/d/shared/Microsoft.NETCore.App/9.0.0/libhostpolicy.dylib, 0x0001): tried: '/private/tmp/helix/working/A83B08FB/p/d/shared/Microsoft.NETCore.App/9.0.0/libhostpolicy.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/tmp/helix/working/A83B08FB/p/d/shared/Microsoft.NETCore.App/9.0.0/libhostpolicy.dylib' (no such file), '/private/tmp/helix/working/A83B08FB/p/d/shared/Microsoft.NETCore.App/9.0.0/libhostpolicy.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
5859
[InlineData(TestingConstants.Debug)]
5960
[InlineData(TestingConstants.Release)]
6061
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
@@ -142,11 +143,9 @@ public void RunProjectWithMultipleTFMs_ParallelizationTest_RunInParallelShouldFa
142143
}
143144
}
144145

145-
// https://github.com/dotnet/sdk/issues/49665
146-
// Error output: Failed to load /private/tmp/helix/working/A452091E/p/d/shared/Microsoft.NETCore.App/9.0.0/libhostpolicy.dylib, error: dlopen(/private/tmp/helix/working/A452091E/p/d/shared/Microsoft.NETCore.App/9.0.0/libhostpolicy.dylib, 0x0001): tried: '/private/tmp/helix/working/A452091E/p/d/shared/Microsoft.NETCore.App/9.0.0/libhostpolicy.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')),
147146
[InlineData(TestingConstants.Debug)]
148147
[InlineData(TestingConstants.Release)]
149-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
148+
[Theory]
150149
public void RunProjectWithMultipleTFMsWithArchOption_ShouldReturnExitCodeGenericFailure(string configuration)
151150
{
152151
TestAsset testInstance = _testAssetsManager.CopyTestAsset("TestProjectWithMultipleTFMsSolution", Guid.NewGuid().ToString())

test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsWithDifferentOptions.cs

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ public void RunWithProjectPathWithFailingTests_ShouldReturnExitCodeGenericFailur
3434
result.ExitCode.Should().Be(ExitCodes.AtLeastOneTestFailed);
3535
}
3636

37-
// https://github.com/dotnet/sdk/issues/49665
3837
[InlineData(TestingConstants.Debug)]
3938
[InlineData(TestingConstants.Release)]
40-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
39+
[Theory]
4140
public void RunWithSolutionPathWithFailingTests_ShouldReturnExitCodeGenericFailure(string configuration)
4241
{
4342
TestAsset testInstance = _testAssetsManager.CopyTestAsset("MultiTestProjectSolutionWithTests", Guid.NewGuid().ToString()).WithSource();
@@ -55,10 +54,9 @@ public void RunWithSolutionPathWithFailingTests_ShouldReturnExitCodeGenericFailu
5554
result.ExitCode.Should().Be(ExitCodes.AtLeastOneTestFailed);
5655
}
5756

58-
// https://github.com/dotnet/sdk/issues/49665
5957
[InlineData(TestingConstants.Debug)]
6058
[InlineData(TestingConstants.Release)]
61-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
59+
[Theory]
6260
public void RunWithSolutionFilterPathWithFailingTests_ShouldReturnExitCodeGenericFailure(string configuration)
6361
{
6462
TestAsset testInstance = _testAssetsManager.CopyTestAsset("MultiTestProjectSolutionWithTests", Guid.NewGuid().ToString()).WithSource();
@@ -76,10 +74,9 @@ public void RunWithSolutionFilterPathWithFailingTests_ShouldReturnExitCodeGeneri
7674
result.ExitCode.Should().Be(ExitCodes.AtLeastOneTestFailed);
7775
}
7876

79-
// https://github.com/dotnet/sdk/issues/49665
8077
[InlineData(TestingConstants.Debug)]
8178
[InlineData(TestingConstants.Release)]
82-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
79+
[Theory]
8380
public void RunWithSolutionFilterPathInOtherDirectory_ShouldReturnExitCodeGenericFailure(string configuration)
8481
{
8582
TestAsset testInstance = _testAssetsManager.CopyTestAsset("MultiTestProjectSolutionWithTests", Guid.NewGuid().ToString()).WithSource();
@@ -115,7 +112,7 @@ public void RunWithInvalidProjectExtension_ShouldReturnExitCodeGenericFailure(st
115112

116113
[InlineData(TestingConstants.Debug)]
117114
[InlineData(TestingConstants.Release)]
118-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
115+
[Theory]
119116
public void RunWithDirectoryAsProjectOption_ShouldReturnExitCodeGenericFailure(string configuration)
120117
{
121118
TestAsset testInstance = _testAssetsManager.CopyTestAsset("MultiTestProjectSolutionWithTests", Guid.NewGuid().ToString()).WithSource();
@@ -214,10 +211,9 @@ public void RunWithNonExistentSolutionPath_ShouldReturnExitCodeGenericFailure(st
214211
result.ExitCode.Should().Be(ExitCodes.GenericFailure);
215212
}
216213

217-
// https://github.com/dotnet/sdk/issues/49665
218214
[InlineData(TestingConstants.Debug)]
219215
[InlineData(TestingConstants.Release)]
220-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
216+
[Theory]
221217
public void RunTestProjectWithArchOption_ShouldReturnExitCodeSuccess(string configuration)
222218
{
223219
TestAsset testInstance = _testAssetsManager.CopyTestAsset("TestProjectWithTests", Guid.NewGuid().ToString()).WithSource();
@@ -235,10 +231,9 @@ public void RunTestProjectWithArchOption_ShouldReturnExitCodeSuccess(string conf
235231
result.ExitCode.Should().Be(ExitCodes.Success);
236232
}
237233

238-
// https://github.com/dotnet/sdk/issues/49665
239234
[InlineData(TestingConstants.Debug)]
240235
[InlineData(TestingConstants.Release)]
241-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
236+
[Theory]
242237
public void RunTestProjectSolutionWithArchOption_NotSupported(string configuration)
243238
{
244239
TestAsset testInstance = _testAssetsManager.CopyTestAsset("TestProjectSolution", Guid.NewGuid().ToString()).WithSource();
@@ -262,6 +257,7 @@ public void RunTestProjectSolutionWithArchOption_NotSupported(string configurati
262257
}
263258

264259
// https://github.com/dotnet/sdk/issues/49665
260+
// Failed to load /private/tmp/helix/working/A83B08FB/p/d/host/fxr/10.0.0-rc.2.25427.104/libhostfxr.dylib, error: dlopen(/private/tmp/helix/working/A83B08FB/p/d/host/fxr/10.0.0-rc.2.25427.104/libhostfxr.dylib, 0x0001): tried: '/private/tmp/helix/working/A83B08FB/p/d/host/fxr/10.0.0-rc.2.25427.104/libhostfxr.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/private/tmp/helix/working/A83B08FB/p/d/host/fxr/10.0.0-rc.2.25427.104/libhostfxr.dylib' (no such file), '/private/tmp/helix/working/A83B08FB/p/d/host/fxr/10.0.0-rc.2.25427.104/libhostfxr.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
265261
[InlineData(TestingConstants.Debug)]
266262
[InlineData(TestingConstants.Release)]
267263
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
@@ -300,10 +296,9 @@ public void RunTestProjectSolutionWithArchAndRuntimeOptions_ShouldReturnExitCode
300296
result.ExitCode.Should().Be(ExitCodes.GenericFailure);
301297
}
302298

303-
// https://github.com/dotnet/sdk/issues/49665
304299
[InlineData(TestingConstants.Debug)]
305300
[InlineData(TestingConstants.Release)]
306-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
301+
[Theory]
307302
public void RunTestProjectSolutionWithOSOption_ShouldReturnExitCodeSuccess(string configuration)
308303
{
309304
TestAsset testInstance = _testAssetsManager.CopyTestAsset("TestProjectWithTests", Guid.NewGuid().ToString()).WithSource();
@@ -320,10 +315,9 @@ public void RunTestProjectSolutionWithOSOption_ShouldReturnExitCodeSuccess(strin
320315
result.ExitCode.Should().Be(ExitCodes.Success);
321316
}
322317

323-
// https://github.com/dotnet/sdk/issues/49665
324318
[InlineData(TestingConstants.Debug)]
325319
[InlineData(TestingConstants.Release)]
326-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
320+
[Theory]
327321
public void RunTestProjectSolutionWithArchAndOSOptions_ShouldReturnExitCodeSuccess(string configuration)
328322
{
329323
TestAsset testInstance = _testAssetsManager.CopyTestAsset("TestProjectWithTests", Guid.NewGuid().ToString()).WithSource();
@@ -436,10 +430,9 @@ public void RunOnSolutionWithMSBuildArgs_ShouldReturnExitCodeGenericFailure(stri
436430
result.ExitCode.Should().Be(ExitCodes.AtLeastOneTestFailed);
437431
}
438432

439-
// https://github.com/dotnet/sdk/issues/49665
440433
[InlineData(TestingConstants.Debug)]
441434
[InlineData(TestingConstants.Release)]
442-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
435+
[Theory]
443436
public void RunTestProjectSolutionWithFrameworkOption_ShouldReturnExitCodeSuccess(string configuration)
444437
{
445438
TestAsset testInstance = _testAssetsManager.CopyTestAsset("TestProjectWithTests", Guid.NewGuid().ToString()).WithSource();
@@ -511,11 +504,9 @@ public void RunMultiTFMsProjectSolutionWithPreviousFramework_ShouldReturnExitCod
511504
result.ExitCode.Should().Be(ExitCodes.GenericFailure);
512505
}
513506

514-
515-
// https://github.com/dotnet/sdk/issues/49665
516507
[InlineData(TestingConstants.Debug)]
517508
[InlineData(TestingConstants.Release)]
518-
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
509+
[Theory]
519510
public void RunMultiTFMsProjectSolutionWithCurrentFramework_ShouldReturnExitCodeGenericFailure(string configuration)
520511
{
521512
TestAsset testInstance = _testAssetsManager.CopyTestAsset("TestProjectWithMultipleTFMsSolution", Guid.NewGuid().ToString()).WithSource();

0 commit comments

Comments
 (0)