Commit Graph

20 Commits

Author SHA1 Message Date
Jun Wu
00ecfbb16c tests: opt-in new test runner for passing tests
Summary:
A lot of tests are passing with the new test runner.

This is done by `./edit-feature-header.py debugruntest` and paste
the `Passed:` section from `hg debugruntest -v test-*.t` output.

Note: some tests fail with this but pass with debugruntest. They
will be investigated as follow-up.

Differential Revision: D34931992

fbshipit-source-id: 99abc3d9800bb1dd3487dbfa15d715c0bd3ba878
2022-08-16 14:59:23 -07:00
Jun Wu
bbf7a7463a smartlog: use sort(topo) revset to sort nodes
Summary:
Now the sort(topo) have similar policy with the smartlog algorithm
(see D35588644 (fadc4e777f) and D35588648 (970e074955)) to beautify the graph, let's just use the
`sort(topo)` in smartlog.

Reviewed By: DurhamG

Differential Revision: D37932746

fbshipit-source-id: 1b73ed8212659def9462c94c0f03d81dd1be24e5
2022-07-18 16:38:26 -07:00
Jun Wu
8cbeaedce2 test-commitcloud-backup-status: fix debugruntest compatibility
Summary: Use `$((...))` instead of `expr`.

Reviewed By: DurhamG

Differential Revision: D34840380

fbshipit-source-id: a29cae62c290d6b386c67c93505cc0fffef9b41f
2022-04-22 19:35:57 -07:00
Jun Wu
06b3283905 commitcloud: do not crash on revsets if paths.default is not set
Summary:
If paths.default is missing (ex. an `hg init` or a git repo), the commitcloud
revset (and `hg sl` using it) crash like:

  Traceback (most recent call last):
    File "edenscm/hgext/commitcloud/__init__.py", line 241, in _smartlog
      status.summary(repo)
    File "edenscm/hgext/commitcloud/status.py", line 68, in summary
      unbackeduprevs = repo.revs("notbackedup()")
    File "edenscm/mercurial/localrepo.py", line 1409, in revs
      return m(self, subset=subset)
    File "edenscm/mercurial/revset.py", line 2799, in mfunc
      return getset(repo, subset, tree, order)
      # order = 'define'
      # subset = <fullreposet+ []>
    File "edenscm/mercurial/revset.py", line 105, in getset
      return methods[x[0]](repo, subset, *x[1:], order=order)
      # order = 'define'
      # subset = <fullreposet+ []>
    File "edenscm/mercurial/revset.py", line 359, in func
      return func(repo, subset, b)
      # subset = <fullreposet+ []>
    File "edenscm/hgext/commitcloud/__init__.py", line 318, in notbackedup
      heads = backupstate.BackupState(repo, ccutil.getremotepath(repo.ui)).heads
    File "edenscm/hgext/commitcloud/util.py", line 71, in getremotepath
      path = ui.paths.getpath("default")
    File "edenscm/mercurial/ui.py", line 1890, in getpath
      raise error.RepoError(_("repository %s does not exist") % name)
      # name = 'default'
  Traceback (most recent call last):
    File "edenscm/mercurial/ui.py", line 1883, in getpath
      return self[name]
  KeyError: 'default'

Avoid that by detecting the empty path and just return empty sets.

Differential Revision: D33197621

fbshipit-source-id: fb5676a7f7be4937328d487824c6d5ee0b18fc59
2021-12-17 15:07:46 -08:00
Jun Wu
e41d5cd495 changegroup: drop "added x changesets with y changes to z files" message
Summary:
Our current `hg pull` in production typically shows:

  % hg pull
  pulling from mononoke://...
  connected to ... session ...
  imported commit graph for ... commits (1 segment)

There is no "added x changesets ..." message. Drop it from tests.

This also makes it easier to migrate tests to remotefilelog repos, since
with remotefilelog it will show "0 changes to 0 files".

Differential Revision: D32570597

fbshipit-source-id: aa660e2cbd9bc07caa74f0126e152589b08e5c57
2021-12-14 22:16:15 -08:00
Muir Manders
76a2b37cf3 lock: replace util.islocked with lock.islocked
Summary:
util.islocked function operated directly on a file name, which is peeking too far into the locking abstraction. Instead, replace with new function lock.islocked that uses the normal locking API to determine if a lock is taken. This minor change makes it easier to switch to a rust lock implementation.

I had to reintroduce a flag to skip the deadlock check since islocked tries to acquire a lock that might already be held (on purpose).

One existing user of util.islocked did not have a vfs object available, so I just removed it since it was only used for some debugging output.

Reviewed By: quark-zju

Differential Revision: D31963496

fbshipit-source-id: 67e68909519a789ed9b4f20f60d30c090ee8d3f8
2021-11-05 10:00:18 -07:00
Liubov Dmitrieva
055afa0ca2 modernise tests by using moder newserver function
Summary:
modernise tests by using moder newserver function

the function is shorter and it will also allow us to run the tests with Mononoke in the future

Reviewed By: yancouto

Differential Revision: D30773102

fbshipit-source-id: 994cbcfb2688aef3e96446e1cb021db72bc70c67
2021-10-06 08:14:05 -07:00
Durham Goode
e9e0539cc1 filepeer: disable use of filepeer by default
Summary:
We want to remove filepeer as part of removing server logic in the
client. To start with, let's disable it by default and only enable it in tests
that need it. The next step will be to update those tests.

Reviewed By: quark-zju

Differential Revision: D30977765

fbshipit-source-id: c56016f017e894a15bf43fb7a8d3a0a417663ad9
2021-09-22 18:03:29 -07:00
Liubov Dmitrieva
a1dd7229e6 dynamic config: remove unnecessary option from the dynamic config
Summary: this infinitepush option is true by default

Reviewed By: DurhamG

Differential Revision: D25995928

fbshipit-source-id: 0c1d50a96dc16ee4d8c45da4f4a213baa49bb8a4
2021-01-22 06:24:23 -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
Jun Wu
026bd9f950 tests: avoid some rev numbers in revsets
Summary: Done by the fix-revnum.py script.

Reviewed By: singhsrb

Differential Revision: D24173575

fbshipit-source-id: e4cf417be759f9898adfd4102984098474ab38a2
2020-10-08 11:08:37 -07:00
Jun Wu
1ce0eea5dc tests: remove some uses of rev numbers in templates
Summary: Done by `sed`.

Reviewed By: singhsrb

Differential Revision: D24173576

fbshipit-source-id: f1d042b3da7f9b64e0e40b19317364e5cb9ae946
2020-10-07 21:22:58 -07:00
Durham Goode
490468403b treemanifest: fix bundle usage with Rust contentstore
Summary:
The rust contentstore doesn't allow runtime manipulation of the list of
stores, which is required in order to insert the bundle store into the store.
Let's continue using the old python union store in these cases. This still let's
us delete the python pack code later, but we'll have to keep around the python
union store until we come up with a better solution.

Reviewed By: quark-zju

Differential Revision: D23689630

fbshipit-source-id: 0c60e6f268e81804149afa24409f64b5303e1e34
2020-09-24 09:46:59 -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
Jun Wu
01e3ea0f8f tests: enable narrow-heads for test-[bc]*
Summary: Most of them need extra server-side bookmarks for deciding phases.

Reviewed By: DurhamG

Differential Revision: D22117739

fbshipit-source-id: 711bf96063913fd6148125a5628f0b0f4efbf489
2020-06-29 13:53:04 -07:00
Durham Goode
54484268fb py3: more commit cloud fixes
Summary:
Notably, we drop all the encoding business when dealing with json
objects, and instead use mercurial.json.

Reviewed By: sfilipco

Differential Revision: D19888130

fbshipit-source-id: 2101c32833484c37ce4376a61220b1b0afeb175a
2020-02-28 11:32:16 -08:00
Jun Wu
ae8f6ff8e8 tests: opt-in DUMMYSSH_STABLE_ORDER for more tests
Summary: This should help reduce test flakiness.

Reviewed By: xavierd

Differential Revision: D19872952

fbshipit-source-id: d66f6c404534b3f47903b478e3cdfdda5ed46284
2020-02-27 17:54:08 -08:00
Zeyi (Rice) Fan
92f6f35e7a mark all tests requiring Python 2
Summary:
This diff marks **ALL** mercurial tests requiring Python 2 feature.

After you fixes some tests, simply remove the `py2` feature requirement and that tests will be continuously run after your diff is landed.

To bypass this feature requirement, run the tests command with `HGTEST_FORCE_PY2=1`. For example:

```
HGTEST_FORCE_PY2=1 buck test //eden/scm/tests:hg_run_tests
```

or

```
HGTEST_FORCE_PY2=1 python run-tests.py
```

----

Basically this diff are created with the following commands:

```
$ sed -i 's/import feature\(.*\)$/import feature\1\n\nfeature.require(["py2"])/' test-*-t.py
$ sed -i '1s/^/#require py2\n/' test-*.t
$ ls | grep -P "^test.*(?<\!-t)\.py$" > list && vim -p $(cat list)
# manually adding feature requires for these Python tests.
```

(Note: this ignores all push blocking failures!)

ignore-conflict-markers

Reviewed By: singhsrb

Differential Revision: D19655148

fbshipit-source-id: 985e3ccb4010cc559049f1d89f8909bc2d9b5e20
2020-01-30 18:49:21 -08:00
Jun Wu
75a8173a10 tests: enable chg for 572 tests
Summary:
Add `#chg-compatible` to 572 tests that seem to pass with chg enabled.
This should make them run faster.

Reviewed By: xavierd

Differential Revision: D18870507

fbshipit-source-id: fe895e733efffc9286cd3d17c7a156c803124395
2019-12-09 15:26:29 -08:00
Adam Simpkins
ab3a7cb21f Move fb-mercurial sources into an eden/scm subdirectory.
Summary:
In preparation for merging fb-mercurial sources to the Eden repository,
move everything from the top-level directory into an `eden/scm`
subdirectory.
2019-11-13 16:04:48 -08:00