Run tests with requested locale.#992
Conversation
src/Microsoft.DotNet.XHarness.CLI/CommandArguments/WASM/Arguments/LocaleArgument.cs
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/JS/WasmTestCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/CommandArguments/WASM/Arguments/LocaleArgument.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs
Outdated
Show resolved
Hide resolved
…nts/LocaleArgument.cs Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
premun
left a comment
There was a problem hiding this comment.
LGTM! But I'd suggest also getting a review from someone on the WASM team.
src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs
Outdated
Show resolved
Hide resolved
| }) | ||
| .UseConfiguration( | ||
| new ConfigurationBuilder() | ||
| .AddEnvironmentVariables(prefix: "BROWSER_") |
There was a problem hiding this comment.
Why we are doing it on server side?
There was a problem hiding this comment.
That was the only idea I came up with to pack setting the LANGUAGE var for the testing process only. I don't see any way of setting it to the BrowserDriver because adding "--lang" argument on Linux it does not have any effect. In my understanding it's the equivalent of setting the env variable for the test process, isn't it?
There was a problem hiding this comment.
If the browser process needs this environment variable then this needs to be set when launching chrome.
There was a problem hiding this comment.
Set the environment variable on the process launch then.



For dotnet/runtime#80421 we need tests to run with specific locale set, otherwise we won't be able to test the mechanism of loading different internationalization data based on the client's locale.
I added
-locale=xx-YYflag that will set environment variable before the test on Browser / Node is launched. Default is "en-US".