Commit Graph

14844 Commits

Author SHA1 Message Date
Mateusz Kwapich
3547771f16 integration test showcasing current slow bookmarks mover behaviour
Summary:
This binary wasn't covered by any tests before.

Note: For this test I had to allow the mononoke hg sync job to act on bookmark moves
created by tests. I think that's fine (we don't have any in production - if we
had the bundle preprarer would be erroring out on them).

Reviewed By: yancouto

Differential Revision: D35648045

fbshipit-source-id: dae3dd89eeaf3c775e5046518a99b755923aff8a
2022-04-26 05:56:48 -07:00
Lei Shi
4449f2d068 bump up solana crate versions and fix a bunch of related crates
Summary:
allow-large-files

Upgrading async-compression with a patch because they are using old versions of zstd (renamed to libzstd in their dependencies) and zstd-safe

Updated aes-gcm-siv and curve25519-dalek too. Please refer to inline comments. Here is how I pinned the crate:

- git clone the repo
- git checkout the tag
- make changes
- git push -f origin HEAD:master
- use the commit hash and your forked repo to update cargo.toml

Reviewed By: wqfish

Differential Revision: D35585200

fbshipit-source-id: 70c51bf1902c6eaf72004a49bc2be9eaf782e360
2022-04-25 23:16:11 -07:00
Zeyi (Rice) Fan
fc5f91a30e cli: do not start if the current daemon is already starting
Summary:
When EdenFS is starting, `eden start` will attempt to start another EdenFS daemon then it will get a flock error.

On Windows, sometimes we saw a long EdenFS startup process, and this behavior misleads people to think they are not able to start EdenFS.

Reviewed By: xavierd

Differential Revision: D35799954

fbshipit-source-id: 5f58e3ad89962f61d233f962a3e464fe55a9cd8b
2022-04-25 21:36:06 -07:00
Michael Cuevas
e71bd8cb4e add report button to E-Menu
Summary: This menu item will cause a shell to be launched and `eden rage --report` to be run.

Reviewed By: chadaustin

Differential Revision: D35327029

fbshipit-source-id: b17c90386e8beb028848fa3d99927dae3c971add
2022-04-25 16:44:06 -07:00
Michael Cuevas
6e6321099b add report option to eden rage
Summary: This will be used in a later diff to give users a "one click" report option.

Reviewed By: chadaustin

Differential Revision: D35330514

fbshipit-source-id: 0d9f3987d788d21cebc71afc796c252eb71028a3
2022-04-25 16:44:06 -07:00
Jun Wu
6657b4b1e7 blackbox: avoid passing JSON string in APIs
Summary:
The JSON string interface was used when there is no clear way to convert
between a PyObject and a Rust serde-serializable object (blackbox::Event).

Now we can convert between them easily let's avoid the extra JSON round-trip.

Differential Revision: D35236903

fbshipit-source-id: 51cd8028e459f551918777cb572e286cc1d848fe
2022-04-25 13:49:17 -07:00
Jun Wu
93a347394e testing: fix test failures
Summary: Fix test failures detected by testbot.

Reviewed By: sggutier

Differential Revision: D35898780

fbshipit-source-id: 47d323fc84363f3812a7ac85deb97e211f7d174f
2022-04-25 09:14:28 -07:00
Adam Ernst
22c0b32eed Daily arc lint --take BLACK
Reviewed By: zertosh

Differential Revision: D35897556

fbshipit-source-id: 9ae99a4cf8ccc3c6657f4071bde4e224cbab493f
2022-04-25 08:47:01 -07:00
Harvey Hunt
9b18b0d3be mononoke: lfs: Return filestore upload result from internal_upload
Summary:
When uploading content to the LFS server it attempts to store the
content in an upstream server, as well as internal data stores. If either of
those fail, then the upload should be considered a failure and the client
should retry. However, D22192005 (ce7f53422f) refactored the code and accidentally updated
`internal_upload` to always return `Ok(())`.

This meant that a failure to write to the filestore wasn't propagated and so an
upload that actually failed would send an HTTP 200 to the client.
Unfortunately, when the client asks for the blob later the server doesn't know
about it.

Update the code to return `res`, so that errors are propagated.

Reviewed By: krallin

Differential Revision: D35892336

fbshipit-source-id: 5302a34fdd338975e0f0db369ed66692db0ade9f
2022-04-25 05:34:31 -07:00
Pyre Bot Jr
06973c2937 suppress errors in eden
Differential Revision: D35863280

fbshipit-source-id: 0c9b160cccfbcb77e9ec3ffb8df8bdbe804d1e3b
2022-04-22 23:52:26 -07:00
Jun Wu
523fd16864 revert: fix revert a dir to a file
Summary: As the title suggests.

Differential Revision: D35848458

fbshipit-source-id: a83d0843fcc9e26194e9b5a9a184d25a5ea94c66
2022-04-22 20:28:20 -07:00
Jun Wu
d2dea32e60 testing: add high-level documentation
Summary:
`testing` is non-trivial. Add some documentation to make it easier to
understand.

Differential Revision: D35118756

fbshipit-source-id: dad59472d849eb80e230a83403e8c6af48137e6c
2022-04-22 19:35:57 -07:00
Jun Wu
ec96f1fa19 test-ctrl-c: fix debugruntest compat
Summary: `disown` is not implemented. Use `wait` instead.

Reviewed By: LynBusch

Differential Revision: D34915626

