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

One test fails with non-english locales #2494

Closed
vtamara opened this issue Dec 1, 2024 · 1 comment
Closed

One test fails with non-english locales #2494

vtamara opened this issue Dec 1, 2024 · 1 comment

Comments

@vtamara
Copy link
Contributor

vtamara commented Dec 1, 2024

To reproduce, run the tests as explained in the README.md but with a non-english locale like:

LANG=es_CO.UTF-8 just ci

On OpenBSD/adJ 7.6beta and on Linux Ubuntu 24.04 it will produce:

---- constants::constants_are_not_exported stdout ----
thread 'constants::constants_are_not_exported' panicked at tests/constants.rs:60:6:
Stderr regex mismatch:
"echo $HEXUPPER\nbash: línea 1: HEXUPPER: variable sin asignar\nerror: Recipe `foo` failed on line 4 with exit code 127\n"
!~=
/Regex("^(?s).*HEXUPPER: unbound variable.*$")/
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    constants::constants_are_not_exported

test result: FAILED. 852 passed; 1 failed; 7 ignored; 0 measured; 0 filtered out; finished in 0.59s

error: test failed, to rerun pass `-p just --test integration`
error: Recipe `test` failed on line 17 with exit code 101
vtamara added a commit to vtamara/just that referenced this issue Dec 1, 2024
@casey
Copy link
Owner

casey commented Dec 2, 2024

Thanks for creating this issue!

I think this is an instance of a more general problem. We rely on a lot of system binaries for testing, but those binaries often behave different in different environments, for example, different OSes, or, as you discovered, different locales.

I added a hidden --request subcommand to just #2498, which can be used in testing for, currently, getting and returning environment variable without relying on any particular system or shell behavior.

This can be expanded in the future, to add new things we currently rely on external binaries for. (Like cat and touch.)

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

No branches or pull requests

2 participants