Commit Graph

61 Commits

Author SHA1 Message Date
Jun Wu
dcb7775096 changelog: remove Python zstore support
Summary:
The zstore for commit messages are now handled by Rust entirely. There is no
need to keep the Python zstore around, except for migration and doctor
use-cases.

Reviewed By: andll

Differential Revision: D27897893

fbshipit-source-id: 21b10596af28c45425f6f102fd13f0421d1e8373
2021-04-21 19:30:15 -07:00
Durham Goode
f0f6a38fbe dynamicconfig: backout D26801059 that enabled no-repo configs
Summary: This seems to have broken the EdenFS HgPrefetch test.

Reviewed By: xavierd

Differential Revision: D27795192

fbshipit-source-id: 80a748036961aa6a5750182bf65637fb76825341
2021-04-15 09:00:19 -07:00
Durham Goode
4803877dde dynamicconfig: generate dynamicconfigs when there's no repo
Summary:
Previously we'd skip dynamicconfigs when there wasn't a repo available.
Now that dynamicconfig can represent the NoRepo state, let's load dynamicconfigs
in that situation.

This also supports the case where there is no user name.

Reviewed By: kulshrax

Differential Revision: D26801059

fbshipit-source-id: 377cfffb6695a7fbe31303868a88862259ebf8c4
2021-04-14 14:32:16 -07:00
Carolyn Busch
86996ffa9f tests: Remove errno.WSAEACCES
Summary: WSAEACCES is included in Windows only. Only check it if the os is windows.

Reviewed By: quark-zju

Differential Revision: D27434606

fbshipit-source-id: 25eb8036363b42629fbd010f7637a404dccff236
2021-03-30 11:20:56 -07:00
Durham Goode
945a516c74 py3: fix tests on Windows
Summary: This fixes various tests on Windows. Many of these fixes were ported from upstream.

Reviewed By: markbt

Differential Revision: D27174617

fbshipit-source-id: b9f36ad0714793f2b76db32c1d840284b744a841
2021-03-29 12:56:48 -07:00
Durham Goode
752c5ccff5 tests: remove test environment when running system hg
Summary:
dynamicconfig has logic to avoid loading remote configs during tests,
by checking the TESTTMP variable. Unfortunately, the tests currently run system
hg with that environment set, which causes it to generate incorrect
configuration for the real repository (i.e. fbsource).

Let's get rid of all test specific environment variables when running the system
hg. There's a comment in the code saying this breaks some tests (from 2017
03a31be593db), but as far as I can see they still work.

Reviewed By: quark-zju

Differential Revision: D26758364

fbshipit-source-id: 945cbd36f7eccc98149772a42421cbc51b157c5b
2021-03-02 12:53:57 -08:00
generatedunixname89002005287564
cb2cc4ddb1 Daily arc lint --take BLACK
Reviewed By: zertosh

Differential Revision: D26686094

fbshipit-source-id: e382675ff1c32f63467d464bce28f54024af35b9
2021-02-26 03:57:20 -08:00
Durham Goode
5ad8e5d836 py3: fix Windows tests
Summary:
Windows tests were failing to execute hg clone ssh://user@dummy/... lines because setconfig ui.ssh=C:/foo/bar was being translated to ui.ssh=c;c:\\foo\\bar by mingw, since it detected /foo/bar as a unix-style path. This seems to be caused by this one line reversing the slashes. I'm not sure why it exists, but deleting it makes the tests pass.

My guess is this has been broken for about a year.

Reviewed By: quark-zju

Differential Revision: D26639206

fbshipit-source-id: d89cae1ea3dd055b90ec6ee8f7cdbee2ae08b228
2021-02-25 09:59:55 -08:00
generatedunixname89002005287564
dafcfcd0bf Daily arc lint --take BLACK
Reviewed By: zertosh

Differential Revision: D26660579

fbshipit-source-id: 2a6f2ff37e6509a59f4927ad5dfa2a84f3d4dc15
2021-02-25 04:29:50 -08:00
Jun Wu
62ba7447f6 ui: switch to Rust IO for default fout, ferr
Summary:
The Rust IO handles progress and streampager stuff. Switch to it so we don't
need to changing the `fout`, `ferr` when handling streampager in Python.

The chgserver logic is updated to just set raw fd 0, 1, 2 to update stdio,
since `fileno` is no longer exposed from Rust.

