Commit Graph

73385 Commits

Author SHA1 Message Date
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
e05bfbd7af hghave: define features for common executables
Summary:
Define hghave for cmp dd diff gunzip gzip mkfifo tar umask unzip.
So they can be checked before using.

Reviewed By: DurhamG

Differential Revision: D34840382

fbshipit-source-id: c180a8cdc3d6c039606e60ff133e34ff5f8f4c11
2022-04-22 19:35:57 -07:00
Jun Wu
e5abe880da testing: require executables from hghave features
Summary:
This makes `#require git` or `#if git` require `git` executable, if the test
result is True.

Reviewed By: DurhamG

Differential Revision: D34835692

fbshipit-source-id: 028dc90ffb9b73a3193897bdd127873c7049bec5
2022-04-22 19:21:32 -07:00
Jun Wu
527b78bc7c hghave: label features that are also executables
Summary:
debugruntest requires explicit external executables.

Some hghave features (ex. git, jq) are external executables.
Track them explicitly to declare dependencies.

Reviewed By: DurhamG

Differential Revision: D34835694

fbshipit-source-id: def0c19fe82babc8391f33d60c4abace33561671
2022-04-22 19:21:32 -07:00
Jun Wu
a43a16c471 test-cat: fix debugruntest compatibility
Summary:
The `find` implemenation in shinterp does not show dot files.
Matching coreutils `find` would mean abandoning the convenient
`glob.glob` for this special case. So I went ahead just changing
the file name.

Reviewed By: DurhamG

Differential Revision: D34835688

fbshipit-source-id: 64abeefe99f7befd671280f87609e37ecc00f091
2022-04-22 19:21:32 -07:00
Jun Wu
07914c4bb1 test-walk: glob:\* -> 'glob:*'
Summary:
This makes it compatible with debugruntest.

Fixing it in shinterp properly seems too complex (ex. InterpResult might need
"hold" information per character, to handle things like `foo\**`) so I just
give up for now.

Reviewed By: DurhamG

Differential Revision: D34835696

fbshipit-source-id: e8f114ebae7bba1afbd0c14e9fcdf1b0a97f3a9e
2022-04-22 19:21:32 -07:00
Jun Wu
f9d48d2680 testing: add sleep to shell builtin
Summary:
`sleep` is commonly used. Implement it.

While `foo &; sleep n` is fragile. `sleep 1` is useful without `foo &`
to get stable output for some `status` checks (see comments in
invalidatemtime in pytreestate for details).

Reviewed By: DurhamG

Differential Revision: D34835697

fbshipit-source-id: 6c766bae8ecc9a9419415207eb9f55036464c8e2
2022-04-22 19:21:32 -07:00
Jun Wu
3a4a949986 test-diffstat: avoid using expr
Summary:
The loop could be written as `for i in $(seq 213)` or use `i=$((i+1))`
instead of expr. But let's just use Python to calculate `"a\n" * 213`
so the file isn't opened 213 times.

This makes the test compatible with debugruntest.

Reviewed By: DurhamG

Differential Revision: D34835689

fbshipit-source-id: 3811c23054c6bcddff9888bb7f61cbf9216a0783
2022-04-22 19:21:32 -07:00
Jun Wu
1baa7d7d25 tests: replace md5sum.py with f --md5
Summary: This simplifies the tests and make them more compatible with debugruntest.

Reviewed By: DurhamG

Differential Revision: D34835698

fbshipit-source-id: 3c3a49984bad78c536f1fc683f25360e26b75730
2022-04-22 19:21:32 -07:00
Jun Wu
5dfafd3aa0 tests: replace readlink.py with f
Summary: This simplifies the tests and make them more compatible with debugruntest.

Reviewed By: DurhamG

Differential Revision: D34835687

fbshipit-source-id: 2d42b620ad69372b6482ac64bff2f626da7e7842
2022-04-22 19:21:32 -07:00
Jun Wu
3a49ee9296 testing: expose the 'f' utility
Summary:
The 'f' utility is used in a couple of tests.
Provide it in hg test environment.

Reviewed By: DurhamG

Differential Revision: D34835699

fbshipit-source-id: 8de65f653fccf3717ab5c0d9a45dee6936bb645d
2022-04-22 19:21:32 -07:00
Jun Wu
8df6b9120d tests: pyfmt the 'f' utility
Summary: pyfmt it so changes can be formatted too.

Reviewed By: DurhamG

Differential Revision: D34835691

fbshipit-source-id: 97e31c5e0b514ec6651cb8e670473535db2a6802
2022-04-22 19:21:32 -07:00
Jun Wu
f6a556ee7b test-mutation-infinitepush: disable with debugruntest
Summary:
For some reason, the `hg up tip` triggers a ssh server and hangs
if run by debugruntest. Let's skip it with debugruntest for now.

Reviewed By: DurhamG

Differential Revision: D34835690

fbshipit-source-id: 18b3c2a875f825022a0f4c1d3d36bc947a196721
2022-04-22 19:21:32 -07:00
Jun Wu
48d37319c6 set HGEXECUTABLEPATH in tests
Summary:
This is used by hg to decide the path to the "hg" binary. Without this, `hg`
will just use `argv[0]` for its binary path, which is okay if `hg` installed
but problematic when running tests where the hg binary is `hg.sh` that has
extra logic before `exec`-ing the `hg_rust` binary.

In theory we could also use `HG_REAL_BIN` but that's a telemetry wrapper
concept not existed in stock hg.

This fixes the `HgPrefetch.test` because D34835693 (f42faf1c64) made it run `util.hgcmd()`
directly - without `HGEXECUTABLEPATH`, it runs the `hg_rust` without
`PYTHONPATH` set and crash.

Reviewed By: chadaustin

Differential Revision: D35860447

fbshipit-source-id: 9abbd64327c50ef351ff05f99bbf1da3f8740332
2022-04-22 19:19:56 -07:00
Jun Wu
7bd47bf1e0 test-amend-userstack: avoid "\*" in glob patterns
Summary: This makes it pass with debugruntest.

Reviewed By: DurhamG

Differential Revision: D34835686

fbshipit-source-id: 4f0c087fdfe9e3464412ecf5be5556b40f67da8b
2022-04-22 19:18:56 -07:00
Jun Wu
88b76e2263 testing: add tee to shell builtin
Summary: `tee` is used by some tests. Implement it.

Reviewed By: DurhamG

Differential Revision: D34790217

fbshipit-source-id: 7f62bde41da5520c158889ac09b659f7e7b47ba5
2022-04-22 19:18:56 -07:00
Jun Wu
25bcb70342 testing: make autofix preserve glob lines
Summary:
One of the problem of autofix is it rewrites "(glob)" lines with non-glob
version. Let's try to make it smarter to preserve the "(glob)" lines.

Reviewed By: DurhamG

Differential Revision: D34790206

fbshipit-source-id: 0bb14f8569a55393165c8fe579f09d43aa98f0bc
2022-04-22 19:18:56 -07:00
Jun Wu
fc8d7c56c0 test-paths: with => With
Summary:
"with foo:" is valid Python code. Use "With" to make it a comment.
This makes the test pass with debugruntest.

Reviewed By: DurhamG

Differential Revision: D34790214

fbshipit-source-id: cab47466af306731d23476c6562eaf743d990781
2022-04-22 19:18:56 -07:00
Jun Wu
d749ea574b test-committer: drop unused 2>&1
Summary: This makes it run under debugruntest.

Reviewed By: DurhamG

Differential Revision: D34790203

fbshipit-source-id: 034995f0c36bf0ef014d83a2d215819b8792752c
2022-04-22 19:18:56 -07:00
Jun Wu
4a9ca94170 testing: add sh to shell builtin
Summary:
`sh foobar.sh` is commonly used in tests as HGEDITOR or something. Implement
it.

Reviewed By: DurhamG

Differential Revision: D34790210

fbshipit-source-id: 5a16e6ddde7c9943330aa7f2ab894409977e5bb9
2022-04-22 19:18:56 -07:00
Jun Wu
33c92ec637 testing: add find to shell builtin
Summary: `find` seems commonly used. Implement a subset used in tests.

Reviewed By: DurhamG

Differential Revision: D34790204

fbshipit-source-id: cc3dda137d981ab1969b833bd45ce7d4ed2f7a58
2022-04-22 19:18:56 -07:00
Jun Wu
71ea6ed7fd testing: add sort to shell builtin
Summary: `sort` seems commonly used too. Implement it.

Reviewed By: DurhamG

Differential Revision: D34790205

fbshipit-source-id: 21c5d009348bec14ea2ee0821ba83c1749bd7afc
2022-04-22 19:18:56 -07:00
Jun Wu
ad8f9bb3cd debugruntest: support stdlib doctest
Summary:
Python stdlib doctest is conceptually similar to what debugruntest
does - run code, check output. By adopting it in debugruntest,
we get the handy autofix feature for free, which is very handy
for files like `testing/t/transform.py`.

The Python doctest requires a Python module as the "starting point".
`doctest:<module name>` is added as a special syntax to indicate
this is a doctest.

A special case is added for edenscm/ source code. Python files will
automatically turn into doctest for convenience.

Reviewed By: DurhamG

Differential Revision: D34725126

fbshipit-source-id: 91b78505708ad930f7688cc3e51e53a94d9030e9
2022-04-22 19:18:56 -07:00
Jun Wu
f9383a79a1 test-amend-to: avoid 'echo -e'
Summary:
'echo -e' is only used in this test. Avoiding it makes it pass with the new
test runner.

Reviewed By: DurhamG

Differential Revision: D34790211

fbshipit-source-id: 065853ea953a41294fe631cd0e1d77f64f2c9f05
2022-04-22 19:18:56 -07:00
Jun Wu
48d1fc75ec codemod: replace $TESTDIR/seq.py with seq
Summary:
From https://www.mercurial-scm.org/repo/hg/rev/f554f89a2038 it seems
the `seq.py` is for OS X <= 10.10 compatibility. We don't care about
such old systems so let's just use the standard seq. This also improves
test performance and compatibility with the new Python .t runner.

Reviewed By: DurhamG

Differential Revision: D34790216

fbshipit-source-id: 38dcc8d671773725784c9f774c0a6f8fc2239b46
2022-04-22 19:18:56 -07:00
Jun Wu
e966676ab1 tests: mark test-progressfile* as incompatible with new .t runner
Summary:
`syncrender()` hangs forever with the new test runner.
I haven't figured out why. Let's just mark them as incompatible for now.

Reviewed By: DurhamG

Differential Revision: D34790209

fbshipit-source-id: 306b8da8512d8f86e98b21546774b118a2240632
2022-04-22 19:18:56 -07:00
Jun Wu
ab9029c6bc hghave: add debugruntest feature
Summary:
This allows tests to have parts that are incompatible with one of the
test runners.

Reviewed By: DurhamG

Differential Revision: D34725125

fbshipit-source-id: c2639e059011276a160c1c141ae1c3dccc65bd8e
2022-04-22 19:18:56 -07:00
Xavier Deguillard
c427d4618a inodes: remove check for EDEN_HAVE_HIVE_LOGGER
Summary:
When this is not defined, the IHiveLogger passed to the constructor will be
initialized with the NullHiveLogger, thus we can use it to initialize the
FsEventLogger.

Reviewed By: genevievehelsel

Differential Revision: D35855147

fbshipit-source-id: 8a58934327ec866c94c6aa0dbe114dd86af382f4
2022-04-22 18:46:09 -07:00
Xavier Deguillard
1091be0a63 integration: add the streaming get_thrift_client
Summary:
This will be used to validate the behavior of the streamChangesSince API in
integration tests.

Reviewed By: chadaustin

Differential Revision: D35817806

fbshipit-source-id: 42ee1936c0d7ee4f1574642fa11870b7fa7bdb6c
2022-04-22 18:22:42 -07:00
Xavier Deguillard
d4c8c764ac integration: rename get_thrift_client to get_thrift_client_legacy
Summary:
This makes it consistent with the naming in the CLI, and will allow introducing
a get_thrift_client for streaming APIs.

Reviewed By: genevievehelsel

Differential Revision: D35767106

fbshipit-source-id: deb45090875b0366111e16e27abba22858b8f370
2022-04-22 18:22:42 -07:00
Xavier Deguillard
341684d8cc service: use folly::CancellationToken for diff cancellation
Summary:
We were previously using some internal Thrift datastructure to see if the
connection had been closed. Let's instead use a folly::CancelletionToken to
decouple ourself from Thrift in core EdenFS. This also allows use to test more
easily that cancellation works as intended, and to remove the need to override
the async_tm_ Thrift handlers.

Reviewed By: chadaustin

Differential Revision: D35663202

fbshipit-source-id: a9dbbdcd6cfc1694912b9d72dada443f0338a434
2022-04-22 18:22:42 -07:00
Xavier Deguillard
2319160852 store: remove servicerouter dependency from HgBackingStore
Summary:
It appears to be completely unused, and thus we do not need it. We still depend
on servicerouter via the backinstore crate (due to memcache), so this change
alone doesn't provide any benefits.

Reviewed By: fanzeyi

Differential Revision: D35853731

fbshipit-source-id: 2d815a75430a5742dc647855370b0f594b34f05a
2022-04-22 16:15:15 -07:00
Zeyi (Rice) Fan
0c2400bdd2 cli_rs: let eden status report health info
Summary:
The Rust edenfsctl status didn't know to report about EdenFS server status. This diff fixes that.

This way our user should be able to tell EdenFS is not doing anything but busy starting in the background.

Reviewed By: xavierd

Differential Revision: D35797156

fbshipit-source-id: 4f10073e382b8d9c4deb09690e16530e57ee70fd
2022-04-22 15:21:15 -07:00
Michael Cuevas
91b6afcfd1 Back out "eden/{integration, fs, facebook}: switch to platform010"
Reviewed By: chadaustin

Differential Revision: D35850816

fbshipit-source-id: 282c06fbf7cc249030ae0173779722175c662133
2022-04-22 14:52:01 -07:00
Carolyn Busch
7e3c3f35ac clone: override --config options
Summary: Currently configs passed in by --config get overwritten in the repo init dynamic config generation, though they should take top precedence. Add option to repo init to override configs after dynamic config generation. Move --config flag parsing logic from dispatch to ConfigSet, so it can be reused by the clone command.

Differential Revision: D35796863

fbshipit-source-id: 994fa5eaba8442504605f069b17b984fe92b6c54
2022-04-22 13:08:33 -07:00
Carolyn Busch
6676d5edbb clidispatch: add command template with global opts
Summary: The clone command needs the configfile and config options from the global command options in order for the configs to not be overwritten by dynamicconfig generation. Add a command template that makes the global options available and use them in the clone command.

Differential Revision: D35796075

fbshipit-source-id: 57ee261dfd37db3bc0d07c3e6f91694bd76ca3c7
2022-04-22 13:08:33 -07:00
Jun Wu
652f10e1ab test-doctest: limit testing tests to linux
Summary:
They are having issues on MacOS and Windows (test-doctest.t was blocklisted on
Windows).

Reviewed By: DurhamG

Differential Revision: D35851397

fbshipit-source-id: 4bbef1a581e9b1958b7dc32d7949630a3afb3571
2022-04-22 10:50:43 -07:00
Xavier Deguillard
dd8532a175 integration: increase pexpect_spawn timeout
Summary:
The restart tests have started failing recently due to various timeouts. The
root cause is well understood to be caused by an increase in the dependency
graph of EdenFS. Let's increase the timeout while we figure out a way to
decrease the dependencies.

Reviewed By: genevievehelsel

Differential Revision: D35829901

fbshipit-source-id: d7e03ea68308b9eb36e3584d3c073b41378a78de
2022-04-22 10:46:34 -07:00
Yan Soares Couto
72ea20ab37 Abstract DM id from ChangesetPathHistoryContext
Summary:
**Context:** I want to allow config changes to decide between DMv1 and v2, so I need to make usages more generic.

This diff makes it so `ChangesetPathHistoryContext` doesn't actually store any deleted manifest ids, and instead work with futures that resolve directly to the linknodes.

This makes it easier for us to use this class with DMv2, without need wrapper types around ids.

This also makes things slightly faster on repeated calls, as it caches the whole linknode, not just the id to then load the linknode from.

Reviewed By: mitrandir77

Differential Revision: D35779796

fbshipit-source-id: def93a62974cdfe02fd5e40c1c29ec49274c91ce
2022-04-22 08:36:07 -07:00
Simon Farnsworth
df060bde58 Prevent history cycles in mutable renames
Summary:
Making blame work in the presence of history cycles is non-trivial to get right, and my efforts have led to repeated infinite loops in SCS.

Simply banning cyclic history removes the problem - for now, use an approximation to get it right quickly, and make the problem go away.

Note that the test tests for cases that could be made to work - I hope that this is sufficient that code review will catch badly thought through efforts to make the check precise.

Reviewed By: yancouto

Differential Revision: D35810936

fbshipit-source-id: 19f5f3221d36e6c4270748495dd7de6d45e61ff8
2022-04-22 06:33:27 -07:00
CodemodService Bot
72d9754f6c Daily common/rust/cargo_from_buck/bin/autocargo
Reviewed By: krallin

Differential Revision: D35839834

fbshipit-source-id: 82de4f272b87aabf1a325bf833024fa03e068f26
2022-04-22 04:23:28 -07:00
Jan Mazur
4ddee98a7c specify git commit or branch that will be merged into repo explicitly
Summary: This now merges given commit, but moves bookmark in the destination repo almost arbitrarily. The bookmark move is used primarily so other tools of ours like tailers (and phabricator) process commits slowly ini batches.

Reviewed By: mitrandir77

Differential Revision: D35600879

fbshipit-source-id: a618006ebf14df413449acf0e8f5aabb11ade3ee
2022-04-22 01:35:36 -07:00
Pyre Bot Jr
3ce6503853 suppress errors in eden
Differential Revision: D35832325

fbshipit-source-id: 4d21bb784deec80880bbc304daa5bd120548a58f
2022-04-21 22:18:44 -07:00
Durham Goode
e0080a1169 testlib: add basic working copy checkout support
Summary: Allows wc.checkout(...)

Differential Revision: D35686069

fbshipit-source-id: 9e28a89d8b5ffd0371a988c171718090e57a1ab6
2022-04-21 19:06:14 -07:00
Durham Goode
6094d6ddd1 testlib: add basic status support
Summary: Adds functions for getting the working copy status and commit status.

Differential Revision: D35685522

fbshipit-source-id: a4527b7e3254e0c755b0c2d62c1d2f9c6596ea88
2022-04-21 19:06:14 -07:00
Durham Goode
51a527b7b3 testlib: adds drawdag support
Summary: Adds a drawdag function for easily creating a repository.

Differential Revision: D35683763

fbshipit-source-id: 23d9faa28b4519b13bca07a029169043bc84eece
2022-04-21 19:06:14 -07:00
Durham Goode
d3df270dff testlib: add basic bookmark read functionality
Summary: Adds simple functions for reading the bookmark state from a repository.

Differential Revision: D35683767

fbshipit-source-id: c95ea25002e9ed95c35cb4ee8b57898198ae8d3f
2022-04-21 19:06:14 -07:00
Durham Goode
075ee791f5 testlib: add basic commit functionality
Summary:
Adds the ability for the working copy to make a commit, and a basic
Commit abstraction for accesing commit data.

Differential Revision: D35683765

fbshipit-source-id: f2ae6ebe8f03c98f40869a537fe2f191d4394b55
2022-04-21 19:06:14 -07:00
Durham Goode
98472dbb33 testlib: add basic working copy manipulation functions
Summary: Adds basic helpers for adding and removing files from the working copy.

Differential Revision: D35683768

fbshipit-source-id: 3fd4746222f53729eefd19a5d9833ae7ee4773d4
2022-04-21 19:06:14 -07:00
Durham Goode
07fc735743 testlib: set production configs during setup
Summary:
One of the goals of the new test framework is to run tests with mostly
production configuration. Let's add the appropriate configs to the global hgrc
during test setup.

In the medium term we should get rid of this hard coded list and use
dynamicconfig to generate configs for the tests. But for now let's go with the
hard coded list.

The configs were mostly copied from library.sh a tinit.sh.

Differential Revision: D35683766

fbshipit-source-id: d802066bc801165f361c3418d51ae0e9181629c2
2022-04-21 19:06:14 -07:00