Commit Graph

10 Commits

Author SHA1 Message Date
Thomas Orozco
a179a0bde4 mononoke: rebuild test framework
Summary:
Our test framework as it stands right now is a light passthrough to the hg `run-tests.py` test framework, which attempts to place all the files it needs to run (including tests) into a `python_binary`, then runs the hg test runner from that directory.

It heavily relies on how Buck works to offer functionality:

- It expects that all the sources it registers for its master binary will all be in the same directory when it builds
- It expects that the sources will be symlinks to the real files so that `--interactive` can work.

This has a few problems:

- It doesn't work in `mode/opt`. The archive that gets built in `mode/opt` doesn't actually have all the sources we registered, so it's impossible to run tests.
- To add a new test, you must rebuild everything. We don't do that very often, but it'd be nice if we didn't have to.
- Iterating on the runner itself is painful, because as far as Buck is concerned, it depends on the entire world. This means that every change to the runner has to scan a lot more stuff than necessary. There's some functionality I'd like to get into the runner (like reporting test timings) that hasn't been easy to add as a result.

This diff attempts to solve these problems by separating concerns a little more:

- The runner is now just a simple `python_binary`, so it's easier to make changes to it.
- The runner now provides the logic of working from local files when needed (this means you can add a new test and it'll work immediately),
- All the binaries we need are dependencies of the integration test target, not the runner's. However, to make it possible to run the runner incrementally while iterating on something, there's a manifest target that points at all the various paths the runner needs to work. This will also help integrate the test runner with other build frameworks if necessary (e.g. for open-sourcing).
- We have separate targets for various assets we need to run the tests (e.g. the hg test framework).
- The runner now controls whether to use the network blackhole. This was necessary because the network blackhole breaks PAR archives (because tmp is no longer owned by the right owner, because we use a user namespace). We should be able to bring this back at some point if we want to by using a proper chroot for opt tests.

I included a README to explain this new design as well.

There are some things that could yet stand to be improved here (notably, I think we should put assets and tests in different directories for the sake of clarity), but so far I've been aiming at providing a 1-1 translation of the old system into the new one. I am planning to make further improvements in followup diffs.

Reviewed By: farnz

Differential Revision: D15921732

fbshipit-source-id: 09052591c419acf97f7e360b1e88ef1f412da6e5
2019-06-25 08:35:32 -07:00
Durham Goode
596dfb677b Unify dummyssh with Mercurial
Summary:
Mercurial is maintaining it's own dummyssh, and they've started to
diverge. I've copied over the hgcli bits to Mercurial's dummyssh in order to
support Mononoke integration tests, so let's just symlink Mononoke to use
Mercurial's dummyssh.

Reviewed By: markbt

Differential Revision: D15382377

fbshipit-source-id: 0847ce6efac7db256f16cc53705777cf55f71593
2019-05-28 03:17:03 -07:00
Johan Schuijt-Li
877d1315da treemanifest/remotenames: use write path for reads after push
Summary:
Treemanifest uses it's own fallbackpath for reads in all cases, but
particularly in the case of remotenames it should stay on the path that is
actively being used by the push. It is possible to have remotenames which are
mirrored and selected by query strings in the repo path. In this case it is
possible that the mirror is still out of date when reading back data from our
push. Ensure that when doing a push the remote server this is considered
'sticky' so that we read back from the remote we pushed to, rather then
determening the path ourselves.

To disable, please use:
  treemanifest.stickypushpath=False

Reviewed By: DurhamG, markbt, quark-zju

Differential Revision: D14165444

fbshipit-source-id: 75a53ffab895d87a4c52814f7887145c134868b5
2019-02-22 06:03:18 -08:00
Johan Schuijt-Li
8b2b9f0878 tests: dummyssh should have same behavior as hg-ssh-wrapper
Summary: We're using query strings to provide metadata to the server, but they should be stripped before they actually reach the core Mercurial handling. Let's update the tests to simulate this behavior.

Reviewed By: DurhamG

Differential Revision: D14051480

fbshipit-source-id: a9b448fd193f17aeab93c4886efdec3fda533c4d
2019-02-14 03:21:53 -08:00
Aida Getoeva
93252b7fd2 Enable batch mode for SSH during background pushbackup
Summary:
Added passing BatchMode option to SSH call only when puchbackup runs in background.
Also fixed dummyssh in skipping options before hostname, added unittest.

Reviewed By: quark-zju

Differential Revision: D7119123

fbshipit-source-id: 2c8e66fee44cca5b23389cba8e21e3a0b237268e
2018-04-13 21:51:21 -07:00
Jun Wu
001fbec734 dummyssh: use LOCALIP
This patch replaces hard-coded 127.0.0.1 with $LOCALIP in dummyssh.
2017-02-15 23:24:03 -08:00
Pulkit Goyal
c38821acbc py3: make tests/dummyssh use absolute_import 2016-05-13 03:26:28 +05:30
Augie Fackler
9460b542a9 dummyssh: fix check-code nit 2013-06-14 15:28:40 -04:00
Mads Kiilerich
32d88164b3 tests: make simple single quotes work with dummyssh on windows
Mercurial assumes that the shell on remote servers over ssh servers uses unix
quoting rules. Tests using dummyssh are however also run on windows where cmd
doesn't parse single quotes like on unix.

This hack replaces the single quotes with double quotes on windows - that is
enough to make test-ssh.t pass after 7bec00a7d7a6.
2011-12-26 15:30:43 +01:00
Mads Kiilerich
adf83aa0ff tests: share dummyssh 2011-05-05 01:47:46 +02:00