-
Notifications
You must be signed in to change notification settings - Fork 21
/
.cirrus.yml
83 lines (73 loc) · 2.58 KB
/
.cirrus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
task:
name: 'Functional tests'
container:
image: rust:latest
timeout_in: 90m # https://cirrus-ci.org/faq/#instance-timed-out
env:
EXECUTOR_WORKERS: 3
VERBOSE: 0
LOG_LEVEL: debug
TIMEOUT: 300
BITCOIND_VERSION: 23.0
BITCOIND_DIR_NAME: "bitcoin-$BITCOIND_VERSION"
matrix:
- name: 'Misc functional tests'
env:
TEST_GROUP: tests/test_misc.py tests/test_watchtowers.py
- name: 'RPC functional tests'
env:
TEST_GROUP: tests/test_rpc.py
- name: 'Chain functional tests'
env:
TEST_GROUP: tests/test_chain.py
- name: 'Spend functional tests'
env:
TEST_GROUP: tests/test_spend.py
cargo_registry_cache:
folders: $CARGO_HOME/registry
fingerprint_script: cat Cargo.lock
cargo_git_cache:
folders: $CARGO_HOME/git # It will fail if they aren't separated
fingerprint_script: cat Cargo.lock
target_cache:
folder: target
fingerprint_script:
- rustc --version
- cat Cargo.lock
revaultd_build_script: cargo build --release
coordinator_cache:
folder: tests/servers/coordinatord
fingerprint_script: git rev-parse HEAD:tests/servers/coordinatord
watchtower_cache:
folder: tests/servers/miradord
fingerprint_script: git rev-parse HEAD:tests/servers/miradord
cosigning_server_cache:
folder: tests/servers/cosignerd
fingerprint_script: git rev-parse HEAD:tests/servers/cosignerd
servers_build_script: |
for server in "coordinatord" "miradord" "cosignerd"; do
if [ ! -f tests/servers/$server/Cargo.lock ]; then
git submodule update --init --recursive --remote ./tests/servers/$server
cd ./tests/servers/$server
cargo build
cd ../../../
fi
done
deps_script: apt update && apt install -y postgresql python3 python3-pip
pip_cache:
folder: ~/.cache/pip
python_deps_script: pip install -r tests/requirements.txt
test_script: |
set -xe
# Download the bitcoind binary
ARCHIVE_NAME="$BITCOIND_DIR_NAME.tar.gz"
curl https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz -o $ARCHIVE_NAME
tar -xzf $ARCHIVE_NAME
export BITCOIND_PATH=$BITCOIND_DIR_NAME/bin/bitcoind
# Setup the postgres instance for the servers
pg_ctlcluster 13 main start
su -c "psql -c \"CREATE ROLE test CREATEDB LOGIN PASSWORD 'test'\"" - postgres
export POSTGRES_USER=test POSTGRES_PASS=test
# Run the functional tests
REVAULTD_PATH=$PWD/target/release/revaultd pytest $TEST_GROUP -vvv -n 2
before_cache_script: rm -rf $CARGO_HOME/registry/index