Commit Graph

12491 Commits

Author SHA1 Message Date
Phil Cohen
7bcdda8bfc simplecache: allow debug output to be switched off
Summary:
This extension can be a bit noisy when defaulted-on. Let's disable its debug output in
tests (except fot its own tests).

Differential Revision: D6777765

fbshipit-source-id: e2a6c6b7527336a1fac24078d2b49eb1e75ecabf
2018-04-13 21:50:55 -07:00
Durham Goode
b7dbb99114 tests: more test fixes
fbshipit-source-id: ee020b6b9664d94897184007519becb907220fa9
2018-04-13 21:50:55 -07:00
Durham Goode
954ae64c77 tests: update check tests
fbshipit-source-id: 7deb61c17bf461b7632a1d3f3d7f2ae8a8828ede
2018-04-13 21:50:55 -07:00
Jun Wu
effa0da8de test-helpers: add a helper to run test using chg
Summary:
The helper could be used in individual tests to enable chg if chg exists.
This allows us to have more precise control on what tests to use chg instead
of using a global flag in run-tests.py.

This makes certain tests containing many hg commands much faster. For example,
`test-revset.t` took 99 seconds before:

  % ./run-tests.py test-revset.t --time
  .
  # Ran 1 tests, 0 skipped, 0 failed.
  # Producing time report
  start   end     cuser   csys    real      Test
    0.000  99.990  86.410  12.000  99.990   test-revset.t

And 10 seconds after:

  % ./run-tests.py test-revset.t --time
  .
  # Ran 1 tests, 0 skipped, 0 failed.
  # Producing time report
  start   end     cuser   csys    real      Test
    0.000  10.080   0.380   0.130  10.080   test-revset.t

Also enable it for some other tests. Note the whitelist is not complete.  We
probably want to whitelist more tests in the future.

The feature could be opted out by deleting `contrib/chg/chg`.

Reviewed By: phillco

Differential Revision: D6767036

fbshipit-source-id: 8220cf408aa198d5d8e2ca5127ca60e2070d3444
2018-04-13 21:50:54 -07:00
Kostia Balytskyi
e45985d846 hggit: skip, not fail a test if dulwich is missing
Summary: This manifests itself on MacBooks where dulwich is not installed.

Differential Revision: D6759617

fbshipit-source-id: c90c35ebaa4fd2a14b1ad2fa0fadaca3c6ea8c29
2018-04-13 21:50:54 -07:00
Liubov Dmitrieva
82b604cb44 infinitepush: rename commands
Summary: infinitepush: rename commands

Differential Revision: D6772334

fbshipit-source-id: c6a913c5e4b29ca6b92d2aa06b4b072c73d28697
2018-04-13 21:50:54 -07:00
Hollis Blanchard
5d56308d7e p4fastimport: fix ignored executable bits
Differential Revision: https://phab.mercurial-scm.org/D1912

fbshipit-source-id: 8972a19eb3faa7aeb91bf9a341702a7afffc7e63
2018-04-13 21:50:54 -07:00
Jun Wu
9fde63a970 run-tests: add a --extra-rcpath option to load other config files
Summary:
This makes it easier to run integration tests where we want to load
additional sets of config files.

Reviewed By: DurhamG

Differential Revision: D6755017