fbshipit-source-id: cbf9819b7df9a57995129bb88df04b830cd6b6f6
2022-04-22 19:35:57 -07:00
Jun Wu
523acf1c13 test-commitcloud-sync-race: fix debugruntest compat
Summary:
It seems certain bundle part is occured twice, triggering double output for
something. I didn't trace down as we plan to migrate away from unmaintainable
bundle2 stdio exchange.

For now just make the test compatible with both runners and we can revisit
later when we remove the bundle2/sshpeer techdebt.

Reviewed By: LynBusch

Differential Revision: D34915624

fbshipit-source-id: c2d53050a14ceb56d89bd0c1831f9ab32caf2e4d
2022-04-22 19:35:57 -07:00
Jun Wu
a80dad4ebe test-commit-interactive-curses: fix debugruntest compat
Summary:
Avoid `ui.load()` in debugpython. That's known problematic. Use `ui` and `repo`
provided by `debugshell` instead.

Reviewed By: LynBusch

Differential Revision: D34915618

fbshipit-source-id: 2ca393996318b2479c3996e98d4a5695b648356c
2022-04-22 19:35:57 -07:00
Jun Wu
cacbbaece3 test-contrib-check-code: fix debugruntest compat
Reviewed By: DurhamG

Differential Revision: D34915622

fbshipit-source-id: c200baca968dc3e8b4b1c0dcb912abb544fd0753
2022-04-22 19:35:57 -07:00
Jun Wu
18f343bc94 test-config: fix debugruntest compat
Summary:
TestTmp uses a slightly different hgrc name: `hgrc` instead of `.hgrc`.
Just do not check the filename.

Reviewed By: DurhamG

Differential Revision: D34915625

fbshipit-source-id: 66f3f734bd47e5abaf6490b8a0bfefb6e3afc394
2022-04-22 19:35:57 -07:00
Jun Wu
28b6c8c0d3 test-config-configfile: fix debugruntest compat
Reviewed By: DurhamG

Differential Revision: D34915621

fbshipit-source-id: 617f786eb63ddcc1bb14804309f35cb40ba31c5a
2022-04-22 19:35:57 -07:00
Jun Wu
1fedde044c tests: require mkfifo binary explicitly
Summary: This makes affected tests work with debugruntest.

Reviewed By: DurhamG

Differential Revision: D34915627

fbshipit-source-id: dfa2d19c0291854f9bd3de123edd38e5c3d06bef
2022-04-22 19:35:57 -07:00
Jun Wu
9f78b2b3ec tests: avoid 'ls -l' and 'cut -c'
Summary:
Tests use `ls -l` for 2 purposes:
- Check file mode - also need `cut -c`
- Check symlink target
Use `f` and `f -m` instead for compatibility with debugruntest.

Reviewed By: DurhamG

Differential Revision: D34872629

fbshipit-source-id: 17277b9f495b8f62e28e53af9efae8084f572ec8
2022-04-22 19:35:57 -07:00
Jun Wu
985c9d0a8c test-fb-hgext-pushrebase: remove test case pushing to bundle repo
Summary: Pushing to bundle repo is no longer used in production.

Reviewed By: DurhamG

Differential Revision: D34872631

fbshipit-source-id: e7eb91fd818f67c0085b2971d3fe5aae04371547
2022-04-22 19:35:57 -07:00
Jun Wu
2c071b74e7 test-commit-multiple: fix debugruntest compat
Summary: `\` in heredoc for multi-line escaping is unsupported in debugruntest.

Reviewed By: DurhamG

Differential Revision: D34871318

fbshipit-source-id: 18e93a0fe8a367993c8170031c9bbc41211f3ca4
2022-04-22 19:35:57 -07:00
Jun Wu
dd996ca7d5 test-commit: fix debugruntest compat
Summary: `<(echo foo)` is not supported. Use a temp file instead.

Reviewed By: DurhamG

Differential Revision: D34870111

fbshipit-source-id: dc21a4e14ed96dcb202a566ddff4b03ee3b938bc
2022-04-22 19:35:57 -07:00
Jun Wu
75e8f40df3 test-annotate: support debugruntest
Summary:
`sed 's/3+/3-/'` treats `+` as a literal while the shinterp stdlib treats
it as part of regex.

Avoid the issue by using `s/3[+]/3-/` that work in both `sed` impelemntations.

Reviewed By: DurhamG

Differential Revision: D34840516

fbshipit-source-id: f20648afa76f7233cee40781bb1af2fd976bdbb0
2022-04-22 19:35:57 -07:00
Jun Wu
5b26e0fb35 test-basic: fix debugruntest compatibility
Summary:
The `hg debugpython -- ./update_to_rev0.py` uses the `util.mainio` which
escapes the `sys.stdout` capturing. Silent it so it's compatible.

Skip the `hg log -r tip 0<&-` test. In the shinterp world adding a `None` stdin
concept would be too much work.

Reviewed By: DurhamG

Differential Revision: D34840379

fbshipit-source-id: bb8ae7bd4f7761af93face27dc94c2d2ba1f63ff
2022-04-22 19:35:57 -07:00
Jun Wu
5313b563ee test-archive: fix debugruntest compatibility
Summary: Require executables explicitly.

Reviewed By: DurhamG

Differential Revision: D34840374

fbshipit-source-id: af7efde124fbd49a07a6898a5ecb369105f61bb8
2022-04-22 19:35:57 -07:00
Jun Wu
ba76194484 test-archive-symlinks: fix debugruntest compatibility
Summary: Require executables explicitly.

Reviewed By: DurhamG

Differential Revision: D34840373

fbshipit-source-id: 78265b498af5352c390c0f9bcd41f306db35cba5
2022-04-22 19:35:57 -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
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