Skip to content

[9.0-preview.4] Failed tests not reported to the console in CI on MacOS #41299

@martincostello

Description

@martincostello

Describe the bug

Using the .NET 9 preview 4 SDK, if a test fails in GitHub Actions CI where GitHubActionsTestLogger is used, no information about the failed test is printed to the console.

Running tests...
  Determining projects to restore...
  Restored /home/runner/work/xunit-logging/xunit-logging/tests/SampleApp/SampleApp.csproj (in 321 ms).
  Restored /home/runner/work/xunit-logging/xunit-logging/tests/Logging.XUnit.Tests/MartinCostello.Logging.XUnit.Tests.csproj (in 3.52 sec).
  1 of 3 projects are up-to-date for restore.
/usr/share/dotnet/sdk/9.0.100-preview.4.24267.66/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/home/runner/work/xunit-logging/xunit-logging/tests/Logging.XUnit.Tests/MartinCostello.Logging.XUnit.Tests.csproj]
/usr/share/dotnet/sdk/9.0.100-preview.4.24267.66/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/home/runner/work/xunit-logging/xunit-logging/src/Logging.XUnit/MartinCostello.Logging.XUnit.csproj::TargetFramework=net8.0]
  MartinCostello.Logging.XUnit -> /home/runner/work/xunit-logging/xunit-logging/artifacts/bin/MartinCostello.Logging.XUnit/release_net8.0/MartinCostello.Logging.XUnit.dll
/usr/share/dotnet/sdk/9.0.100-preview.4.24267.66/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/home/runner/work/xunit-logging/xunit-logging/tests/SampleApp/SampleApp.csproj]
  SampleApp -> /home/runner/work/xunit-logging/xunit-logging/artifacts/bin/SampleApp/release/SampleApp.dll
  MartinCostello.Logging.XUnit.Tests -> /home/runner/work/xunit-logging/xunit-logging/artifacts/bin/MartinCostello.Logging.XUnit.Tests/release/MartinCostello.Logging.XUnit.Tests.dll
  [coverlet] _mapping file name: 'CoverletSourceRootsMapping_MartinCostello.Logging.XUnit.Tests'
/usr/share/dotnet/sdk/9.0.100-preview.4.24267.66/Microsoft.TestPlatform.targets(46,5): error MSB6006: "dotnet" exited with code 1. [/home/runner/work/xunit-logging/xunit-logging/tests/Logging.XUnit.Tests/MartinCostello.Logging.XUnit.Tests.csproj]

I noticed this in a previous issue, but have only just come back around to check in on it: #39665 (comment)

The only way to see which test is failing is to look at the workflow summary, which shows which test failed for Linux and Windows, but interestingly does not show anything for macOS.

macOS

image

Linux

image

Contrast this to the non-CI behaviour, where the test failure is obvious:

Running tests...
Restore complete (1.0s)
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  MartinCostello.Logging.XUnit net8.0 succeeded (0.2s) → artifacts\bin\MartinCostello.Logging.XUnit\release_net8.0\MartinCostello.Logging.XUnit.dll
  SampleApp succeeded (4.3s) → artifacts\bin\SampleApp\release\SampleApp.dll
  MartinCostello.Logging.XUnit.Tests succeeded (3.7s) → artifacts\bin\MartinCostello.Logging.XUnit.Tests\release\MartinCostello.Logging.XUnit.Tests.dll
  MartinCostello.Logging.XUnit.Tests test failed with 2 error(s) and 2 warning(s) (5.4s)
    C:\Program Files\dotnet\sdk\9.0.100-preview.4.24267.66\Microsoft.TestPlatform.targets(46,5): warning :
      [xUnit.net 00:00:00.51] MartinCostello.Logging.XUnit.Tests: [2024-05-31 09:31:44Z] info: MartinCostello.Loggi
      ng.XUnit.Integration.DatabaseFixture[0]
            Initializing database
    C:\Program Files\dotnet\sdk\9.0.100-preview.4.24267.66\Microsoft.TestPlatform.targets(46,5): warning :
      [xUnit.net 00:00:00.54] MartinCostello.Logging.XUnit.Tests: [2024-05-31 09:31:44Z] info: MartinCostello.Loggi
      ng.XUnit.Integration.DatabaseFixture[0]
            Disposing database
    C:\Program Files\dotnet\sdk\9.0.100-preview.4.24267.66\Microsoft.TestPlatform.targets(46,5): error : [xUnit.net 00:00:00.73]     Calculator_Sums_Two_Equal_Integers [FAIL]
    C:\Coding\martincostello\xunit-logging\tests\Logging.XUnit.Tests\Examples.cs(21): error VSTEST1:
      Calculator_Sums_Two_Equal_Integers: MartinCostello.Logging.XUnit.Examples.Calculator_Sums_Two_Equal_Integers(
      ) Shouldly.ShouldAssertException : actual
          should not be
      4
          but was

Test summary: total: 70, failed: 1, succeeded: 69, skipped: 0, duration: 4.1s
Build failed with 2 error(s) and 2 warning(s) in 16.4s

To Reproduce

Build martincostello/xunit-logging@dc54d8e in GitHub Actions.

Exceptions (if any)

None.

Further technical details

.NET SDK 9.0.100-preview.4.24267.66

/cc @nohwnd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions