Skip to content

Commit

Permalink
py3: set LANG="en_US.UTF-8" for most tests
Browse files Browse the repository at this point in the history
Summary:
We support unicode file paths, and in python 3 those get passed to
python libraries as unicode strings. The tests set LANG=C which mean the python
library tries to convert the path to ascii, but fails for any non-ascii
characters. Let's switch to LANG="en_US.UTF-8" to match our production
behavior and make tests about unicode paths work.

Reviewed By: xavierd

Differential Revision: D22098359

fbshipit-source-id: c3057edc66e6e32f7b8b49374e622d02bd05711f
  • Loading branch information
DurhamG authored and facebook-github-bot committed Jun 19, 2020
1 parent 8a15d29 commit 7f15881
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion eden/mononoke/tests/integration/test-backsyncer-merges.t
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ although the second one became non-merge commit

Make sure we have directory from the first move, but not from the second
$ ls
file.txt
filetoremove
file.txt
newrepo
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ Disable bookmarks cache because bookmarks are modified by two separate processes
99c848e3f5ff3ab7746fb71816748e2ba0d7da36 fbsource commit 2
b0474d400edddcabef0a27ead293a6b99ae59490 ovrsource commit 2
b06de5da9e40e0da6eda1f7b5c891711106d707b fbsource commit 3
e0cb430152c2dcc47b93a516344e3814ece60d4b fbsource commit 10
default/fbsource/somebook d692e38644b938ccccc4192bd2f507955f3888c5 non-master commit
default/master_bookmark 8d01dd2e0e909e21d3131b7929787db006de999e fbsource commit resume
e0cb430152c2dcc47b93a516344e3814ece60d4b fbsource commit 10

-- Validate the synced entries
$ REPOIDLARGE=0 validate_commit_sync 17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Initialize test repo.
Create a nested directory structure.
$ mkdir -p a{1,2}/b{1,2}/c{1,2}
$ echo "1" | tee a{1,2}/{file,b{1,2}/{file,c{1,2}/file}} > /dev/null
$ tree
$ LC_ALL=C tree
.
|-- a1
| |-- b1
Expand Down
4 changes: 2 additions & 2 deletions eden/scm/tests/infinitepush/library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
INFINITEPUSH_TESTDIR="${RUN_TESTS_LIBRARY:-"$TESTDIR"}"

scratchnodes() {
for node in `find ../repo/.hg/scratchbranches/index/nodemap/* | sort`; do
for node in `find ../repo/.hg/scratchbranches/index/nodemap/* | LC_ALL=C sort`; do
echo ${node##*/} `cat $node`
done
}

scratchbookmarks() {
for bookmark in `find ../repo/.hg/scratchbranches/index/bookmarkmap/* -type f | sort`; do
for bookmark in `find ../repo/.hg/scratchbranches/index/bookmarkmap/* -type f | LC_ALL=C sort`; do
echo "${bookmark##*/bookmarkmap/} `cat $bookmark`"
done
}
Expand Down
2 changes: 1 addition & 1 deletion eden/scm/tests/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@ def defineport(i):

# Reset some environment variables to well-known values so that
# the tests produce repeatable output.
env["LANG"] = env["LC_ALL"] = env["LANGUAGE"] = "C"
env["LANG"] = env["LC_ALL"] = env["LANGUAGE"] = "en_US.UTF-8"
env["TZ"] = "GMT"
env["EMAIL"] = "Foo Bar <[email protected]>"
env["COLUMNS"] = "80"
Expand Down
2 changes: 1 addition & 1 deletion eden/scm/tests/test-cat.t
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Test fileset
$ hg cat --output tmp/%p_p c
$ hg log -r . --template "{rev}: {node|short}\n"
2: 45116003780e
$ find tmp -type f | sort
$ find tmp -type f | LC_ALL=C sort
tmp/.%_d
tmp/HH_45116003780e3678b333fb2c99fa7d559c8457e9
tmp/RR_2
Expand Down
2 changes: 1 addition & 1 deletion eden/scm/tests/test-check-code.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ New errors are not allowed. Warnings are strongly discouraged.
> | sed 's-\\-/-g' > $TESTTMP/files.txt

$ NPROC=`$PYTHON -c 'import multiprocessing; print(multiprocessing.cpu_count())'`
$ cat $TESTTMP/files.txt | PYTHONPATH= xargs -n64 -P $NPROC contrib/check-code.py --warnings --per-file=0 | sort
$ cat $TESTTMP/files.txt | PYTHONPATH= xargs -n64 -P $NPROC contrib/check-code.py --warnings --per-file=0 | LC_ALL=C sort
Skipping edenscm/hgext/extlib/cstore/datapackstore.cpp it has no-che?k-code (glob)
Skipping edenscm/hgext/extlib/cstore/datapackstore.h it has no-che?k-code (glob)
Skipping edenscm/hgext/extlib/cstore/datastore.h it has no-che?k-code (glob)
Expand Down
4 changes: 2 additions & 2 deletions eden/scm/tests/test-completion.t
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Show the alias of a debug command if there are no other candidates


Show the global options
$ hg debugcomplete --options | sort
$ hg debugcomplete --options | LC_ALL=C sort
--color
--config
--configfile
Expand Down Expand Up @@ -216,7 +216,7 @@ Show the global options
-y

Show the options for the "serve" command
$ hg debugcomplete --options serve | sort
$ hg debugcomplete --options serve | LC_ALL=C sort
--accesslog
--address
--certificate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Check basic case collisions
DIRA (directory for DIRA/SUBDIRB/file2) conflicts with dirA
DIRB (directory for DIRB/FILE3) conflicts with dirB
[1]
$ sorted hg debugcheckcasecollisions dirA/subdirA/FILE1 dirA/SUBDIRB/file2 dirB/FILE3
$ LC_ALL=C sorted hg debugcheckcasecollisions dirA/subdirA/FILE1 dirA/SUBDIRB/file2 dirB/FILE3
dirA/SUBDIRB (directory for dirA/SUBDIRB/file2) conflicts with dirA/subdirB
dirA/subdirA/FILE1 conflicts with dirA/subdirA/file1
dirB/FILE3 conflicts with dirB/file3
Expand Down
4 changes: 2 additions & 2 deletions eden/scm/tests/test-encodedstore-long.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Test directories
adding A/YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY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XXXXXXXXXXXXXXXXXXXX.i
data/X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X_X.i
$ python $RUNTESTDIR/ls-l.py .hg/store/dh
Expand Down
2 changes: 1 addition & 1 deletion eden/scm/tests/test-hook.t
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ more there after

(Check that no 'changelog.i.a' file were left behind)

$ ls -1 .hg/store/
$ LC_ALL=C ls -1 .hg/store/
00changelog.d
00changelog.i
00manifest.i
Expand Down
4 changes: 2 additions & 2 deletions eden/scm/tests/test-run-tests.t
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ test --outputdir
# Ran 3 tests, 0 skipped, 2 failed.
python hash seed: * (glob)
[1]
$ ls -a output
$ LC_ALL=C ls -a output
.
..
.testtimes
Expand Down Expand Up @@ -1281,7 +1281,7 @@ test for --json
"time": "\s*[\d\.]{4,5}" (re)
}
} (no-eol)
$ ls -a output
$ LC_ALL=C ls -a output
.
..
.testtimes
Expand Down

0 comments on commit 7f15881

Please sign in to comment.