sapling/eden/mononoke/tests/integration
Thomas Orozco 83cd9eec54 mononoke/apiserver: run streams on a Tokio 0.2 runtime
Summary:
Well, we don't have a Tokio Compat runtime in Actix. This means Tokio 0.2 code
(e.g. Tokio 0.2 timers) blows up when executed in the API Server.

How do we fix this? By not running Mononoke code on Actix's runtime, and
instead running in on a Mononoke runtime we instantiated.

How do we do that? By passing a Tokio Compat Executor all the way down to the
place where Actix is about to consume our stream ... and at that point, we
spawn the stream on our runtime, and give Actix a dumb receiver that does work
when polled on a Tokio 0.1 runtime.

This feels like the end of the road for the API Server. Nothing about this is
even remotely sane, but it should take us through the API Server's eventual
demise and replacement with the Gotham-based EdenAPI Server, which runs on the
runtime of our choice (i.e. Tokio 0.2).

Reviewed By: farnz

Differential Revision: D20222294

fbshipit-source-id: 1646e35fe05b131b030e4962c8a7f68f72995035
2020-03-03 10:18:02 -08:00
..
commitsyncmap.toml mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
dummyssh.sh Manual synchronization of fbcode/eden and facebookexperimental/eden 2020-02-11 11:42:43 +01:00
generate_manifest.py Manual synchronization of fbcode/eden and facebookexperimental/eden 2020-02-11 11:42:43 +01:00
integration_runner_real.py Manual synchronization of fbcode/eden and facebookexperimental/eden 2020-02-11 11:42:43 +01:00
integration_runner.sh Manual synchronization of fbcode/eden and facebookexperimental/eden 2020-02-11 11:42:43 +01:00
lib_buck.py Manual synchronization of fbcode/eden and facebookexperimental/eden 2020-02-11 11:42:43 +01:00
library-push-redirector.sh Manual synchronization of fbcode/eden and facebookexperimental/eden 2020-02-11 11:42:43 +01:00
library.sh mononoke: pushrebase: add tests for casefolding 2020-03-03 02:44:06 -08:00
pushrebase_replay.bundle mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
README.md Manual synchronization of fbcode/eden and facebookexperimental/eden 2020-02-11 11:42:43 +01:00
test-admin-hg-sync-bundle-last-processed.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-admin-hg-sync-bundle-remains.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-admin-hg-sync-bundle-verify.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-alias-verify.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-allowed-users.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-apiserver-edenapi.t mononoke/apiserver: run streams on a Tokio 0.2 runtime 2020-03-03 10:18:02 -08:00
test-apiserver.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-backsyncer-merges.t mononoke: add x_repo_lookup to scsc 2020-02-06 07:26:14 -08:00
test-blobimport-bookmarks.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-blobimport-derived-data.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-blobimport-fix-parent-order.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-blobimport-git-mapping.t add git mappings import option 2020-02-21 05:41:46 -08:00
test-blobimport-globalrev.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-blobimport-inline.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-blobimport-lfs.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-blobimport-megarepo.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-blobimport-no-create.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-blobimport-return-error.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-blobimport.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-blobstore_healer.t mononoke: include DB config in multiplexed blobstore configuration 2020-02-24 11:54:45 -08:00
test-bonsai-verify.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-bookmark-hg-kind.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-bookmark-race.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-bookmarks-filler.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-bundle2-preservation.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-cache-warmup.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-clienttelemetry.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-commitcloud.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-copyrename.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-cross-repo-commit-sync-merge.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-cross-repo-commit-sync.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-db-filenodes.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-fastreplay-inline-args.t mononoke: log input size 2020-02-20 02:24:10 -08:00
test-fastreplay-remote-args.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-filenodes-push-merge.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-filenodes.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-getpackv1.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-getpackv2.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-gettreepack.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-gitimport-octopus.t test-gitimport-octopus: don't expect a specific number of commits to verify 2020-02-19 10:16:38 -08:00
test-gitimport.t backfill_derived_data mononoke: fail if derived data disabled 2020-02-16 04:56:34 -08:00
test-hash-validation.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-hooks.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-inconsistent-hash.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-infinitepush-bookmarks-disabled.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-infinitepush-commits-disabled.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-infinitepush-hydrated.t mononoke: return hydrated bundles for infinitepush, if config says so 2020-02-28 08:30:43 -08:00
test-infinitepush-lfs.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-infinitepush-namespace.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-infinitepush.t connectionpool: add a debug note saying connection being reused 2020-02-13 12:16:21 -08:00
test-init.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-large-path-and-content.t warn: remove large file warning 2020-02-11 10:18:06 -08:00
test-lfs-copytracing.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-lfs-import.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-lfs-server-acl-check.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-lfs-server-consistent-hashing.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-lfs-server-disabled-hostname-resolution.t mononoke: include DB config in multiplexed blobstore configuration 2020-02-24 11:54:45 -08:00
test-lfs-server-https.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-lfs-server-identity-parsing-from-header.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-lfs-server-identity-parsing-untrusted.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-lfs-server-identity-parsing.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-lfs-server-live-config.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-lfs-server-max-upload-size.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-lfs-server-proxy-skip-upstream.t mononoke: update test-lfs-server-proxy-skip-upstream.t to be more deterministic 2020-02-10 01:40:41 -08:00
test-lfs-server-proxy.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-lfs-server-rate-limiting.t mononoke: lfs_server: add optional client identities to ratelimit config 2020-03-03 09:33:03 -08:00
test-lfs-server-scuba-logging.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-lfs-server.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-lfs-to-mononoke.t mononoke: fix a number of broken tests 2020-02-17 11:04:15 -08:00
test-lfs-upload-alias-on-fetch.t mononoke: fix a number of broken tests 2020-02-17 11:04:15 -08:00
test-lfs.t mononoke: fix a number of broken tests 2020-02-17 11:04:15 -08:00
test-linknodes.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-listkeyspatterns.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-lookup.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-megarepo-tool.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-mononoke-admin.t mononoke: test-mononoke-admin.t: fixup replication lag match 2020-02-24 02:57:18 -08:00
test-mononoke-hg-sync-job-generate-bundles-force.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-mononoke-hg-sync-job-generate-bundles-lfs-verification.t mononoke/hg_sync_job: use 0.2 runtime 2020-02-18 07:42:41 -08:00
test-mononoke-hg-sync-job-generate-bundles-lfs.t mononoke: fix a number of broken tests 2020-02-17 11:04:15 -08:00
test-mononoke-hg-sync-job-generate-bundles-loop.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-mononoke-hg-sync-job-generate-bundles-other-books.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-mononoke-hg-sync-job-generate-bundles.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-mononoke-hg-sync-job-sync-globalrevs.t mononoke/hg_sync_job: update Globalrevs in hgsql 2020-03-02 08:24:16 -08:00
test-mononoke-hg-sync-job-with-copies.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-mononoke-hg-sync-job.t mononoke/hg_sync_job: use 0.2 runtime 2020-02-18 07:42:41 -08:00
test-mononoke-readonly-storage-blobstore.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-mononoke-readonly-storage-sql.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-multiplexed-blobstore.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-multiplexed-chaosblob.t mononoke: include DB config in multiplexed blobstore configuration 2020-02-24 11:54:45 -08:00
test-new-repo.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-push-bookmarks.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-push-disallowed.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-push-newblobimport.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-push-protocol-lfs.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-push-protocol.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-push-readonly.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-push-redirector-pushrebase-onesided.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-push-redirector-pushrebase.t mononoke: add x_repo_lookup to scsc 2020-02-06 07:26:14 -08:00
test-push-redirector-sync-job.t mononoke: add x_repo_lookup to scsc 2020-02-06 07:26:14 -08:00
test-pushrebase-allow-casefolding.t mononoke: pushrebase: fix casefolding_check usage during changeset creation 2020-03-03 03:57:32 -08:00
test-pushrebase-block-casefolding.t mononoke: pushrebase: add tests for casefolding 2020-03-03 02:44:06 -08:00
test-pushrebase-block-merges.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-pushrebase-copy-src-changed.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-pushrebase-discovery.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-pushrebase-emit-obsmarkers.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-pushrebase-empty.t mononoke/blobstore: remove rocksdb blobstore and replace its usages with sqliteblob 2020-02-24 05:23:07 -08:00
test-pushrebase-file-list.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-pushrebase-git-mapping.t make BonsaiGitMapping repo-specific 2020-02-27 08:05:13 -08:00
test-pushrebase-globalrevs.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-pushrebase-mutation.t debugmutation: add time range limiting 2020-02-17 06:41:03 -08:00
test-pushrebase-over-merge.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-pushrebase-per-head-config.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-pushrebase.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-rechunker.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-redaction-admin.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-redaction-config.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-redaction.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-rename-in-merge.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-scs-x-repo.t mononoke: add x_repo_lookup to scsc 2020-02-06 07:26:14 -08:00
test-scs.t add git identifiers to Source Control Service 2020-02-27 08:05:14 -08:00
test-server.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-sqlblob.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-traffic-replay.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-walker-compression-benefit.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-walker-count-objects.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-walker-enable-derive.t mononoke: move the codebase under eden/ directory 2020-02-06 13:46:04 +01:00
test-walker-error-as-data.t mononoke: Add hash::GitSha1 as a pure hash-only key for git Aliases 2020-02-18 05:02:52 -08:00
test-walker-scrub-blobstore.t mononoke: fix walker filenode walks 2020-02-26 15:21:53 -08:00
test-walker-scrub-queue.t mononoke: include DB config in multiplexed blobstore configuration 2020-02-24 11:54:45 -08:00
test-walker-throttle.t mononoke: fix walker filenode walks 2020-02-26 15:21:53 -08:00
test-walker-validate-non-public.t mononoke: walker: test validate scuba logging for non-public commits 2020-02-26 06:16:29 -08:00
test-walker-validate.t mononoke: fix walker filenode walks 2020-02-26 15:21:53 -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 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, 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.