Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WASM runtime test infrastucture] Environment variable is not set: 'CORE_ROOT' #41520

Closed
Tracked by #44663
fanyang-mono opened this issue Aug 28, 2020 · 7 comments · Fixed by #76022
Closed
Tracked by #44663

[WASM runtime test infrastucture] Environment variable is not set: 'CORE_ROOT' #41520

fanyang-mono opened this issue Aug 28, 2020 · 7 comments · Fixed by #76022
Assignees
Labels
Milestone

Comments

@fanyang-mono
Copy link
Member

fanyang-mono commented Aug 28, 2020

Description

Tests failed with Environment variable is not set: 'CORE_ROOT'.

  • ilasm/System/Runtime/CompilerServices/MethodImplOptionsTests/MethodImplOptionsTests.sh
  • JIT/CheckProjects/CheckProjects/CheckProjects.sh

Configuration

  1. Get dotnet/runtime repo
  2. Remove the test(s) that you would like to reproduce from <repo_root>/src/coreclr/tests/issues.targets
  3. Build WASM: ./build.sh --os Browser --arch wasm --subset mono+libs -c Release
  4. Build runtime tests: cd src/coreclr/ && ./build-test.sh -skipstressdependencies -excludemonofailures os Browser wasm Release
  5. To run all runtime tests, at the end of the runtime tests build log, there is "Example runtest.sh command". Use that command plus wasm. For example, for me it was
    ./tests/runtest.sh --coreOverlayDir=/Users/fanyang/Documents/work/dotnet_naricc/runtime/artifacts/tests/coreclr/Browser.wasm.Release/Tests/Core_Root --testNativeBinDir=/Users/fanyang/Documents/work/dotnet_naricc/runtime/artifacts/obj/coreclr/Browser.wasm.Release/tests --testRootDir=/Users/fanyang/Documents/work/dotnet_naricc/runtime/artifacts/tests/coreclr/Browser.wasm.Release --copyNativeTestBin Release wasm
  6. To run a single test, you could do
set CORE_ROOT=<repo_root>/artifacts/tests/coreclr/Browser.wasm.Release/Tests/Core_Root     
<repo_root>/artifacts/tests/coreclr/Browser.wasm.Release/ilasm/System/Runtime/CompilerServices/MethodImplOptionsTests/MethodImplOptionsTests.sh
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Aug 28, 2020
@ghost
Copy link

ghost commented Aug 28, 2020

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

@marek-safar marek-safar removed the untriaged New issue has not been triaged by the area owner label Aug 31, 2020
@marek-safar marek-safar added this to the 6.0.0 milestone Aug 31, 2020
@naricc
Copy link
Contributor

naricc commented Aug 31, 2020

It looks like this test explicitly copies an .il file, and then uses CORE_ROOT to find it. I think changing the tests to copy everything in the test output directory to the wasm file system, and then explicitly propgating the CORE_ROOT variable (with --setenv=VAR=VALUE ) should work.

I'm not sure if this constitutes a wider pattern in the tests and will fix more than just this one. Any idea if that would be the case @trylek?

@trylek
Copy link
Member

trylek commented Aug 31, 2020

I tried a full-text query over all *.cs and *.il source files under src/tests in the runtime repo and that yielded just 36 references to CORE_ROOT, often with multiple occurrences in the same file so at the first glance I'm expecting just 10~20 tests to be affected by this issue. I suspect that most of these will be safe to mark as WASM-incompatible (e.g. I'm seeing a test using CORE_ROOT to synthesize the path to corerun).

@SamMonoRT
Copy link
Member

Low priority, moving to 7.0

@SamMonoRT
Copy link
Member

@naricc - I believe this can be closed ?

@naricc naricc closed this as completed May 10, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 9, 2022
@eduardo-vp
Copy link
Member

@eduardo-vp eduardo-vp reopened this Sep 21, 2022
@lambdageek
Copy link
Member

This issue, along with the other references to CheckProjects in issues.targets can be resolved by changing the <Issue> in issues.targets to something like "tries to access project source code - not supported on mobile and wasm". The test tries to locate the src/tests` folder and opening some .csproj files in it. That is never going to work in scenarios where the app is bundled and run on a simulator, device, or in a sandboxed environment like a browser.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants