Skip to content
Draft
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
7 changes: 7 additions & 0 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
<!-- Build & pack tests -->
<PropertyGroup>
<IsPackable>false</IsPackable>

<!-- Workaround: createdump doesn't work correctly on the apphost on macOS. -->
<!-- But it works correctly on the dotnet process. -->
<!-- So, disable apphost on macOS for now. -->
<!-- Related: https://github.com/dotnet/runtime/issues/119945 -->
<UseAppHost Condition="'$(OS)' == 'OSX'">false</UseAppHost>

<!-- Prevent arcade from adding Microsoft.NET.Test.Sdk -->
<ExcludeMicrosoftNetTestSdk>true</ExcludeMicrosoftNetTestSdk>
<PublishAot Condition=" '$(PublishAot)' == '' ">false</PublishAot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,13 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.
<PropertyGroup>
<TargetFrameworks>$TargetFrameworks$</TargetFrameworks>
<OutputType>Exe</OutputType>
<UseAppHost>true</UseAppHost>

<!-- Workaround: createdump doesn't work correctly on the apphost on macOS. -->
<!-- But it works correctly on the dotnet process. -->
<!-- So, disable apphost on macOS for now. -->
<!-- Related: https://github.com/dotnet/runtime/issues/119945 -->
<UseAppHost Condition="'$(OS)' == 'OSX'">false</UseAppHost>

<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ public sealed class CrashPlusHangDumpTests : AcceptanceTestBase<CrashPlusHangDum
[TestMethod]
public async Task CrashPlusHangDump_InCaseOfCrash_CreateCrashDump()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
// TODO: Investigate failures on macos
return;
}

string resultDirectory = Path.Combine(AssetFixture.TargetAssetPath, Guid.NewGuid().ToString("N"), TargetFrameworks.NetCurrent);
var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, "CrashPlusHangDump", TargetFrameworks.NetCurrent);
TestHostResult testHostResult = await testHost.ExecuteAsync(
Expand All @@ -38,12 +32,6 @@ public async Task CrashPlusHangDump_InCaseOfCrash_CreateCrashDump()
[TestMethod]
public async Task CrashPlusHangDump_InCaseOfHang_CreateHangDump()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
// TODO: Investigate failures on macos
return;
}

string resultDirectory = Path.Combine(AssetFixture.TargetAssetPath, Guid.NewGuid().ToString("N"), TargetFrameworks.NetCurrent);
var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, "CrashPlusHangDump", TargetFrameworks.NetCurrent);
TestHostResult testHostResult = await testHost.ExecuteAsync(
Expand Down Expand Up @@ -85,7 +73,13 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.
<PropertyGroup>
<TargetFramework>$TargetFrameworks$</TargetFramework>
<OutputType>Exe</OutputType>
<UseAppHost>true</UseAppHost>

<!-- Workaround: createdump doesn't work correctly on the apphost on macOS. -->
<!-- But it works correctly on the dotnet process. -->
<!-- So, disable apphost on macOS for now. -->
<!-- Related: https://github.com/dotnet/runtime/issues/119945 -->
<UseAppHost Condition="'$(OS)' == 'OSX'">false</UseAppHost>

<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ public sealed class HangDumpOutputTests : AcceptanceTestBase<HangDumpOutputTests
[TestMethod]
public async Task HangDump_Outputs_HangingTests_EvenWhenHangingTestsHaveTheSameDisplayName(string format)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
// TODO: Investigate failures on macos
return;
}

// This test makes sure that when tests have the same display name (e.g. like Test1 from both Class1 and Class2)
// they will still show up in the hanging tests. This was not the case before when we were just putting them into
// a dictionary based on DisplayName. In that case both tests were started at the same time, and only 1 entry was added
Expand Down Expand Up @@ -56,7 +50,13 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.
<PropertyGroup>
<TargetFrameworks>$TargetFrameworks$</TargetFrameworks>
<OutputType>Exe</OutputType>
<UseAppHost>true</UseAppHost>

<!-- Workaround: createdump doesn't work correctly on the apphost on macOS. -->
<!-- But it works correctly on the dotnet process. -->
<!-- So, disable apphost on macOS for now. -->
<!-- Related: https://github.com/dotnet/runtime/issues/119945 -->
<UseAppHost Condition="'$(OS)' == 'OSX'">false</UseAppHost>

<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ public sealed class HangDumpTests : AcceptanceTestBase<HangDumpTests.TestAssetFi
[TestMethod]
public async Task HangDump_DefaultSetting_CreateDump(string tfm)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
// TODO: Investigate failures on macos
return;
}

string resultDirectory = Path.Combine(AssetFixture.TargetAssetPath, Guid.NewGuid().ToString("N"), tfm);
var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, "HangDump", tfm);
TestHostResult testHostResult = await testHost.ExecuteAsync(
Expand All @@ -34,12 +28,6 @@ public async Task HangDump_DefaultSetting_CreateDump(string tfm)
[TestMethod]
public async Task HangDump_CustomFileName_CreateDump()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
// TODO: Investigate failures on macos
return;
}

string resultDirectory = Path.Combine(AssetFixture.TargetAssetPath, Guid.NewGuid().ToString("N"), TargetFrameworks.NetCurrent);
var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, "HangDump", TargetFrameworks.NetCurrent);
TestHostResult testHostResult = await testHost.ExecuteAsync(
Expand All @@ -57,12 +45,6 @@ public async Task HangDump_CustomFileName_CreateDump()
[TestMethod]
public async Task HangDump_PathWithSpaces_CreateDump()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
// TODO: Investigate failures on macos
return;
}

string resultDir = Path.Combine(AssetFixture.TargetAssetPath, Guid.NewGuid().ToString("N"), TargetFrameworks.NetCurrent);
string resultDirectory = Path.Combine(resultDir, "directory with spaces");
Directory.CreateDirectory(resultDirectory);
Expand All @@ -87,12 +69,6 @@ public async Task HangDump_PathWithSpaces_CreateDump()
[TestMethod]
public async Task HangDump_Formats_CreateDump(string format)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
// TODO: Investigate failures on macos
return;
}

string resultDirectory = Path.Combine(AssetFixture.TargetAssetPath, Guid.NewGuid().ToString("N"), format);
var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, "HangDump", TargetFrameworks.NetCurrent);
TestHostResult testHostResult = await testHost.ExecuteAsync(
Expand Down Expand Up @@ -149,7 +125,13 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.
<PropertyGroup>
<TargetFrameworks>$TargetFrameworks$</TargetFrameworks>
<OutputType>Exe</OutputType>
<UseAppHost>true</UseAppHost>

<!-- Workaround: createdump doesn't work correctly on the apphost on macOS. -->
<!-- But it works correctly on the dotnet process. -->
<!-- So, disable apphost on macOS for now. -->
<!-- Related: https://github.com/dotnet/runtime/issues/119945 -->
<UseAppHost Condition="'$(OS)' == 'OSX'">false</UseAppHost>

<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,7 @@ public async Task RetryFailedTests_MaxTestsCount_Succeeds(string tfm, bool fail)
// We use crash dump, not supported in NetFramework at the moment
[DynamicData(nameof(TargetFrameworks.NetForDynamicData), typeof(TargetFrameworks))]
public async Task RetryFailedTests_MoveFiles_Succeeds(string tfm)
{
// TODO: Crash dump is not working properly on macos, so we skip the test for now
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
return;
}

await RetryHelper.RetryAsync(
=> await RetryHelper.RetryAsync(
async () =>
{
var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, AssetName, tfm);
Expand Down Expand Up @@ -188,7 +181,6 @@ await RetryHelper.RetryAsync(
Assert.Fail($"Expected 1 or 2 dump files, but found {dumpFilesCount}");
}
}, 3, TimeSpan.FromSeconds(5));
}

[TestMethod]
public async Task RetryFailedTests_PassingFromFirstTime_UsingTestTarget_MoveFiles_Succeeds()
Expand Down Expand Up @@ -235,7 +227,13 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<UseAppHost>true</UseAppHost>

<!-- Workaround: createdump doesn't work correctly on the apphost on macOS. -->
<!-- But it works correctly on the dotnet process. -->
<!-- So, disable apphost on macOS for now. -->
<!-- Related: https://github.com/dotnet/runtime/issues/119945 -->
<UseAppHost Condition="'$(OS)' == 'OSX'">false</UseAppHost>

<LangVersion>preview</LangVersion>
<GenerateTestingPlatformEntryPoint>false</GenerateTestingPlatformEntryPoint>
<TestingPlatformCaptureOutput>false</TestingPlatformCaptureOutput>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ public async Task Trx_WhenReportTrxIsSpecified_TrxReportIsGeneratedInDefaultLoca
[TestMethod]
public async Task Trx_WhenTestHostCrash_ErrorIsDisplayedInsideTheTrx(string tfm)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
// TODO: Investigate failures on macos
return;
}

string fileName = Guid.NewGuid().ToString("N");
var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, TestAssetFixture.AssetName, tfm);
TestHostResult testHostResult = await testHost.ExecuteAsync(
Expand Down Expand Up @@ -225,7 +219,13 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<UseAppHost>true</UseAppHost>

<!-- Workaround: createdump doesn't work correctly on the apphost on macOS. -->
<!-- But it works correctly on the dotnet process. -->
<!-- So, disable apphost on macOS for now. -->
<!-- Related: https://github.com/dotnet/runtime/issues/119945 -->
<UseAppHost Condition="'$(OS)' == 'OSX'">false</UseAppHost>

<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
Expand Down Expand Up @@ -308,7 +308,13 @@ public async Task ExecuteRequestAsync(ExecuteRequestContext context)
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<UseAppHost>true</UseAppHost>

<!-- Workaround: createdump doesn't work correctly on the apphost on macOS. -->
<!-- But it works correctly on the dotnet process. -->
<!-- So, disable apphost on macOS for now. -->
<!-- Related: https://github.com/dotnet/runtime/issues/119945 -->
<UseAppHost Condition="'$(OS)' == 'OSX'">false</UseAppHost>

<LangVersion>preview</LangVersion>
<EnableMSTestRunner>true</EnableMSTestRunner>
<GenerateTestingPlatformEntryPoint>false</GenerateTestingPlatformEntryPoint>
Expand Down
Loading