fbshipit-source-id: af062fcc465eee969e1315f9430333908ef38303
2018-04-13 21:50:54 -07:00
Jun Wu
8238de1e82 keyword: drop the extension
Summary:
The keyword extension is rarely used. And it breaks sshaskpass because
Python standard library `collections` (which does not use absolute import)
will import the wrong `keyword` module:

  $ hg pull ssh://localhost/foo --debug
  pulling from ssh://localhost/foo
  running SSH_ASKPASS=/tmp/tmpj_6pDJttysrv/2991364.sh DISPLAY=localhost:10.0 TTYSOCK=/tmp/tmpj_6pDJttysrv/2991364 ssh -oControlMaster=no localhost 'hg -R foo serve --stdio'
  sending hello command
  sending between command
  remote: Traceback (most recent call last):
  remote:   File "/usr/lib64/python2.7/site-packages/hgext/sshaskpass.py", line 43, in <module>
  remote:     import collections
  remote:   File "/usr/lib64/python2.7/collections.py", line 10, in <module>
  remote:     from keyword import iskeyword as _iskeyword
  remote:   File "/usr/lib64/python2.7/site-packages/hgext/keyword.py", line 93, in <module>
  remote:     from mercurial.i18n import _
  remote:   File "/usr/lib64/python2.7/site-packages/mercurial/i18n.py", line 15, in <module>
  remote:     from . import (
  remote:   File "/usr/lib64/python2.7/site-packages/mercurial/encoding.py", line 15, in <module>
  remote:     from . import (
  remote:   File "/usr/lib64/python2.7/site-packages/mercurial/error.py", line 17, in <module>
  remote:     from . import pycompat
  remote:   File "/usr/lib64/python2.7/site-packages/mercurial/pycompat.py", line 22, in <module>
  remote:     import cookielib
  remote:   File "/usr/lib64/python2.7/cookielib.py", line 32, in <module>
  remote:     import re, urlparse, copy, time, urllib
  remote:   File "/usr/lib64/python2.7/urlparse.py", line 123, in <module>
  remote:     from collections import namedtuple
  remote: ImportError: cannot import name namedtuple

Reviewed By: singhsrb

Differential Revision: D6766686

fbshipit-source-id: af67a4d8c736158951c737b790904ba11419d432
2018-04-13 21:50:54 -07:00
Jun Wu
2c2e9112b0 hgsubversion: do not mess up with sys.path
Summary:
`run-tests.py` should set up `sys.path` correctly so `import mercurial` in
the hgsubversion tests should just work.

Also add a comment in `run-tests.py` to clarify this.

The hgsubversion module check is removed since it assumes the module lives in a
same directory as the test, which is not true with the `run-test.py --rebuild`
case.

Reviewed By: phillco

Differential Revision: D6758588

fbshipit-source-id: ba34253991e671dc972bcb1900243eab6b69fd92
2018-04-13 21:50:54 -07:00
Phil Cohen
5cae81a643 extensions: default-on conflictinfo, errorredirect, ...
Summary: ...mergedriver, and progressfile.

Reviewed By: quark-zju, singhsrb

Differential Revision: D6765952

fbshipit-source-id: 8eddcdeffa5d6532f737f45f7e1071c1a563a3cd
2018-04-13 21:50:54 -07:00
Siddharth Agarwal
946d70edca sshserver: add a couple of tests for argument parsing
Summary: I noticed that we didn't have any unit tests covering wire protocol argument parsing.

Differential Revision: D6757891

fbshipit-source-id: 17ec2be2f7e6bf193983178938dcc27e23dfff71
2018-04-13 21:50:54 -07:00
Siddharth Agarwal
af0f79a556 watchman: add an empty .watchmanconfig
Summary:
This ensures that watchman doesn't complain when it starts watching this
directory.

Differential Revision: D6757821

fbshipit-source-id: 30b3e71b9601e74af51ad7ac18e1f197777b9e72
2018-04-13 21:50:54 -07:00
Durham Goode
8e36a4eab5 excludedefault: update the tests
fbshipit-source-id: 1c2acaf5f5e0bfbf21e0d427e24d3e9975516151
2018-04-13 21:50:53 -07:00
Durham Goode
3666ccd6b2 clindex: disable by default for now
fbshipit-source-id: b1af6f49eebfbada4bf9637ea4935c618b0e7bb6
2018-04-13 21:50:53 -07:00
Phil Cohen
0900d9a168 extensions: add --excludedefault to hg debugextensions
Summary: Otherwise this test will fill up with default-on tests that will be a pain to filter manually. Plus it's a sensible flag to have.

Differential Revision: D6760553

fbshipit-source-id: 083cb2d8a7cffe28eef812edad2f4c5d997db981
2018-04-13 21:50:53 -07:00
Phil Cohen
02d588a3bc extensions: fix reposetup() not getting called for DEFAULT_EXTENSIONS
Summary:
`_peerorrepo` calls `extensions.extensions()` to figure out on which modules to run reposetup. This uses a slightly
different code path than that patched by D6716674 and double-checks if an extension is enabled. So we need to patch here too.

Reviewed By: quark-zju

Differential Revision: D6758486

fbshipit-source-id: b5bfe2d11e5e2aeb2d3a0ee7c9d6e3e2c213233d
2018-04-13 21:50:53 -07:00
Phil Cohen
b0ad111094 sparse: use relative import
Summary: better!

Reviewed By: quark-zju

Differential Revision: D6760249

fbshipit-source-id: 45b172fe6853983f6e0611104e4fc511d9c73673
2018-04-13 21:50:53 -07:00
Phil Cohen
c7ff97160f share: fix hg unshare
Summary:
This was blocking us default-enabling `fbsparse`; however, this function is actually incredibly fragile and can break with a variety of extensions enabled (even blackbox).

E.g., try this on the latest release and you'll get an exception!

```
cd $(mktemp -d); hg init a; hg share a b; cd b; hg unshare
```

That particular breakage is called by blackbox trying to look at `repo[None]` to do some logging, but anything that tries to read `repo.dirstate` after this will print the exception. The root cause is this line which is trying to override `repo.root`:

```
repo.unfiltered().__init__(repo.baseui, repo.root)
```

It's trying to update the repo's path to indicate that it is independent and no longer shared. But, the initializer isn't really designed to be called twice, AFAICT, and doing so here leaves the property caches out of sync with properties of the repo (namely `_filecache`).

Durham's suggestion was just to nuke `hg unshare`. This patch works around it for now, though, in case we want to keep it alive.

Reviewed By: quark-zju

Differential Revision: D6758397

fbshipit-source-id: 90d3773d9340f2a5b2e6e900a2194d8b931f410d
2018-04-13 21:50:53 -07:00
Phil Cohen
c71baa2944 debugextensions: list default-on extensions as '(default)'
Summary:
...instead of '(untested!)'.

Partly this is necessitated by the `hg debugextensions` call in test-extension.t (post
D6758486). But it also seems like the right thing to do.

Reviewed By: ryanmce

Differential Revision: D6758599

fbshipit-source-id: 3ecfa52b0c9c1a028201d2eda0eaa706d80225c0
2018-04-13 21:50:53 -07:00
Kostia Balytskyi
486bb40de0 sparse: fix tests, broken by D6755971
Differential Revision: D6759900

fbshipit-source-id: 2629abc2b96e948ed69f0d30628d6a9994a19138
2018-04-13 21:50:53 -07:00
Dmitry Zhuk
df266f86b7 fbshow: add whitespace handling to hg show
Summary:
Added options supported by diff:
```
-w --ignore-all-space    ignore white space when comparing lines
-b --ignore-space-change ignore changes in the amount of white space
-B --ignore-blank-lines  ignore changes whose lines are all blank
-Z --ignore-space-at-eol ignore changes in whitespace at EOL
```

Differential Revision: D6738122

fbshipit-source-id: bd4236ce7cb9d5f803f932cfec267de71b0067c2
2018-04-13 21:50:53 -07:00
Alexander Opeykin
b00bfa1fa2 display inifinitepush pull time
Reviewed By: StanislavGlebik

Differential Revision: D6748718

fbshipit-source-id: c1b5b529d1c492017e07a67629d8908bb0d19bb4
2018-04-13 21:50:53 -07:00
Durham Goode
a99b9eb0c2 sparse: add back sparse.py
Summary:
Some consumers still rely on enabling 'sparse=' so let's add a module
that just redirects to the real fbsparse.py.

Also updates configerator to use the newer name.

Reviewed By: markbt, quark-zju

Differential Revision: D6755971

fbshipit-source-id: 3a67f029045dacf927742a616a714fe632b97fea
2018-04-13 21:50:53 -07:00
Jun Wu
97dfe79221 perftweaks: fold isgooddelta tweak into core
Summary:
The isgooddelta tweak was introduced in D2693043 (perftweaks: change revlog
delta heuristic, 2015-11-24).  Comparing with the existing version, the only
change is that we removed `dist > maxdist` check.

Note that the upstream commit 895ecec31 (revlog: add an experimental option
to mitigated delta issues (issue5480), 2017-06-23) also introduces a config
option to override `maxdist` to make the condition fail, which basically does
a same thing.

Instead of introducing new config options or adding more "if"s to the
codebase to make it more obscure, let's just simplify it by disabling the
check entirely, and removing the `dist` concept, removing two config
options: `experimental.maxdeltachainspan` and `perftweaks.preferdeltas`.

The `chainlen > self._maxchainlen` check should be enough for keeping
delta chain length bounded.

Reviewed By: DurhamG

Differential Revision: D6752529

fbshipit-source-id: e8fd8ec39240191db5fb274190fc661e97087a78
2018-04-13 21:50:53 -07:00
Jun Wu
da7f79ac4a run-tests: use --local by default
Summary: Added --rebuild for the old behavior.

Reviewed By: phillco

Differential Revision: D6753296

fbshipit-source-id: 84f26af285662f91bc59db8b2a3145212118a9b6
2018-04-13 21:50:52 -07:00
Jun Wu
0d7d81e0c2 run-tests: make -j use CPU count by default
Summary:
Given the multi-core era, it seems to be a good default to make use of all
available cores. Use `-j 1` to get the old behavior.

Reviewed By: phillco

Differential Revision: D6752704

fbshipit-source-id: 842ddea1d89160eed030fc71ba08024859db9268
2018-04-13 21:50:52 -07:00
Jun Wu
07522dbb4e clindex: enable by default
Summary:
This enables clindex for its nodemap. Verification is turned off by default
for the performance win since we have been running verification in
production for a while.

Reviewed By: phillco

Differential Revision: D6751412

fbshipit-source-id: bc3e87df86e86a758392bdd4aef3e282f397fe04
2018-04-13 21:50:52 -07:00
Jun Wu
7fa918cefd perftweaks: move commit head detection removal logic to core
Summary: Also change the internal API so it no longer accepts the "heads" argument.

Reviewed By: ryanmce

Differential Revision: D6745865

fbshipit-source-id: 368742be49b192f7630421003552d0a10eb0b76d
2018-04-13 21:50:52 -07:00
Liubov Dmitrieva
e1ec40a30f Fix test
Summary: Fix test

Differential Revision: D6749910

fbshipit-source-id: 1eeb12992f6c883af4d66b645dda3f72f771e3dc
2018-04-13 21:50:52 -07:00
Jun Wu
fe0a348d39 perftweaks: move effectflag removal logic to core
Summary: This removes the effectflag logic from both core and perftweaks.

Reviewed By: ryanmce

Differential Revision: D6745769

fbshipit-source-id: 55ed1676e7117bca358471c256805ded7bc83f3c
2018-04-13 21:50:52 -07:00
Jun Wu
2fde5a03f5 lfs: remove duplicated tests
Summary: The tests are landed in core so those tests could be removed.

Reviewed By: ryanmce

Differential Revision: D6745446

fbshipit-source-id: f85c3e7899d4bb24bedb71d84601d7113928a4c4
2018-04-13 21:50:52 -07:00
Kostia Balytskyi
262eba6775 tests_: accept some more recently-introduced test-check failures
Summary: To be fixed later, now I need to test the hgbuild.

Differential Revision: D6748921

fbshipit-source-id: 519555286a43ef7852e37b699e30197c1ad85424
2018-04-13 21:50:52 -07:00
Liubov Dmitrieva
fa4d42e25e add commands 'hg enablebackup' and 'hg disablebackup'
Summary:
infinitepushbackup: add commands 'hg enablebackup' and 'hg disablebackup'
also, output backup status on 'hg sl command' if infinitepushbackup.enablestatus is on
fix 2 unrelated to this feature unit tests

Test Plan:
manually tested
https://phabricator.intern.facebook.com/P58867417

Reviewers: mbthomas, stash

Reviewed By: mbthomas

Subscribers: mitrandir, medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D6688366

Tasks: T24912975

Tags: bootcamp

Signature: 6688366:1516151792:47dc4a247df22b0d9912217e34503ad2fa785622

fbshipit-source-id: b847fd108ad8baaf337efa00ef445d86a64030e1
2018-04-13 13:04:39 -07:00
Jun Wu
19cda85a3a debugshell: enable it by default
Summary:
It's pretty handy. The implementation is simple and clean. So move it from
contrib and enable it by default. "import"s are adjusted to make the module
checker happy.

Security and UX wise, since we have `--debugger` already, adding another
REPL seems fine.

Test Plan: Ran all tests

Reviewers: phillco, #mercurial

Reviewed By: phillco

Differential Revision: https://phabricator.intern.facebook.com/D6741283

Signature: 6741283:1516225662:ddc19a663e7ecef2a1fdaa5041f308dc838a8471
2018-01-17 12:54:24 -08:00
Jun Wu
e81c53461e largefiles: remove the extension
Summary:
`lfs` is the better large file solution. `largefiles` is rarely used, and
its implementation is less clean. So let's remove it.

Test Plan:
Ran all tests. A subrepo test was removed instead of cleaned up since the
longer term plan is to also drop subrepo support.

Reviewers: phillco, #mercurial

Reviewed By: phillco

Differential Revision: https://phabricator.intern.facebook.com/D6740361

Signature: 6740361:1516225594:555e3803571ad05e0434021897a2823ac99347ae
2018-01-17 11:50:44 -08:00
Kostia Balytskyi
62064c1381 hgsubversion: accept some test-check line reshuffles
Summary:
Since we moved some files, these failures changed.

Depends on D6719894

Test Plan: - ./run-tests, see passing

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719911
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
0e5ac2ee76 hgsubversion: drop unneeded run.py
Summary: Depends on D6719906

Test Plan: - test-check cleanup is in the next diff in the stack

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719920
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
6134cd5994 hgsubversion: accept regexed output of comprehensive tests
Summary:
This looks most like a dirty hack in this stack, especially the largest file.
Unfortunately, on my some number of runs it looked like the output is not really
consistent: some lines were `verifying ...` and some `cannot verify ...` inconsistently
over the runs.
Hovewer, given that the `hgsubversion` test suite simply did not care about what
tests printed, I think this is acceptable.


Depends on D6719894

Test Plan: - `./run-tests.py`, see tests passing

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719906
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
f47acc0834 hgsubversion: fixup comprehensive tests imports
Summary:
Here we make imports in `hgsubversion` tests work again.
This consists of two main parts:
1. tests were importing each other as python modules. Now that they have `-` in
their names, it is impossible. However, we can utilize some tricks to work
around this (`imp.load_source`)
2. tests where doing some weird location assumptions, we clean that up


Depends on D6719890

Test Plan: - `./run-tests -l test-hgsubversion-*`, see non-import-exception failures

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719894
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
5a73bf5843 hgsubversion: migrate all the tests to silentrunner
Summary:
This migration allows `./run-tests.py` to run `hgsubversion` tests. Since hgsubversion
tests are actually python unittests, we don't care about their output at all,
they fail differently. But the behavior of the test suite require us to match
whatever the tests prints. We do this later in the stack.

Depends on D6719886

Test Plan: - check that tests are runnable at least

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719890
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
82ca3e620b hgsubversion: rename test_util to test_hgsubversion_util
Summary:
This is in line with our general spirit of renaming things into test-extname-smth.

Depends on D6719883

Test Plan: - test fixes and runs follow in the stack

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719886
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
3cc5c5756c hgsubversion: move tests to the general tests dir
Summary:
Move tests to where we are used to them.

Note that I don't move comprehensive tests to the `tests` directory, since
I think that having them not run when `./run-tests.py` is run without arguments
may be a useful thing. In general, we may adopt this concept for the core as well.
If we decide we do want to move them, it's very easy to do.

Depends on D6719879

Test Plan: - fixups and test runs follow in the stack

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719883
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
72cbcae5a0 hgsubversion: rename tests from test_smth to test-hgsubversion-smth pattern
Summary:
Rename hgsubversion tests to match our tests name patterns.

Depends on D6719877

Test Plan: - just a rename, following diffs do fixups

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719879
2018-01-17 03:23:44 -08:00
Kostia Balytskyi
34dcd51d76 run-tests: add simple regular expression support for .py.out files
Summary:
To incorporate hgsubversion tests into our test suite, we need to turn them into
silentrunner tests, which run python unittests, but do check for the output to match
some expected file. hgsubversion tests were not written with checking output in mind
(and even if they were, .t tests need globbing/regex support as well). So, this
simple support for (re) suffixes on .py.out files allow us to match unstable output.

Test Plan:
- perform some manual experiments
- following diffs in the stack make use of it

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6719877
2018-01-17 03:36:41 -08:00
Phil Cohen
66cb3160e1 sparse: don't materialize sparse files during IMM
There's no need to do this and not doing so speeds up IMM tremendously when the sparse profile had to be adjusted.

(This is the grafted version from the fb-hgext repo)

Test Plan:

I ran an IMM before and after this change. Both succeeded but the later version was
much faster.

Differential Revision: https://phab.mercurial-scm.org/D1805
2018-01-16 17:43:19 -08:00
Durham Goode
41fc137814 tests: fix lint error again 2018-01-16 14:22:33 -08:00
Durham Goode
81c3e03f81 tests: fix lint error in test 2018-01-16 09:25:50 -08:00
Kevin O'Sullivan
fa38fee98f Using a set() for names to remove duplicates before calling bookmarks.delete
Summary: Fixing a bug that causes a fatal crash when a user attempts to delete a bookmark by inputting it's name twice, for example:

# hg bookmark --delete name name
Test Plan: The following test has been added in the test/test-bookmarks.t file
https://pxl.cl/bmTf
 to test the new functionality:

~~~
kosullivan-mbp:hg-crew kosullivan$ hg diff tests/test-bookmarks.t
diff --git a/tests/test-bookmarks.t b/tests/test-bookmarks.t
--- a/tests/test-bookmarks.t
+++ b/tests/test-bookmarks.t
@@ -288,6 +288,10 @@
   abort: bookmark 'A' does not exist
   [255]

+ensure bookmark names are deduplicated before deleting
+  $ hg book delete-me
+  $ hg book -d delete-me delete-me
+
 bookmark name with spaces should be stripped

   $ hg bookmark ' x  y '
~~~
Reviewers: rmcelroy,rafeca
Subscribers: suiting
Tags: python,bootcamp,source_control
Tasks: 22525999
Differential Revision: https://phabricator.intern.facebook.com/D6711774
2018-01-16 15:20:21 +00:00
Kostia Balytskyi
3d0e3ddc15 tests_: don't rebuild the project in test-hghave.t
Summary:
Our new build process is slow because of all the rust and everything. I've seen
test-hghave.t time out a couple of times already.

Test Plan:
- `./run-tests.py -l test-hghave.t` - pass
- `./run-tests.py test-hghave.t` - pass

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6726709
2018-01-16 04:08:46 -08:00