forked from celo-org/celo-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci_test_sync.sh
executable file
·21 lines (18 loc) · 918 Bytes
/
ci_test_sync.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
set -euo pipefail
# This test starts a Geth mining node and checks that other nodes can sync with it.
# For testing a particular branch of Geth repo (usually, on Circle CI)
# Usage: ci_test_sync.sh checkout <branch_of_geth_repo_to_test>
# For testing the local Geth dir (usually, for manual testing)
# Usage: ci_test_sync.sh local <location_of_local_geth_dir>
export TS_NODE_FILES=true
if [ "${1}" == "checkout" ]; then
# Test master by default.
BRANCH_TO_TEST=${2:-"master"}
echo "Checking out geth at branch ${BRANCH_TO_TEST}..."
./node_modules/.bin/mocha --node-option loader=ts-node/esm src/e2e-tests/sync_tests.ts --branch ${BRANCH_TO_TEST}
elif [ "${1}" == "local" ]; then
export GETH_DIR="${2}"
echo "Testing using local geth dir ${GETH_DIR}..."
./node_modules/.bin/mocha --node-option loader=ts-node/esm src/e2e-tests/sync_tests.ts --localgeth ${GETH_DIR}
fi