3f9ba38f09
Summary: We want to be able to record all the bundles Mononoke processes to be later replayed by Mercurail. Reviewed By: krallin Differential Revision: D21427622 fbshipit-source-id: b88e10e03d07dae35369286fe31022f36a1ee5cf |
||
---|---|---|
.. | ||
commitsyncmap.toml | ||
dummyssh.sh | ||
generate_manifest.py | ||
integration_runner_real.py | ||
integration_runner.sh | ||
lib_buck.py | ||
library-push-redirector.sh | ||
library.sh | ||
pushrebase_replay.bundle | ||
README.md | ||
test-admin-hg-sync-bundle-last-processed.t | ||
test-admin-hg-sync-bundle-remains.t | ||
test-admin-hg-sync-bundle-verify.t | ||
test-admin-hg-sync-inspect.t | ||
test-admin-hg-sync-show.t | ||
test-alias-verify.t | ||
test-allowed-users.t | ||
test-apiserver-edenapi.t | ||
test-apiserver.t | ||
test-backfill-derived-data.t | ||
test-backfill-git-mapping.t | ||
test-backsyncer-merges.t | ||
test-benchmark-filestore.t | ||
test-blobimport-bookmarks.t | ||
test-blobimport-derived-data.t | ||
test-blobimport-fix-parent-order.t | ||
test-blobimport-git-mapping.t | ||
test-blobimport-globalrev.t | ||
test-blobimport-inline.t | ||
test-blobimport-lfs.t | ||
test-blobimport-megarepo.t | ||
test-blobimport-no-create.t | ||
test-blobimport-return-error.t | ||
test-blobimport.t | ||
test-blobstore_healer.t | ||
test-bonsai-verify.t | ||
test-bookmark-hg-kind.t | ||
test-bookmark-race.t | ||
test-bookmarks-filler.t | ||
test-bundle2-preservation.t | ||
test-cache-warmup-microwave.t | ||
test-cache-warmup.t | ||
test-clienttelemetry.t | ||
test-commitcloud.t | ||
test-copyrename.t | ||
test-cross-repo-commit-sync-merge.t | ||
test-cross-repo-commit-sync.t | ||
test-cross-repo-commit-validator.t | ||
test-db-filenodes.t | ||
test-edenapi-server.t | ||
test-fastreplay-inline-args.t | ||
test-fastreplay-remote-args.t | ||
test-filenodes-push-merge.t | ||
test-filenodes.t | ||
test-getpackv1.t | ||
test-getpackv2.t | ||
test-gettreepack-designated-nodes.t | ||
test-gettreepack.t | ||
test-gitimport-octopus.t | ||
test-gitimport.t | ||
test-hash-validation.t | ||
test-hook-tailer.t | ||
test-hooks.t | ||
test-inconsistent-hash.t | ||
test-infinitepush-bookmarks-disabled.t | ||
test-infinitepush-commits-disabled.t | ||
test-infinitepush-hydrated.t | ||
test-infinitepush-lfs.t | ||
test-infinitepush-namespace.t | ||
test-infinitepush-phaseheads.t | ||
test-infinitepush-vs-push.t | ||
test-infinitepush.t | ||
test-init.t | ||
test-large-path-and-content.t | ||
test-lfs-copytracing.t | ||
test-lfs-import.t | ||
test-lfs-server-acl-check.t | ||
test-lfs-server-consistent-hashing.t | ||
test-lfs-server-disabled-hostname-resolution.t | ||
test-lfs-server-error-formatting.t | ||
test-lfs-server-https.t | ||
test-lfs-server-identity-parsing-from-header.t | ||
test-lfs-server-identity-parsing-untrusted.t | ||
test-lfs-server-identity-parsing.t | ||
test-lfs-server-live-config.t | ||
test-lfs-server-max-upload-size.t | ||
test-lfs-server-proxy-skip-upstream.t | ||
test-lfs-server-proxy.t | ||
test-lfs-server-rate-limiting.t | ||
test-lfs-server-scuba-logging.t | ||
test-lfs-server.t | ||
test-lfs-to-mononoke.t | ||
test-lfs-upload-alias-on-fetch.t | ||
test-lfs.t | ||
test-linknodes.t | ||
test-listkeyspatterns.t | ||
test-lookup.t | ||
test-megarepo-tool.t | ||
test-mononoke-admin.t | ||
test-mononoke-hg-sync-job-generate-bundles-force.t | ||
test-mononoke-hg-sync-job-generate-bundles-lfs-verification.t | ||
test-mononoke-hg-sync-job-generate-bundles-lfs.t | ||
test-mononoke-hg-sync-job-generate-bundles-loop.t | ||
test-mononoke-hg-sync-job-generate-bundles-other-books.t | ||
test-mononoke-hg-sync-job-generate-bundles.t | ||
test-mononoke-hg-sync-job-sync-globalrevs.t | ||
test-mononoke-hg-sync-job-with-copies.t | ||
test-mononoke-hg-sync-job.t | ||
test-mononoke-readonly-storage-blobstore.t | ||
test-mononoke-readonly-storage-sql.t | ||
test-multiplexed-blobstore.t | ||
test-multiplexed-chaosblob.t | ||
test-new-repo.t | ||
test-priority.t | ||
test-push-bookmarks.t | ||
test-push-disallowed.t | ||
test-push-newblobimport.t | ||
test-push-protocol-lfs.t | ||
test-push-protocol.t | ||
test-push-readonly.t | ||
test-push-redirector-pushrebase-onesided.t | ||
test-push-redirector-pushrebase.t | ||
test-push-redirector-sync-job.t | ||
test-pushrebase-allow-casefolding.t | ||
test-pushrebase-block-casefolding.t | ||
test-pushrebase-block-merges.t | ||
test-pushrebase-copy-src-changed.t | ||
test-pushrebase-discovery.t | ||
test-pushrebase-emit-obsmarkers.t | ||
test-pushrebase-empty.t | ||
test-pushrebase-file-list.t | ||
test-pushrebase-git-mapping.t | ||
test-pushrebase-globalrevs.t | ||
test-pushrebase-mutation.t | ||
test-pushrebase-over-merge.t | ||
test-pushrebase-per-head-config.t | ||
test-pushrebase.t | ||
test-rechunker.t | ||
test-redaction-admin.t | ||
test-redaction-config.t | ||
test-redaction.t | ||
test-remotefilelog-lfs.t | ||
test-rename-in-merge.t | ||
test-scs-blame.t | ||
test-scs-diff.t | ||
test-scs-log.t | ||
test-scs-lookup.t | ||
test-scs-x-repo.t | ||
test-scs.t | ||
test-server.t | ||
test-sqlblob.t | ||
test-traffic-replay.t | ||
test-unbundle-replay-bookmarks-update-log.t | ||
test-unbundle-replay-hg-bookmark.t | ||
test-unbundle-replay-hg-recording.t | ||
test-walker-compression-benefit.t | ||
test-walker-count-objects.t | ||
test-walker-enable-derive.t | ||
test-walker-error-as-data.t | ||
test-walker-scrub-blobstore.t | ||
test-walker-scrub-queue.t | ||
test-walker-throttle.t | ||
test-walker-validate-non-public.t | ||
test-walker-validate.t |
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 //eden/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 //eden/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/eden/mononoke/tests/integration/integration_runner_real.par \
~/fbcode/buck-out/gen/eden/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
, whererelative/path
is the path to your asset relative from.../mononoke/tests/integration
. - Add your asset to the
test_fixtures
Buck rule in this directory'sTARGETS
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.