Page MenuHomePhabricator

tests: fix test-chg to ignore a warning about being unable to set locale
ClosedPublic

Authored by spectral on Apr 19 2021, 6:32 PM.

Details

Summary

This is apparently coming from bash when bash is providing the sh that we're
using to execute the .sh file generated by run-tests for this test.

Bash on my machine:

$ sh --version
GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ sh
sh-5.1$ LC_CTYPE=unsupported_value echo hi
sh: warning: setlocale: LC_CTYPE: cannot change locale (unsupported_value): No such file or directory
hi

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

spectral created this revision.Apr 19 2021, 6:32 PM
marmoute added inline comments.
tests/test-chg.t
461

curiosity: Where do you see this ? I cannot reproduce with neither python 3.8 nor 3.9 ?

spectral marked an inline comment as done.Apr 21 2021, 4:18 PM
spectral added inline comments.
tests/test-chg.t
461

A distro that tracks debian testing somewhat closely, running python3.9.

Reproduction steps, at least here:

$ hg co 856820b4
$ make local PYTHON=python3.9
$ (cd contrib/chg; make)
$ cd tests
$ python3.9 ./run-tests.py -j36 -l --chg test-chg.t
running 1 tests using 1 parallel processes 

--- /usr/local/google/home/spectral/src/hg/hg/tests/test-chg.t
+++ /usr/local/google/home/spectral/src/hg/hg/tests/test-chg.t.err
@@ -458,6 +458,7 @@
   LC_CTYPE=
   $ (unset LC_ALL; unset LANG; LC_CTYPE=unsupported_value chg \
   >    --config extensions.debugenv=$TESTTMP/debugenv.py debugenv)
+  $TESTTMP.sh: line 334: warning: setlocale: LC_CTYPE: cannot change locale (): $ENOENT$
   LC_CTYPE=unsupported_value
   $ (unset LC_ALL; unset LANG; LC_CTYPE= chg \
   >    --config extensions.debugenv=$TESTTMP/debugenv.py debugenv)

ERROR: test-chg.t output changed
!
Failed test-chg.t: output changed
# Ran 1 tests, 0 skipped, 1 failed.
python hash seed: 2694163788

Though... I hadn't noticed the "$TESTTMP.sh" here? Yeah, this appears to be a *bash* thing (afaik we're using bash for sh on this machine).

$ sh
sh-5.1$ LC_CTYPE=unsupported_value echo hi
sh: warning: setlocale: LC_CTYPE: cannot change locale (unsupported_value): No such file or directory
hi
$ sh --version
GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Let me adjust the commit message.

spectral edited the summary of this revision. (Show Details)Apr 21 2021, 4:18 PM
pulkit accepted this revision.Apr 28 2021, 6:38 AM
This revision is now accepted and ready to land.Apr 28 2021, 6:38 AM
spectral marked an inline comment as done.Apr 30 2021, 10:07 AM
This revision was automatically updated to reflect the committed changes.