-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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][wbt] Test that dotnet.js
could be run from any current directory
#69441
[wasm][wbt] Test that dotnet.js
could be run from any current directory
#69441
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
Until then, replace `else t=r.name;` in dotnet.js with `else t=locateFile(r.name);`
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsUse locateFile to resolve path for assets outside of remoteSources, so that we can run from a different path than locate that dotnet.js exists ref: #69259 I followed the repro step described in the Issue ( #69259 ) and confirmed that it works. Referring to the
|
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
hi @yamachu, thanks for the contribution! It would be great to add unit test to cover running V8 and NodeJS from different folder.
I also wonder what would happen to web app, which has |
Thanks for the review! I have set up an environment to run the tests you presented, so I rewrote the working directory and ran the tests. |
I have not yet been to verify this for the web app. In a web environment, it may be desirable to override the locateFile, as in the following sample code. However, I think it is also possible to support this by utilizing Currently, only icu files support remoteSources, but I think that by making all assets support it, it will be possible to execute in a way that does not depend on the behavior of the locateFile. |
This comment was marked as outdated.
This comment was marked as outdated.
Tagging subscribers to this area: @directhex Issue DetailsUse locateFile to resolve path for assets outside of remoteSources, so that we can run from a different path than locate that dotnet.js exists ref: #69259 I followed the repro step described in the Issue ( #69259 ) and confirmed that it works. Referring to the
|
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
src/tests/BuildWasmApps/Wasm.Build.Tests/WasmRunOutOfAppBundleTests.cs
Outdated
Show resolved
Hide resolved
You need to add the new test classes to https://github.com/dotnet/runtime/blob/main/eng/testing/scenarios/BuildWasmAppsJobsList.txt . |
src/tests/BuildWasmApps/Wasm.Build.Tests/WasmRunOutOfAppBundleTests.cs
Outdated
Show resolved
Hide resolved
src/tests/BuildWasmApps/Wasm.Build.Tests/WasmRunOutOfAppBundleTests.cs
Outdated
Show resolved
Hide resolved
string binDir = GetBinDir(baseDir: _projectDir!, config: buildArgs.Config); | ||
string appBundleDir = Path.Combine(binDir, "AppBundle"); | ||
string tmpBundleDirName = "AppBundleTmp"; | ||
string tmpBundleDir = Path.Combine(binDir, tmpBundleDirName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of creating this tmpBundleDir in a completely different location, like under Path.GetTempPath()
? This would ensure that it isn't dependent on anything in the binDir.
And make sure to add id
, and the project name to the dir name, so the different runs don't overlap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a good method in Node and V8 environments!
I' ll change that style.
However, browsers like Chrome cannot explore the parent directory, so I would like to keep the current style.
src/tests/BuildWasmApps/Wasm.Build.Tests/WasmRunOutOfAppBundleTests.cs
Outdated
Show resolved
Hide resolved
Don't merge yet. The test needs some changes. I will get those working locally, and share that tomorrow. |
So, one of the problems with the IIUC, the intention here is:
This is what I came up with: https://gist.github.com/radical/18d60949c789cf98f8b175c30096b683 . Feel free to add this to your PR. The test output has:
Make sure to confirm that it is indeed testing what is intended here. AFAIU, it does that. |
@yamachu Thank you for your contribution! Great job 👍 |
@pavelsavara @radical |
Failures are unrelated. |
@yamachu This is only adding the |
This addition is to verify that config-src could be resolved when passed as an absolute path. |
In #72275 we fixed
locateFile
to deal with relative file path or URL. We could also handle absolute path/URL. This PR is adding tests to prove it works.