Skip to content

NUnit 4: dotnet test behaving differently locally vs on GH Actions (failing) #4571

Closed

Description

@christophwille

Started in #4569 - all those variations work fine in Windows 11 in addition to VS 17.8 + 17.9p1 with the NUnit 4 4.1.0-adev.1 package from MyGet:

PS D:\GitWorkspace\ILSpy\ILSpy.Tests> dotnet test
PS D:\GitWorkspace\ILSpy\ILSpy.Tests\bin\Debug\net8.0-windows> dotnet test ilspy.tests.dll
PS D:\GitWorkspace\ILSpy\ILSpy.Tests\bin\Debug\net8.0-windows> dotnet test --logger "junit;LogFileName=Debug.xml" --results-directory test-results ilspy.tests.dll

However, as part of GH Actions run (see PR icsharpcode/ILSpy#3132), it fails to find tests

Run dotnet test --logger "junit;LogFileName=Debug.xml" --results-directory test-results $env:Tests1 $env:Tests2 $env:Tests3
Microsoft (R) Test Execution Command Line Tool Version [17](https://github.com/icsharpcode/ILSpy/actions/runs/7030026378/job/19128743036#step:10:18).8.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 3 test files matched the specified pattern.
No test is available in D:\a\ILSpy\ILSpy\ICSharpCode.Decompiler.Tests\bin\Debug\net8.0-windows\win-x64\ICSharpCode.Decompiler.Tests.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in D:\a\ILSpy\ILSpy\ILSpy.Tests\bin\Debug\net8.0-windows\ILSpy.Tests.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in D:\a\ILSpy\ILSpy\ILSpy.BamlDecompiler.Tests\bin\Debug\net8.0-windows\win-x64\ILSpy.BamlDecompiler.Tests.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
Results File: D:\a\ILSpy\ILSpy\test-results\Debug.xml

dotnet test --diag output file for such a run attached: dotnettestdiag-Debug.txt

What could be the difference of local Windows vs GH Windows runner? (and how to pinpoint)

Activity

  1. christophwille commented on Nov 29, 2023

    @christophwille
    Author

    Just a wild and stupid guess after having an Espresso - could it be that server OSes are not covered by #4569? After all, we are using a 2022 server image on GH.

  2. OsirisTerje commented on Nov 29, 2023

    @OsirisTerje
    Member

    Can you try to add a new workflow, focusing just on the ILSpy.Tests and the dependencies of that of course, nothing else, and just an out-of-the-box action template, and a standard windows-10/11.

  3. rgroenewoudt commented on Nov 29, 2023

    @rgroenewoudt

    I just encountered a bug that finding tests doesn't work if TargetFramework contains windows: nunit/nunit3-vs-adapter#1141

    This is perhaps the same issue.

  4. christophwille commented on Nov 29, 2023

    @christophwille
    Author

    I just encountered a bug that finding tests doesn't work if TargetFramework contains windows: nunit/nunit3-vs-adapter#1141

    This is perhaps the same issue.

    That's #4564 - this is using the fix already, but with GH still not working.

  5. manfred-brands commented on Nov 29, 2023

    @manfred-brands
    Member

    @christophwille I need to check how Windows Server is detected and add support for it to NUnit as the existing Platform has no support for server OS. I'll try to get to it tomorrow.

  6. manfred-brands commented on Nov 30, 2023

    @manfred-brands
    Member

    Ok, the Windows runner reports as Windows 10 Server.
    There was already a WindowsServer10 definition in NUnit Platform.
    I have updated the OSPlatformTranslator to also add this Platform when appropriate.

  7. christophwille commented on Nov 30, 2023

    @christophwille
    Author

    Thanks; once merged & MyGet'd I can test it with our PR.

  8. OsirisTerje commented on Dec 1, 2023

    @OsirisTerje
    Member

    @christophwille The -adev.2 was out yesterday on Myget. Can you verify it works?

  9. added this to the 4.0.1 milestone on Dec 1, 2023
  10. christophwille commented on Dec 1, 2023

    @christophwille
    Author

    Yes it worked.

  11. OsirisTerje commented on Dec 1, 2023

    @OsirisTerje
    Member

    Thanks! Awesome. Then I'll try to get 4.0.1 out during the weekend.

  12. OsirisTerje commented on Dec 2, 2023

    @OsirisTerje
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions