Skip to content

Local running of libraries tests is broken #95762

Closed

Description

@janvorli

The recent PR #94868 has broken local running of libraries tests. After each test suite is completed, the following is printed to console and the test suite is reported as failed:

XUnitLogChecker.dll does not exist in the expected location: \XUnitLogChecker.dll

Looking at the eng/testing/RunnerTemplate.cmd, I can see that it builds the XUnitLogChecker.dll path like this:
set XUNITLOGCHECKER_DLL=%HELIX_CORRELATION_PAYLOAD%\XUnitLogChecker.dll
My guess is the problem is that the HELIX_CORRELATION_PAYLOAD is not set for local testing.

Activity

  1. added this to the 9.0.0 milestone on Dec 7, 2023
  2. carlossanlop commented on Dec 7, 2023

    @carlossanlop
    Contributor

    Thanks for reporting. Can you please tell me the command you were using to run the tests?

  3. janvorli commented on Dec 7, 2023

    @janvorli
    MemberAuthor

    As a repro, you can use e.g. these steps locally. The last step runs the tests and you'll see the suites reported as failing:

    • .\build.cmd clr+libs -c Release -rc Checked
    • .\build.cmd libs.tests -c Release -rc Checked
    • .\build.cmd libs.tests -c Release -rc Checked -test -testnobuild
  4. BruceForstall commented on Jan 2, 2024

    @BruceForstall
    Contributor

    @carlossanlop I ran into this today (also in local testing).

    Do you really need to have a variable __IsXUnitLogCheckerSupported? You could presumably skip all this stuff if HELIX_CORRELATION_PAYLOAD is not defined, as Jan suggested above.

    Also, why does the test script RunTests.cmd need set __TestArchitecture=x86? Who uses this information? The RunTests.cmd script should be independent of processor architecture. The problem now is that I use the same RunTests.cmd script for both x86 and x64 test runs (they take a -r parameter to the Core_Root that will be used, and I can pass either an x86 or x64 Core_Root. But now there is an architecture hard-coded into the RunTests.cmd script).

  5. ericstj commented on Jan 2, 2024

    @ericstj
    Member

    @carlossanlop I just hit this today as well. My workflow was:

    git pull upstream main
    rd /q /s artifacts
    build -rc Release clr+libs
    cd src\libraries\System.Runtime\tests\System.Reflection.Tests
    dotnet build /t:Test
    
  6. carlossanlop commented on Jan 8, 2024

    @carlossanlop
    Contributor

    Looking at this today.

  7. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jan 8, 2024
  8. carlossanlop commented on Jan 8, 2024

    @carlossanlop
    Contributor

    Also, why does the test script RunTests.cmd need set __TestArchitecture=x86? Who uses this information?

    @BruceForstall The debuggers fail to run if the environment variable is not set. It is expected here:

    public const string TEST_TARGET_ARCHITECTURE_ENVIRONMENT_VAR = "__TestArchitecture";

    The problem now is that I use the same RunTests.cmd script for both x86 and x64 test runs (they take a -r parameter to the Core_Root that will be used, and I can pass either an x86 or x64 Core_Root. But now there is an architecture hard-coded into the RunTests.cmd script).

    Well, the value is not hardcoded. It is set in these 3 places:

    But with the fix I just submitted, these env vars should not be needed at all in local runs.

  9. BruceForstall commented on Jan 9, 2024

    @BruceForstall
    Contributor

    __TestArchitecture should not be set in the generated RunTests.cmd. If I build x86, then build x64, the generated RunTests.cmd will be overwritten with a new test architecture setting. This is incorrect.

    Note that in the CoreCLR tests, the __TestArchitecture variable is only set on Helix. It is not set in any generated wrapper file used by developers on local machines. Libraries testing should do the same.

    Similarly, set __IsXUnitLogCheckerSupported=1 should not be added to the generated RunTests.cmd, even if you do add code to skip it if the HELIX variable is not set.

    Note that __TestArchitecture is only used to choose a version of cdb.exe to use for dump file processing. This isn't going to work on local machines anyway, since it depends on hard-coded cdb.exe install path (and I, for instance, don't have one at that location). It seems like a hack to set an environment variable to figure this out. Couldn't the wrapper script detect the architecture run type? @jkoritzinsky ?

  10. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Jan 9, 2024
  11. carlossanlop commented on Jan 9, 2024

    @carlossanlop
    Contributor

    I merged the PR to unblock folks testing locally. Reopening as there is still some discussion to address related to the OS.

  12. BruceForstall commented on Jan 9, 2024

    @BruceForstall
    Contributor

    @carlossanlop I'm suggesting something like this:

    #96713

    (The IsXUnitLogCheckerSupported variable might need to be passed through more layers, and maybe there are additional conditions that need to be checked)

  13. carlossanlop commented on Jan 10, 2024

    @carlossanlop
    Contributor

    Thanks for submitting a PR. I suppose the main problem reported by this issue has been fixed, so we can close it. We can just track the additional change in the new PR directly.

  14. locked and limited conversation to collaborators on Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions