Skip to content

Run tests with requested locale.#992

Merged
ilonatommy merged 7 commits intodotnet:mainfrom
ilonatommy:set-test-locale
Feb 8, 2023
Merged

Run tests with requested locale.#992
ilonatommy merged 7 commits intodotnet:mainfrom
ilonatommy:set-test-locale

Conversation

@ilonatommy
Copy link
Member

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-YY flag that will set environment variable before the test on Browser / Node is launched. Default is "en-US".

@ilonatommy ilonatommy added the wasm WASM area label Feb 6, 2023
@ilonatommy ilonatommy self-assigned this Feb 6, 2023
ilonatommy and others added 2 commits February 6, 2023 15:10
…nts/LocaleArgument.cs

Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
Copy link
Member

@premun premun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! But I'd suggest also getting a review from someone on the WASM team.

})
.UseConfiguration(
new ConfigurationBuilder()
.AddEnvironmentVariables(prefix: "BROWSER_")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we are doing it on server side?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the browser process needs this environment variable then this needs to be set when launching chrome.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I will paste my test screenshots here from Linux.
Not good:
image
Good:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set the environment variable on the process launch then.

Copy link
Member Author

@ilonatommy ilonatommy Feb 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Credits @radical:
image

@ilonatommy ilonatommy merged commit bde66a8 into dotnet:main Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasm WASM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants