From 7f1588131bd67e88d83d543a89c0332e0125b2cb Mon Sep 17 00:00:00 2001 From: Durham Goode Date: Fri, 19 Jun 2020 13:36:42 -0700 Subject: [PATCH] py3: set LANG="en_US.UTF-8" for most tests 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 --- eden/mononoke/tests/integration/test-backsyncer-merges.t | 2 +- eden/mononoke/tests/integration/test-cross-repo-commit-sync.t | 2 +- .../tests/integration/test-edenapi-server-complete-trees.t | 2 +- eden/scm/tests/infinitepush/library.sh | 4 ++-- eden/scm/tests/run-tests.py | 2 +- eden/scm/tests/test-cat.t | 2 +- eden/scm/tests/test-check-code.t | 2 +- eden/scm/tests/test-completion.t | 4 ++-- eden/scm/tests/test-debugcheckcasecollisions-treemanifest.t | 2 +- eden/scm/tests/test-encodedstore-long.t | 4 ++-- eden/scm/tests/test-hook.t | 2 +- eden/scm/tests/test-run-tests.t | 4 ++-- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/eden/mononoke/tests/integration/test-backsyncer-merges.t b/eden/mononoke/tests/integration/test-backsyncer-merges.t index 542747897606d..27c19f50be0f0 100644 --- a/eden/mononoke/tests/integration/test-backsyncer-merges.t +++ b/eden/mononoke/tests/integration/test-backsyncer-merges.t @@ -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 diff --git a/eden/mononoke/tests/integration/test-cross-repo-commit-sync.t b/eden/mononoke/tests/integration/test-cross-repo-commit-sync.t index 67c85801bfae0..6c83d34363a56 100644 --- a/eden/mononoke/tests/integration/test-cross-repo-commit-sync.t +++ b/eden/mononoke/tests/integration/test-cross-repo-commit-sync.t @@ -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 diff --git a/eden/mononoke/tests/integration/test-edenapi-server-complete-trees.t b/eden/mononoke/tests/integration/test-edenapi-server-complete-trees.t index 0dae47d3282a6..57af1ad674517 100644 --- a/eden/mononoke/tests/integration/test-edenapi-server-complete-trees.t +++ b/eden/mononoke/tests/integration/test-edenapi-server-complete-trees.t @@ -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 diff --git a/eden/scm/tests/infinitepush/library.sh b/eden/scm/tests/infinitepush/library.sh index 226d7f59f6914..b89226d5ea0a8 100644 --- a/eden/scm/tests/infinitepush/library.sh +++ b/eden/scm/tests/infinitepush/library.sh @@ -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 } diff --git a/eden/scm/tests/run-tests.py b/eden/scm/tests/run-tests.py index 030c17337f547..0aa483e15ec4f 100755 --- a/eden/scm/tests/run-tests.py +++ b/eden/scm/tests/run-tests.py @@ -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 " env["COLUMNS"] = "80" diff --git a/eden/scm/tests/test-cat.t b/eden/scm/tests/test-cat.t index e7d8ee1863029..954bf5f754343 100644 --- a/eden/scm/tests/test-cat.t +++ b/eden/scm/tests/test-cat.t @@ -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 diff --git a/eden/scm/tests/test-check-code.t b/eden/scm/tests/test-check-code.t index 589ed75ffa546..fc98278edc266 100644 --- a/eden/scm/tests/test-check-code.t +++ b/eden/scm/tests/test-check-code.t @@ -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) diff --git a/eden/scm/tests/test-completion.t b/eden/scm/tests/test-completion.t index 1599b21ef85d9..c7bf6dc40e054 100644 --- a/eden/scm/tests/test-completion.t +++ b/eden/scm/tests/test-completion.t @@ -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 @@ -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 diff --git a/eden/scm/tests/test-debugcheckcasecollisions-treemanifest.t b/eden/scm/tests/test-debugcheckcasecollisions-treemanifest.t index bc59d4422585f..56087e21cfd8b 100644 --- a/eden/scm/tests/test-debugcheckcasecollisions-treemanifest.t +++ b/eden/scm/tests/test-debugcheckcasecollisions-treemanifest.t @@ -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 diff --git a/eden/scm/tests/test-encodedstore-long.t b/eden/scm/tests/test-encodedstore-long.t index 448b4a335e47a..cf5bf85f8e532 100644 --- a/eden/scm/tests/test-encodedstore-long.t +++ b/eden/scm/tests/test-encodedstore-long.t @@ -39,7 +39,7 @@ Test directories adding A/YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY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_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 diff --git a/eden/scm/tests/test-hook.t b/eden/scm/tests/test-hook.t index 5a7cdf87216d8..20ba81a928190 100644 --- a/eden/scm/tests/test-hook.t +++ b/eden/scm/tests/test-hook.t @@ -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 diff --git a/eden/scm/tests/test-run-tests.t b/eden/scm/tests/test-run-tests.t index ea98b391ced18..13f44ac5b3740 100644 --- a/eden/scm/tests/test-run-tests.t +++ b/eden/scm/tests/test-run-tests.t @@ -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 @@ -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