commit cloud forwardfiller: add a test to exercise the flow

Summary:
Building on the previous two commits, this adds a test which performs the following steps:
- does an infintiepush push to a Mercurial server
- looks into the `forwardfillerqueue`
- runs commitcloud forwardfiller's `fill-one` to replay the bundle to Mononoke
- verifies that this action causes the commit to appear in Mononoke

As this test uses `getdb.sh` from Mercurial test suite, it needs to be whitelisted from network blackholing (Note: we whitelist mononoke tests, which run with `--mysql` automatically, but this one is different, so we need to add it manually. See bottom diff of the stack for why we don't use `--mysql` and ephemeral shards here).

Reviewed By: krallin

Differential Revision: D21325071

fbshipit-source-id: d4d6cbdb10a2bcf955ee371278bf2bbbd5f5122c
This commit is contained in:
Kostia Balytskyi 2020-04-30 12:57:37 -07:00 committed by Facebook GitHub Bot
parent 5041433ad6
commit e016ea16a2
3 changed files with 20 additions and 2 deletions

View File

@ -44,7 +44,7 @@ EPHEMERAL_DB_WHITELIST = {
# At this time, all tests support the network blackhole (except when ephemeral
# MySQL is used)
NETWORK_BLACKHOLE_BLACKLIST: Set[str] = set()
NETWORK_BLACKHOLE_BLACKLIST: Set[str] = {"test-commitcloud-forwardfiller.t"}
def is_mode_opt_buck_binary():

View File

@ -1641,3 +1641,21 @@ function quiet() {
cat "$log"
return "$ret"
}
function commitcloud_fill_one() {
# Note: do not use `call_with_certs` here or
# put cert paths into env vars, as this causes
# the binary to lose access to `getdb.sh`-acquired
# database
local CERTDIR="${HGTEST_CERTDIR:-"$TEST_CERTS"}"
"$MONONOKE_COMMITCLOUD_FILLONE" \
--hgcli "$MONONOKE_HGCLI" \
--mononoke-address "[::1]:$MONONOKE_SOCKET" \
--mononoke-server-common-name localhost \
--cert-override "$CERTDIR/localhost.crt" \
--private-key-override "$CERTDIR/localhost.key" \
--ca-pem-override "$CERTDIR/root-ca.crt" \
--reponame $REPONAME \
--rebundler-path "$MONONOKE_COMMITCLOUD_INFINITEPUSHREBUNDLE/infinitepushrebundle.py" \
--debug "$@"
}

View File

@ -5,7 +5,7 @@
HGSQL_TESTDIR="${RUN_TESTS_LIBRARY:-"${TESTDIR:-.}"}"
GETDB_PATH="$HGSQL_TESTDIR/${HGTEST_GETDB_PATH:-getdb.sh}"
GETDB_PATH="${HGTEST_GETDB_SH:-$HGSQL_TESTDIR}/getdb.sh"
export DUMMYSSH_STABLE_ORDER=1
if [[ ! -f "$GETDB_PATH" ]]; then