Commit Graph

12 Commits

Author SHA1 Message Date
Jun Wu
c12e300bb8 codemod: move Python packages to edenscm
Summary:
Move top-level Python packages `mercurial`, `hgext` and `hgdemandimport` to
a new top-level package `edenscm`. This allows the Python packages provided by
the upstream Mercurial to be installed side-by-side.

To maintain compatibility, `edenscm/` gets added to `sys.path` in
`mercurial/__init__.py`.

Reviewed By: phillco, ikostia

Differential Revision: D13853115

fbshipit-source-id: b296b0673dc54c61ef6a591ebc687057ff53b22e
2019-01-28 18:35:41 -08:00
Jun Wu
061ca2cef4 unittestify: treat skip as success by default
Summary:
The test infra does not handle "skip" state gracefully and treats skips as
"failure". That generated scary reports like hundreds of tests are failing.
Stop reporting skips to fix it.

An enivronment variable is added to get the old behavior.

Reviewed By: singhsrb

Differential Revision: D12808196

fbshipit-source-id: 2356a1d6fdfe1d2991d28368787c7d2b7b525b6b
2018-10-26 15:47:07 -07:00
Jun Wu
a9ed32f839 tests: set maxdifflines to 1000 for buck test
Summary:
Buck test does not print outputs directly to the terminal. So it's better to
not limit the diff size.

Reviewed By: singhsrb

Differential Revision: D9842709

fbshipit-source-id: f17c7321d75761fdac21b9def52dec38f7e0b60c
2018-09-14 19:05:35 -07:00
Jun Wu
0cd76376ed tests: run watchman tests in CI
Summary: Run tests with watchman built from fbcode master. So we get signals about watchman/hg changes.

Reviewed By: DurhamG

Differential Revision: D8448187

fbshipit-source-id: 8643f139932057f326bc75b0b0c5cc616355eeed
2018-06-20 19:35:31 -07:00
Jun Wu
2df677286b unittestify: add missing "port" parameter
Summary:
Mistake by D8414229. "port" should be passed to reduce chances of port
conflict.

Reviewed By: DurhamG, singhsrb

Differential Revision: D8447371

fbshipit-source-id: f45b58095ce3d74eb8ac8458d697b55f956f98b5
2018-06-15 10:10:19 -07:00
Jun Wu
a1c5a8fc76 buck: add a binary target of run-tests.py wrapper
Summary:
This makes it easier to run tests with advanced debug flags without going
through `buck test`.

Reviewed By: phillco

Differential Revision: D8414229

fbshipit-source-id: 62e2233618ea7c671c04bd0e96919c81c60302ae
2018-06-14 21:38:33 -07:00
Lukasz Langa
dfda82e492 Upgrade to 18.5b1
Summary: Mostly empty lines removed and added.  A few bugfixes on excessive line splitting.

Reviewed By: quark-zju

Differential Revision: D8199128

fbshipit-source-id: 90c1616061bfd7cfbba0b75f03f89683340374d5
2018-05-30 02:23:58 -07:00
Jun Wu
584656dff3 codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).

Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.

Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.

An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.

As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.

Reviewed By: wez, phillco, simpkins, pkaush, singhsrb

Differential Revision: D8173629

fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-25 22:17:29 -07:00
Jun Wu
e3010aca6b tests: restore simple error output for buck .t tests
Summary:
Partially revert D7584511 so buck test failures for `.t` tests would show
the `.t` output change instead of a long, less meaningful environment
variables.

Reviewed By: singhsrb

Differential Revision: D7992713

fbshipit-source-id: 64de5e19589277018e1e37968ea69a2329d67852
2018-05-14 13:00:29 -07:00
Martijn Pieters
abd2175e71 hg: actually run the tests in fb/tests
Summary:
There are tests in fb/tests we don't run as part of the test suite. Update the makefile and add buck infrastructure to run them.

 - Update the test-common-commands-hg.t test
 - Re-generate the fbcode/.hgignore file from the updated .gitignore

Reviewed By: quark-zju

Differential Revision: D7584511

fbshipit-source-id: d85800dccf0eb569a68db4b9e1d9796e3d7ac957
2018-04-13 21:51:54 -07:00
Jun Wu
adaee94f27 unittestify: randomize HGPORT
Summary:
Previously a stress test that runs a single test in parallel will have race
condition on HGPORT. This patch randomizes the port so the race becomes
unlikely.

Reviewed By: DurhamG

Differential Revision: D6900641

fbshipit-source-id: 2ad741032e3aa9b0cc9fa831fa57907cc493ce37
2018-04-13 21:51:04 -07:00
Jun Wu
5dabd90466 unittestify: add a script to generate python unittests
Summary:
The script is intended to be used in `python_unittest` target
in buck.

Reviewed By: DurhamG

Differential Revision: D6879870

fbshipit-source-id: 9ed27a691aa23b41dd2620be7871c0a005df60d0
2018-04-13 21:51:02 -07:00