Manually tested the following commands, both without chg and with chg:
- lhg log -r . (no pager)
- lhg log (with streampager)
- lhg log --config pager.pager=less (with less pager)
- lhg commit (spawns pager)
- lhg debugprogress -s 100 --sleep 100 --with-output --pager=off (progress in stderr)
- lhg debugprogress -s 100 --sleep 100 --with-output --pager=on --config pager.interface=fullscreen (progress in streampager)
- lhg debugprogress -s 100 --sleep 100 --with-output --pager=on --config pager.pager='LESS= less' (progress is disabled with external pager)

Reviewed By: sfilipco

Differential Revision: D26612487

fbshipit-source-id: 8b4e36b614a0c080b93e41474f9a8fc33f890083
2021-02-23 22:33:48 -08:00
Genevieve Helsel
f2d6906665 fix dictionary changed size during iteration in run_tests.py
Summary:
We shouldn't delete from a dictionary while iterating over it, instead we should iterate over a copy and then delete from the original.
`.keys()` returns a view of the dict, while wrapping it in `list` makes a deep copy.

Reviewed By: StanislavGlebik

Differential Revision: D26618782

fbshipit-source-id: 234503aab0a0a2151ae0818282651b547f414016
2021-02-23 16:55:07 -08:00
Jun Wu
358466ee0f transaction: record transaction name to metalog
Summary:
For `repo.transaction("tr-name")`, this records `Transaction: tr-name` to
metalog commit description.

It can be helpful to narrow things down for commands with multiple
transactions.

In the future we might want to attach more data to the logging (ex. what the
commit cloud local, remote states at the time of syncing). However I didn't
do it now since metalog is designed to hold repository data, not too much
logging data. With a better logging infra we might want to move `config` out
from metalog, associated with metalog root ids.

Reviewed By: DurhamG

Differential Revision: D25984805

fbshipit-source-id: 59c074272cff555c6ff11dd755f7e3ce9a292eb6
2021-01-29 12:36:08 -08:00
Jan Mazur
d1b291d72a flush stream to always print out interactive prompt
Summary: Suddenly prompt stopped appearing for me. Flush the stream to be sure that it's printed out.

Reviewed By: HarveyHunt

Differential Revision: D25956018

fbshipit-source-id: 83419037fa6ce672e203385b71f1403a738d0c90
2021-01-22 07:46:11 -08:00
Jun Wu
78005ae5a5 py3: fix test-run-tests.py
Summary:
When running `python3 run-tests.py test-run-tests.py`, some bytes were printed
with `b` prefix.  Convert them to `str`.

Reviewed By: DurhamG

Differential Revision: D25642164

fbshipit-source-id: f1103b24ad88d0d024f6be546bf632141f06ebd1
2020-12-18 10:38:19 -08:00
Durham Goode
cfd7ccc828 configs: add Python support for allowed_locations list
Summary:
configs.allowedlocations restricts what configs can be loaded to a
certain set of files. This will enable us to deprecate all old config locations.

This diff adds Python support and a high level test.

Reviewed By: quark-zju

Differential Revision: D25539736

fbshipit-source-id: fa2544379b65672227e0d9cf08dad7016d6bbac8
2020-12-17 06:37:54 -08:00
John Reese
d13e0b137f apply pyfmt with usort to opted-in sources
Reviewed By: zertosh

Differential Revision: D24880203

fbshipit-source-id: 2034cdfc2712209e86d3d05c119c58f979b05c52
2020-11-10 21:25:54 -08:00
Jun Wu
9bf6b674a6 config: use Rust graph render as default
Summary: Change the legacy Python graph render to Rust renderer.

Reviewed By: DurhamG

Differential Revision: D24317802

fbshipit-source-id: 4c3dc3a6dd02b7ebe79596a8e77f4b6b139d2e20
2020-10-19 17:07:30 -07:00
Lukas Piatkowski
715351d576 mononoke/integration tests: fix test-clienttelemetry.t by disabling features
Summary:
The logic inside `eden/scm/tests/features.py` script enables certain
features of HG on tests based on the name of the test. Mononoke's integration
tests suit reuses eden/scm's tests suit and as a consequence it triggers the
same `features.py` logic. It was fine until D24201934 (f5988c415c) introduced a feature for
test that is named in the same way as one of the Mononoke tests - the
`test-clienttelemetry.t`.

In order to fix this problem Mononoke will pass a `--nofeatures` flag to the
`eden/scm/run-tests.py` invocations that will turn off the usage of
`features.py`.

Reviewed By: farnz

Differential Revision: D24276294

