sapling/tests/integration
Jun Wu 0cb9961ac4 pushrebase: do push in one transaction
Summary:
The push operation has 2 phases: push, then move bookmarks, etc.  Make that in
one transaction so it wouldn't end up with an inconsistent state.

Reviewed By: sfilipco

Differential Revision: D18362363

fbshipit-source-id: 338ef1b088975a9d1b043ccef81782e14c77d8e1
2019-11-08 22:29:40 -08:00
..
commitsyncmap.toml mononoke: move sync direction into small repo commit sync config 2019-10-16 08:11:03 -07:00
dummyssh.sh Yearless license header 2019-10-11 13:52:34 -07:00
generate_manifest.py Yearless license header 2019-10-11 13:52:34 -07:00
integration_runner_real.py mononoke: add a test for D17952529 2019-10-16 10:11:27 -07:00
integration_runner.sh Yearless license header 2019-10-11 13:52:34 -07:00
lib_buck.py Yearless license header 2019-10-11 13:52:34 -07:00
library.sh mononoke: use same file for all sqlite databases 2019-11-07 08:15:58 -08:00
pushrebase_replay.bundle mononoke: add tests for pushrebase replay 2019-02-05 15:08:29 -08:00
README.md mononoke: suggest not using buck run scm/mononoke/tests/integration:integration_runner -- TEST 2019-06-25 08:41:31 -07:00
test-admin-hg-sync-bundle-last-processed.t mononoke: use same file for all sqlite databases 2019-11-07 08:15:58 -08:00
test-admin-hg-sync-bundle-remains.t mononoke: use same file for all sqlite databases 2019-11-07 08:15:58 -08:00
test-admin-hg-sync-bundle-verify.t mononoke: use same file for all sqlite databases 2019-11-07 08:15:58 -08:00
test-alias-verify.t mononoke/filestore: incorporate in Mononoke 2019-07-31 05:19:40 -07:00
test-allowed-users.t mononoke: split off unbundle response generation 2019-10-31 07:53:28 -07:00
test-apiserver-edenapi.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-apiserver.t add /{repo}/resolve_bookmark/{bookmark} 2019-09-27 02:25:19 -07:00
test-blobimport-bookmarks.t mononoke: allow tests to work with multiple mononoke repos 2019-09-23 07:16:15 -07:00
test-blobimport-fix-parent-order.t mononoke: fix parent order in blobimport 2019-10-01 15:18:32 -07:00
test-blobimport-globalrev.t upload globalrevs while blobimport 2019-10-30 10:56:22 -07:00
test-blobimport-inline.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-blobimport-lfs.t mononoke/blobimport: do not process::exit(1) 2019-10-30 11:37:32 -07:00
test-blobimport-return-error.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-blobimport.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-bonsai-verify.t mononoke: connect stdlog and slog 2019-09-12 04:13:11 -07:00
test-bookmark-hg-kind.t mononoke: use same file for all sqlite databases 2019-11-07 08:15:58 -08:00
test-bookmark-race.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-bookmarks-filler.t mononoke: connect stdlog and slog 2019-09-12 04:13:11 -07:00
test-bundle2-preservation.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-cache-warmup.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-clienttelemetry.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-commitcloud.t changegroup: do not show "(+/- ? heads)" 2019-11-07 10:51:34 -08:00
test-copyrename.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-cross-repo-commit-sync-merge.t mononoke: use same file for all sqlite databases 2019-11-07 08:15:58 -08:00
test-cross-repo-commit-sync.t mononoke: use synced_working_copy_equivalence to compute get_commit_sync_outcome 2019-10-30 10:53:00 -07:00
test-getpackv1.t mononoke: getpackv2 LFS support (+ getfiles / getpack / eden_get_data refactor) 2019-08-14 08:48:35 -07:00
test-getpackv2.t mononoke: getpackv2 LFS support (+ getfiles / getpack / eden_get_data refactor) 2019-08-14 08:48:35 -07:00
test-gettreepack.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-hash-validation.t remotefilelog: make fetchpacks the default 2019-10-16 14:21:06 -07:00
test-hooks.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-inconsistent-hash.t mononoke: corrupt packs, not loose files 2019-09-11 05:40:56 -07:00
test-infinitepush-bookmarks-disabled.t mononoke: use same file for all sqlite databases 2019-11-07 08:15:58 -08:00
test-infinitepush-commits-disabled.t mononoke: use same file for all sqlite databases 2019-11-07 08:15:58 -08:00
test-infinitepush-lfs.t mononoke/repo_client: support ChangegroupV3 push 2019-10-18 05:47:30 -07:00
test-infinitepush-namespace.t mononoke: split off unbundle response generation 2019-10-31 07:53:28 -07:00
test-infinitepush.t changegroup: do not show "(+/- ? heads)" 2019-11-07 10:51:34 -08:00
test-init.t changegroup: do not show "(+/- ? heads)" 2019-11-07 10:51:34 -08:00
test-large-path-and-content.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-lfs-copytracing.t remotefilelog: make fetchpacks the default 2019-10-16 14:21:06 -07:00
test-lfs-import.t mononoke: connect stdlog and slog 2019-09-12 04:13:11 -07:00
test-lfs-server-consistent-hashing.t mononoke: Consistent routing for LFS server downloads 2019-11-06 06:05:50 -08:00
test-lfs-server-https.t mononoke: allow tests to work with multiple mononoke repos 2019-09-23 07:16:15 -07:00
test-lfs-server-live-config.t mononoke: lfs_server: Allow configuring the config fetch interval 2019-11-06 06:05:50 -08:00
test-lfs-server-proxy-skip-upstream.t mononoke/lfs_server: make proxy test not racy 2019-09-24 06:44:26 -07:00
test-lfs-server-proxy.t mononoke/lfs_server: make proxy test not racy 2019-09-24 06:44:26 -07:00
test-lfs-server-scuba-logging.t mononoke/lfs_server: log http query 2019-11-08 10:14:19 -08:00
test-lfs-server.t mononoke: allow tests to work with multiple mononoke repos 2019-09-23 07:16:15 -07:00
test-lfs-to-mononoke.t remotefilelog: make fetchpacks the default 2019-10-16 14:21:06 -07:00
test-lfs-upload-alias-on-fetch.t remotefilelog: make fetchpacks the default 2019-10-16 14:21:06 -07:00
test-lfs.t remotefilelog: make fetchpacks the default 2019-10-16 14:21:06 -07:00
test-linknodes.t remotefilelog: make fetchpacks the default 2019-10-16 14:21:06 -07:00
test-listkeyspatterns.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-lookup.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-megarepo-tool.t mononoke: move sync direction into small repo commit sync config 2019-10-16 08:11:03 -07:00
test-mononoke-admin.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-mononoke-hg-sync-job-generate-bundles-force.t mononoke: remove unnecessary code from integration tests 2019-10-05 00:46:35 -07:00
test-mononoke-hg-sync-job-generate-bundles-lfs-verification.t mononoke/tests: LFS blob verification: make it not flaky 2019-10-30 11:34:22 -07:00
test-mononoke-hg-sync-job-generate-bundles-lfs.t remotefilelog: make fetchpacks the default 2019-10-16 14:21:06 -07:00
test-mononoke-hg-sync-job-generate-bundles-loop.t mononoke: add a test for D17952529 2019-10-16 10:11:27 -07:00
test-mononoke-hg-sync-job-generate-bundles-other-books.t mononoke: do not use recorded timestamps in new sync job 2019-09-27 00:34:57 -07:00
test-mononoke-hg-sync-job-generate-bundles.t mononoke: remove unnecessary code from integration tests 2019-10-05 00:46:35 -07:00
test-mononoke-hg-sync-job-with-copies.t mononoke: remove unnecessary code from integration tests 2019-10-05 00:46:35 -07:00
test-mononoke-hg-sync-job.t mononoke: use same file for all sqlite databases 2019-11-07 08:15:58 -08:00
test-multiplexed-blobstore.t mononoke/tests: test-multiplexed-blobstore.t: make it not flaky 2019-10-30 11:31:59 -07:00
test-new-repo.t use new repo without blobimporting it 2019-10-29 11:47:11 -07:00
test-push-bookmarks.t mononoke: split off unbundle response generation 2019-10-31 07:53:28 -07:00
test-push-disallowed.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-push-newblobimport.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-push-protocol-lfs.t mononoke/repo_client: support ChangegroupV3 push 2019-10-18 05:47:30 -07:00
test-push-protocol.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-push-readonly.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-pushrebase-block-merges.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-pushrebase-copy-src-changed.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-pushrebase-discovery.t mononoke: expose option to disable infinitepush server write support 2019-07-02 10:39:52 -07:00
test-pushrebase-emit-obsmarkers.t pushrebase: do push in one transaction 2019-11-08 22:29:40 -08:00
test-pushrebase-empty.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-pushrebase-file-list.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-pushrebase-mutation.t changegroup: do not show "(+/- ? heads)" 2019-11-07 10:51:34 -08:00
test-pushrebase-over-merge.t mononoke: support pushrebase over merge 2019-10-17 04:30:41 -07:00
test-pushrebase-per-head-config.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-pushrebase.t mononoke: support pushrebase over merge 2019-10-17 04:30:41 -07:00
test-rechunker.t mononoke: connect stdlog and slog 2019-09-12 04:13:11 -07:00
test-redaction-admin.t mononoke: use same file for all sqlite databases 2019-11-07 08:15:58 -08:00
test-redaction-config.t mononoke: use csid_resolve in places where we used resolve_hg_rev 2019-10-05 05:48:43 -07:00
test-redaction.t rebase: remove rev number from rebase output 2019-10-15 16:29:27 -07:00
test-rename-in-merge.t changegroup: do not show "(+/- ? heads)" 2019-11-07 10:51:34 -08:00
test-scs.t error out on lack of connection 2019-11-07 07:52:35 -08:00
test-server.t mononoke: rebuild test framework 2019-06-25 08:41:31 -07:00
test-sqlblob.t changegroup: do not show "(+/- ? heads)" 2019-11-07 10:51:34 -08:00

Mononoke Integration Tests

Mononoke's integration tests run using Mercurial's run-tests test framework, which is orchestrated using a wrapper to make it more friendly to TestPilot and provide some added functionality, such as wiring up dependencies and / or setting up an ephemeral MySQL shard.

TL;DR: Running one test

Use:

buck run scm/mononoke/tests/integration:integration_runner -- TEST

But! Keep reading: there are faster ways to run the tests if you're going to be iterating on something. You might as well read on while you wait for that build to complete.

Running Tests Incrementally: a better way

To run tests locally, a better way is to run the integration runner directly. This allows you to skip most build steps, and rebuild only what you need to re-run your test (e.g. if you're iterating on Mononoke server, then you won't need to rebuild blobimport more than once).

To do this, you should start by building everything once:

buck build scm/mononoke/tests/integration

Then, run the tests by executing the integration runner directly. The integration runner relies on a manifest to find all the binaries it needs to run (the ones you built earlier), so you need to point it there:

~/fbcode/buck-out/dev/gen/scm/mononoke/tests/integration/integration_runner_real.par \
  ~/fbcode/buck-out/gen/scm/mononoke/tests/integration/manifest/manifest.json \
  test1.t test2.t test3.t

If you don't have ~/fbcode symlink, create it, or update the instructions as needed. Note that you can run this from anywhere in fbsource tree (so you can run it from the actual tests directory to get autocompletion or globbing on test names).

Every time you make changes to your code, buck build whatever you changed, then re-run.

Use --interactive when running your tests in order to accept (or reject) changes to your .t files.

Adding new tests:

Add your new test in this directory (or under facebook/) if it's not relevant to open-source.

If your test needs assets to work, then you'll need to:

  • Put the asset somewhere under this directory.
  • In tests, your asset can be found at ${TEST_FIXTURES}/relative/path, where relative/path is the path to your asset relative from .../mononoke/tests/integration.
  • Add your asset to the test_fixtures Buck rule in this directory's TARGETS file. If you don't do this, then running tests using the runner directly will work (read on to understand why), but it won't work when running through Buck / TestPilot.

Exposing a new binary

Add it to MANIFEST_DEPS in the TARGETS file in this directory. The key is an environment variable that will be set to the path to this binary when the tests execute (if you need to customize the environment variable a bit, you can do so in generate_manifest.py).

How it works

To avoid full rebuilds whenever you make a change, the test runner takes a few shortcuts to avoid relying on the Buck dependency graph (that is because Buck doesn't see each individual test's dependencies: it only knows that all the tests depend on everything).

Notably, it:

  • Uses the actual test source files (and assets) from your fbcode working directory when running the runner directly (as documented above). This allows --interactive to work seamlessly.
  • Stores the paths to all its dependencies in a manifest file (which is generated from Buck).

However, when you're running tests using Buck, then the test runner will not use source files, and will instead expect files to be managed using Buck. The main result of this is that while you might have a bunch of files jumbled together in this directory, when running tests using Buck, they will not.

Normally, this should all be transparent if you're adding a new test and using ${TEST_FIXTURES} to reference it.