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
Summary:
`testing` is non-trivial. Add some documentation to make it easier to
understand.
Differential Revision: D35118756
fbshipit-source-id: dad59472d849eb80e230a83403e8c6af48137e6c
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
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
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
Summary: This makes affected tests work with debugruntest.
Reviewed By: DurhamG
Differential Revision: D34915627
fbshipit-source-id: dfa2d19c0291854f9bd3de123edd38e5c3d06bef
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
Summary: Pushing to bundle repo is no longer used in production.
Reviewed By: DurhamG
Differential Revision: D34872631
fbshipit-source-id: e7eb91fd818f67c0085b2971d3fe5aae04371547
Summary: `\` in heredoc for multi-line escaping is unsupported in debugruntest.
Reviewed By: DurhamG
Differential Revision: D34871318
fbshipit-source-id: 18e93a0fe8a367993c8170031c9bbc41211f3ca4
Summary: `<(echo foo)` is not supported. Use a temp file instead.
Reviewed By: DurhamG
Differential Revision: D34870111
fbshipit-source-id: dc21a4e14ed96dcb202a566ddff4b03ee3b938bc
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
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
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
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
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
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
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
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
Summary: This simplifies the tests and make them more compatible with debugruntest.
Reviewed By: DurhamG
Differential Revision: D34835698
fbshipit-source-id: 3c3a49984bad78c536f1fc683f25360e26b75730
Summary: This simplifies the tests and make them more compatible with debugruntest.
Reviewed By: DurhamG
Differential Revision: D34835687
fbshipit-source-id: 2d42b620ad69372b6482ac64bff2f626da7e7842
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
Summary: pyfmt it so changes can be formatted too.
Reviewed By: DurhamG
Differential Revision: D34835691
fbshipit-source-id: 97e31c5e0b514ec6651cb8e670473535db2a6802
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
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
Summary: This makes it pass with debugruntest.
Reviewed By: DurhamG
Differential Revision: D34835686
fbshipit-source-id: 4f0c087fdfe9e3464412ecf5be5556b40f67da8b
Summary: `tee` is used by some tests. Implement it.
Reviewed By: DurhamG
Differential Revision: D34790217
fbshipit-source-id: 7f62bde41da5520c158889ac09b659f7e7b47ba5
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
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
Summary: This makes it run under debugruntest.
Reviewed By: DurhamG
Differential Revision: D34790203
fbshipit-source-id: 034995f0c36bf0ef014d83a2d215819b8792752c
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
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
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
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
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
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
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
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