Bugzilla – Bug 1025
tests fail when run with non-english locale
Last modified: 2022-06-06 13:10:42 MDT
Hi, the Debian Salsa Continuous Integration contains a test pipeline where the sudo is built with some random locale activated. If a locale is chosen that is non-english, sudo's tests fail since they expect english output, and sudo is translated to many languages. I opened an issue with the pipeline maintainers and got the advice listed at https://salsa.debian.org/salsa-ci-team/pipeline/-/issues/242, basically saying that sudo's tests should not blindly assume that the tests are run in an English environment, and adjust it's assertions accordingly (as in: translate the reference messages before comparing them). I do not have a clue how easy it would be to "just" gettext in the test suite, also calling up the translations when comparing output, but maybe it is an acceptable workaround to just explicitly set an English locale when running the tests. Greetings Marc P.S.: If the two links to salsa.debian.org only work when logged in, let me know and I'll copy the relevant texts.
The "make check" target sets LC_ALL to either C.UTF-8 (if available) or C and unsets LANG before running the test programs so I thought I had this handled. Running: env LANG=fr_FR.UTF-8 make check passes with no errors. Looking at the raw output from the pipeline I see that it is setting LANGUAGE, which overrides LC_ALL. I've updated the check: target in the Makefiles to unset LANGUAGE too. With that change, the tests pass even when LANGUAGE is set to a non-English locale. https://www.sudo.ws/repos/sudo/rev/87573102f25b
I revisited the issue this morning to reinvestigate, came up with the LANGUAGE result, just to find that you solved the issue while I was sleeping. Thank you very much! It is a pleasure packaging your software.
Fixed in sudo 1.9.11, which is available now.