fbshipit-source-id: eb28ed55a05de3b012e37407603c2370adaaad16
2020-10-13 05:28:27 -07:00
Jun Wu
8dc618b1cd runtests: set tracing level before running tests
Summary:
With the new tracing-core (0.1.10 ->  0.1.16), it's no longer effective
to set EDENSCM_TRACE_LEVEL to more verbose within the test.
Let's set it in run-tests.py which spawns the test process instead.

Reviewed By: kulshrax

Differential Revision: D24004327

fbshipit-source-id: db2cadc7334eb59b25a1e0517e3d1a513e31e0fe
2020-09-29 21:19:20 -07:00
Durham Goode
c80cdf1f49 treemanifest: enable treemanifest.useruststore=True for most tests
Summary:
The remaining test failures are mostly around bundle support, which
I'll fix in a later diff.

Reviewed By: quark-zju

Differential Revision: D23664037

fbshipit-source-id: 2bdde3cb4fcded6e0cf3afdc23269662544821df
2020-09-24 09:46:59 -07:00
Durham Goode
2f5130c882 py3: fix extdiff
Summary:
extdiff uses shutil.rmtree which calls os.rmdir with new python 3
options. Since we pathc os.rmdir, we need to support those options.

Reviewed By: quark-zju

Differential Revision: D23350968

fbshipit-source-id: 081d179dcd67b51ffdeb6b85899adf4e574a8d0f
2020-08-27 19:15:22 -07:00
Mark Thomas
44b7724014 run-tests: add internal:none editor
Summary: Rather than using a Python program, simulate having no editor during tests using `internal:none`.

Reviewed By: quark-zju, ikostia

Differential Revision: D23152446

fbshipit-source-id: 5560f58885ee5959c62f0ac8bcf0483b9c3072f6
2020-08-19 00:32:19 -07:00
Lukas Piatkowski
e78c6d58c3 mononoke/integration tests: use C locale by default (#41)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/41

As of D22098359 (7f1588131b) the default locale used by integration tests is en_US.UTF-8, but as the comment in code mentiones:
```
The en_US.UTF-8 locale doesn't behave the same on all systems and trying to run
commands like "sed" or "tr" on non-utf8 data will result in "Illegal byte
sequence" error.
That is why we are forcing the "C" locale.
```

Additionally I've changed the test-walker-throttle.t test to use "/bin/date" directly. Previously it was using "/usr/bin/date", but the "/bin/date" is a more standard path as it works on MacOS.

Reviewed By: krallin

Differential Revision: D22865007

fbshipit-source-id: afd1346e1753df84bcfc4cf88651813c06933f79
2020-07-31 09:02:33 -07:00
Jun Wu
7c87f1259a tests: stop enabling zstore-commit-data
Summary:
The zstore-commit-data code paths are in Python. We want to move them to behind
the Rust HgCommits abstractions. So stop making Python interact with the
low-level details.

Reviewed By: DurhamG

Differential Revision: D22638457

fbshipit-source-id: 435db8425a29ce4eae24a6202ad928f85a5f5ee2
2020-07-30 20:32:33 -07:00
Durham Goode
065db9681c py3: fix test-merge-tools.t
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22652124

fbshipit-source-id: 145ef33507ce1cf774a22841c1809a068720a80b
2020-07-22 19:00:41 -07:00
Jun Wu
0562c1220f tests: enable template-new-builtin
Summary: This makes tests depend less on revision numbers.

Reviewed By: DurhamG

Differential Revision: D22468669

fbshipit-source-id: 74a06930faa3e6ee9d246ecc718c2a3740f57a54
2020-07-20 17:27:53 -07:00
Jun Wu
473b07c328 tests: add a way to fix revision number usages automatically in tests
Summary:
Some tests use too many revision numbers (ex. test-rebase-scenario-global.t).
It's time consuming to fix it manually. Write a script to help with that.

This will be used by the next diff.

Reviewed By: DurhamG

Differential Revision: D22174956

fbshipit-source-id: a873ad326ecbd9cdfa2df58839b0ef21626e1506
2020-07-02 13:22:30 -07:00
Jun Wu
b2ce9d0ef8 run-tests: do not wait for the progress thread
Summary:
Sometimes `Ctrl+C` the test runner does not fully stop it. From gdb it seems
the test runner is waiting for a thread which might have deadlocked. The
progress thread does not have anything critical that need to sync back to
the main program. Avoid waiting for it to make Ctrl+C work better.

Reviewed By: kulshrax

Differential Revision: D22290453

fbshipit-source-id: bdc5260cbd339cc392728834330609343c0048d3
2020-06-29 18:45:41 -07:00
Durham Goode
d02d5cdbfe py3: fix test-fsmonitor*
Summary: These now pass

Reviewed By: quark-zju

Differential Revision: D22127383

fbshipit-source-id: bcaad400d9f849251e396b68ad1b4d04c8831314
2020-06-19 13:40:18 -07:00
Durham Goode
7f1588131b 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
2020-06-19 13:40:17 -07:00
Jun Wu
6584ad18f6 run-tests: add a way to record $TESTTMP changes in source control
Summary:
Add a `--record` flag, which uses `git` to track changes in `$TESTTMP`.
I use it to track changes with C revlog vs the Rust revlog.

Reviewed By: farnz

Differential Revision: D22007501

fbshipit-source-id: a8027aa4b2b3b97c3cf5f642434451826fcbded9
2020-06-15 14:41:52 -07:00
Jun Wu
5344951764 tests: turn on mutation, disable obsstore for tests
Summary:
Incompatible tests are blacklisted.

The affects non-tests environment: `proxy-obsstore` is turned on.
That is in theory not very different from having an empty obsstore.
If it becomes an issue we can easily turn it off.

Reviewed By: sfilipco

Differential Revision: D21899139

fbshipit-source-id: e4a87ecced0542e7852b48b1a807775e523b3cc9
2020-06-10 19:30:01 -07:00
Jun Wu
19326b3489 run-tests: make output format friendly for adhoc scripts
Summary:
I found myself friendly editing the output of run-tests.py:

  Failed test-failure.t: output changed
  Failed test-failure-unicode.t: output changed

to extract file names:

  test-failure-unicode.t
  test-failure.t

Then use the file names as parameters to other commands, like `run-tests.py`
again, or `hg revert`, or `hg shelve`.

Change the output format to print the filenames directly to make it easier to
use.

Reviewed By: sfilipco

Differential Revision: D21913609

fbshipit-source-id: 4b1d2265f384ad9afbe478b7ff0d6e543eff00df
2020-06-10 19:29:59 -07:00
Durham Goode
9473b487b5 tests: enable treemanifest for ~100 more tests
Summary:
Enables treemanifest for about 100 more tests. To make them pass I had
to expose the gettreepack capability from peers, which just works, and enable
treeonly and sendtrees by default in the tests, which I probably should've done
before anyway.

Reviewed By: quark-zju

Differential Revision: D21894955

fbshipit-source-id: 7a6a4d453824fb8c81a797a5487bf2ecc2b67761
2020-06-10 19:29:48 -07:00
Sandeep Kumar Pani
e28bde4df3 Make tests also use TPX in the env
Differential Revision: D21935706

fbshipit-source-id: 411277be2f8e8666569621de70eff50276897337
2020-06-10 19:29:38 -07:00
Mark Thomas
052e7c3877 check-code: convert to Python 3
Summary:
Update `contrib/check-code.py` to Python 3.

Mostly it was already compatible, however stricter regular expression parsing
revealed a case where one of our tests wasn't working, and as a result lots of
instances of `open(file).read()` existed that this test should have caught.

I have fixed up most of the instances in the code, although there are many
in the test suite that I have ignored for now.

Reviewed By: quark-zju

Differential Revision: D21427212

fbshipit-source-id: 7461a7c391e0ade947f779a2b476ca937fd24a8d
2020-05-07 09:07:50 -07:00
Jun Wu
e6fb421769 tests: add a hint about how to set up HGRCPATH for --keeptmp
Summary: Print out a command that can be copied and executed to make `--keeptmp` more handy.

Reviewed By: sfilipco

Differential Revision: D20829140

fbshipit-source-id: 7976e3f64fd423425ec29634a53a34f7b5e091d0
2020-04-07 19:21:06 -07:00
Durham Goode
ceca615943 workingcopy: enable rust walker by default in tests
Summary: Let's enable it for tests. We'll slow roll it in production.

Reviewed By: quark-zju

Differential Revision: D19543790

fbshipit-source-id: be7d18dd8ffe51615a27c39ebf4247ec405b4097
2020-03-17 10:39:15 -07:00
Jun Wu
ea7a8b68a5 run-tests: fail instead of skipping tests for unknwon hghave features
Summary:
If hghave fails to check a feature because the feature name is unknown, treat
it as a test failure instead of skipping the entire test. This is especially
useful since `#if feature-name` only affects part of the test and failing to
test the feature should not skip the entire test. It also allows us to capture
issues about mis-spelled feature names or stale feature tests.

This has bitten us twice in the past:

- D18819680 removed `pure` and accidently disabled tests including
  `test-install.t`, `test-annotate.t` and `test-issue4074.t`. Those tests got
  re-enabled as part of D20155399, while they pass Python 2 tests,
  the Python 3 tests were failing.

- D18088850 removed svn related feature checks, which has caused some issues
  that got fixed by D18713921 and D18713922.<Paste>

Reviewed By: xavierd

Differential Revision: D20231782

fbshipit-source-id: 6adf99bd79b2a295d4e84ce4da5f9425a100936a
2020-03-03 19:17:59 -08:00
Jun Wu
a5066dd552 dummyssh: add a way to stabilize stdout, stderr order
Summary:
The ssh output order issue is a large contributor to test flakiness.
Example test failures are:

```
 --- test-unbundlereplay.t
+++ test-unbundlereplay.t.respondfully.err
@@ -154,9 +154,9 @@
   remote: [ReplayVerification] Expected: (master_bookmark, c2e526aacb5100b7c1ddb9b711d2e012e6c
69cda). Actual: (master_bookmark, 893d83f11bf81ce2b895a93d51638d4049d56ce2)
   remote: pushkey-abort: prepushkey hook exited with status 1
   remote: transaction abort!
+  replay failed: error:pushkey
+  unbundle replay batch item #0 failed
   remote: rollback completed
-  replay failed: error:pushkey
-  unbundle replay batch item #0 failed
   [1]
   $ cat $TESTTMP/reports.txt
   unbundle replay batch item #0 failed

 --- test-commitcloud-backup-all.t
+++ test-commitcloud-backup-all.t.err
@@ -59,9 +59,9 @@
   remote: pushing 1 commit:
   remote:     eccc11f58a56  D3
   backing up stack rooted at 42952ab62cec
+  backing up stack rooted at 4903fdffd9c6
   remote: pushing 1 commit:
   remote:     42952ab62cec  E1
-  backing up stack rooted at 4903fdffd9c6
   remote: pushing 1 commit:
   remote:     4903fdffd9c6  E2
   commitcloud: backed up 8 commits

test-fb-hgext-lfspushrebase-verify-blobs.t

 --- test-fb-hgext-treemanifest-pushrebase.t
+++ test-fb-hgext-treemanifest-pushrebase.t.err
@@ -127,9 +127,9 @@
   $ hg push --to master -B master --config treemanifest.sendtrees=True
   pushing to ssh://user@dummy/master
   searching for changes
-  remote: baz
   remote: prepushrebase.cat hook exited with status 1
   abort: push failed on remote
+  remote: baz
   [255]

 - Disable the hook
 ```

The order is nondeterministic because the stderr reading thread can read the
content before or after ui.write or ui.write_err in the main thread.

This diff introduces an optional feature in dummyssh that buffers all stderr
output and only write them after the wrapped hg serve process has exited, at
which time the hg client should also have completed its operations and has no
reason to ui.write or ui.write_err anything nondeterministically. Then the
dummyssh wrapper writes out the buffered stderr so the output order becomes
well defined.

Reviewed By: xavierd

Differential Revision: D19872612

fbshipit-source-id: 84710f98a8e6b4a1c283ffecf008585cca12be0a
2020-02-27 07:24:37 -08:00
Mark Thomas
5168c29e12 encoding: use correct output encoding on windows
Summary:
On Windows, there are *two* 8-bit encodings for each process.

* The ANSI code page is used for all `...A` system calls, and this is what
  Mercurial uses internally.  It can be overridden using the `--encoding`
  command line option.

* The OEM code page is used when outputing to the console.  Mercurial has no
  concept of this, and instead renders to the console using the ANSI code page,
  which results in mojibake like "Θ" instead of "é".

Add the concept of an `outputencoding`.  If this differs from `encoding`, we
convert from the local encoding to the output encoding before writing to the
console.

On non-Windows platforms, this defaults to the same encoding as the local encoding,
so this is a no-op unless `--outputencoding` is manually specified.

On Windows, this defaults to the codepage given by `GetOEMCP`, causing output
to be converted to the OEM codepage before being printed.

For ordinary strings, the local encoded version is wrapped by `localstr` if the
encoding does not round-trip cleanly.  This means the output encoding works
even if the character is not represented in the local encoding.

Unfortunately, the templater is not localstr-clean, which means strings can get
flattened down to the local encoding and the original code points are lost.  In
this case we can only output characters which are in the intersection of the
encoding and the output encoding.

Most US English Windows systems use cp1252 for the ANSI code page and cp437 for
the OEM code page.  These both contain many accented characters, so users with
accented characters in their names will now see them correctly rendered.

All of this only applies to Python 2.7.  In Python 3, everything is Unicode,
the `--encoding` and `--outputencoding` options do nothing, and it just works.

Reviewed By: quark-zju, ikostia

Differential Revision: D19951381

fbshipit-source-id: d5cb8b5bfe2bc131b2e6c3b892137a48b2139ca9
2020-02-20 04:28:48 -08:00
Thomas Orozco
de9b3cdc83 run-tests: encode diff in utf-8
Summary:
See later in this stack for motivation. This seems to work fine, and it allows
characters that don't fit latin1 when rendering diffs.

Reviewed By: markbt

Differential Revision: D19969743

fbshipit-source-id: 79c4afce5a19822d9b075d23ff4c88aa76ce2f42
2020-02-20 02:49:38 -08:00
Jun Wu
a8874af094 run-tests: clear RUST_BACKTRACE and RUST_LIB_BACKTRACE
Summary:
Some Mononoke tests test about the backtrace. Having the environment variables
set break those tests. Clear them.

Reviewed By: xavierd

Differential Revision: D19887219

fbshipit-source-id: 529a17282c40730ee95bffbed00070edd1f0823a
2020-02-13 14:50:51 -08:00
Jun Wu
3a8e77f15e run-tests: add --debug support for Python tests
Summary:
In D19581174 I made `--debug` trigger ipdb session for `.t` tests.
This diff adds similar feature for `.py` tests.

Reviewed By: DurhamG

Differential Revision: D19784795

fbshipit-source-id: 9118c74ea465320f15aa6ad5e1e04d8bc1a49966
2020-02-07 11:03:45 -08:00
Durham Goode
d3227d34c2 py3: remove forced decoding of environment variable
Summary:
On python 2, os.environ is expected to be bytes, so let's remove the
forced decoding. This broke run-tests.py on Windows.

Reviewed By: singhsrb

Differential Revision: D19737218

fbshipit-source-id: d4782eea279275f57cc91bc412a2d74857002cc1
2020-02-04 17:31:45 -08:00
Saurabh Singh
1891591abc unicode: consistently use 'utf-8' everywhere
Summary:
We generally use 'utf-8' but are using 'utf8' at some places. This
diff changes to using 'utf-8' consistently everywhere.

Reviewed By: farnz

Differential Revision: D19674111

fbshipit-source-id: 3be42859a180ded1c234b805259f086f9531ba18
2020-01-31 17:34:53 -08:00
Zeyi (Rice) Fan
fa54b36b93 fix Windows tests
Summary: This fixes the Windows build failure we are seeing. Apparently Python 2 on Windows does not like unicode type in `os.environ`

Reviewed By: markbt

Differential Revision: D19672308

fbshipit-source-id: b45c1ccf47bdd46dc31d6c980d0e70dd2e084c8f
2020-01-31 16:53:12 -08:00
Zeyi (Rice) Fan
a634526801 some fix for run-tests
Summary:
Fix some common errors when run `run-tests` in Python 3.

shlib would be using `str` for stdin/stdout instead of bytes as most of the code in Python 2 operates with that assumption. Getting it to `bytes` will take some work.

Reviewed By: DurhamG, quark-zju

Differential Revision: D19649475

fbshipit-source-id: 1f0190fce4df9a530246774fd17cdfc2d7974a65
2020-01-30 17:24:32 -08:00
Zeyi (Rice) Fan
b58fe35549 make run-tests.py py3 compatible
Summary: This diff makes `run-test.py` compatible with Python 3, so we can run this tests both in Python 3 and 2.

Differential Revision: D19611680

fbshipit-source-id: 97571cca7e1310e482ac8c03af73eb345ab825c1
2020-01-29 17:07:33 -08:00
Jun Wu
a0bd794d55 run-tests: make --debug add debugger settings
Summary: This makes --debug more useful - crashes in tests trigger ipdb sessions.

Reviewed By: mitrandir77

Differential Revision: D19581174

fbshipit-source-id: 770c7b054dfce88082b67a9347ecaeb24d8583bc
2020-01-27 19:37:21 -08:00