Commit Graph

11 Commits

Author SHA1 Message Date
Muir Manders
c25eab9a68 ui: don't default username to <user>@<fqdn>
Summary: If the user hasn't configured their ui.username, I would rather the command error out instead of using <user>@<fqdn>. On Windows in particular, this default gives a very wrong user name that gets immortalized in the commit cloud workspace. It's much less toil for the user to configure the username early.

Reviewed By: quark-zju

Differential Revision: D43668690

fbshipit-source-id: 64c4e0d235b2fe2fa80c76da6e04917573989a9b
2023-03-02 22:10:45 -08:00
Jordan Webster
329dee5a32 testlib: new watchman instance per test
Summary: Pull watchman test code from old integration tests into a reusable library for new testlib. Create a new watchman instance per test which allows us to override system level configuration for each test. Namely, we wish to overwrite `"enforce_root_files": true` which is causing the tests to fail with the new rust status command because the required root files are not present.

Reviewed By: quark-zju

Differential Revision: D38116929

fbshipit-source-id: c24453577fc366ea5c4c8de5a41a5fc8059b4e1b
2022-08-03 13:12:34 -07:00
Carolyn Busch
21a1cfe43d test: add RepoGenerator to GlobalTestState
Summary: Right now the file name pattern generated is the same for each repo: file0, file1, file2... If a repo pulls a commit with a file generated from another repo, the first filename it generates will be the same as a file that's already in the repo, instead of a new filename. Share the RepoGenerator as a test global so every new filename is unique.

Reviewed By: DurhamG

Differential Revision: D37218147

fbshipit-source-id: 252f933156dbb736f90bb0d8ca812594c548405f
2022-06-21 12:52:43 -07:00
Harvey Hunt
f411cb34a9 hg: testlib: Log label with new_dir
Summary:
Update the new_dir function to accept an optional label. The label
will be printed along with the created directory if the testlib is in debug
mode.

Reviewed By: DurhamG

Differential Revision: D37178945

fbshipit-source-id: 4393b269a86da58009a6ba9d7418832ff91b157f
2022-06-16 04:03:51 -07:00
Harvey Hunt
9fbcf1c94e hg: testlib: Add a test debug mode to inspect server logs
Summary:
This diffs updates the testlib runner to include a debug mode that can
be enabled by setting `HGTEST_DEBUG`. This mode means that the temporary test
directory isn't cleaned up and Mononoke server's stderr is written to a file.

In the future, this debug mode could be expanded more (perhaps it could imply
that tracing should be enabled?).

Reviewed By: DurhamG

Differential Revision: D37137962

fbshipit-source-id: 2005c227ad17e099f22650d9d5eb78dc9322a742
2022-06-15 05:47:29 -07:00
Durham Goode
0ed5d6ca9a testlib: allow in-process command invocation
Summary:
Instead of shelling out to a new hg process, let's allow running the
commands in the test process.

Reviewed By: jordanwebster

Differential Revision: D36117591

fbshipit-source-id: 0db30e60cf4b06340b9702992b5d5351bffd0c58
2022-05-13 11:31:50 -07:00
Durham Goode
9f2878631a testlib: allow tracing test commands
Summary:
Makes it easy to view the commands that were run, and their output.

We need to figure out some way to make this easy to do. Maybe we check in a bash
script that handles producing the right arguments for this stuff. Like ./trace
test_working_copy_bookmark

Reviewed By: quark-zju

Differential Revision: D36117592

fbshipit-source-id: 32ffb6fb7894de2233afa05848bc49be8c9fed85
2022-05-09 17:03:38 -07:00
Durham Goode
7f87b0f013 testlib: load dynamicconfig
Summary:
We want the tests to run with production configs as much as possible.
Let's allow them to load the non-remote portions of dynamicconfig. This should
also help encourage people to move configs from remote-configuration to the
static dynamicconfig.

There is a bit of an issue right now where the static dynamicconfig is fb-only.
So these tests may behave differently when run against an open source build. We
probably need to move a bunch of the fb-only configs to be public configs.

Reviewed By: quark-zju

Differential Revision: D35820978

fbshipit-source-id: 24c8fe73198244b99e0beeae22b1e93cdccb9872
2022-05-04 18:24:58 -07:00
Durham Goode
30a1e330e2 testlib: support EdenFS checkouts
Summary:
Allow for transparently using a Eden FS checkout instead of a physical
checkout.

Reviewed By: chadaustin

Differential Revision: D35695520

fbshipit-source-id: 79827815e4557ae99df05dc62c31cc5697676a38
2022-05-04 18:24:58 -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
Durham Goode
50aaa1a686 testlib: add initial base for new test framework
Summary:
This introduces the initial base, repo, and working copy classes for
the new Python OO test library. Future diffs will fill in functionality here.

Differential Revision: D35683764

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