This repository has been archived by the owner on Oct 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathtest-dapp.sh
executable file
·102 lines (79 loc) · 1.81 KB
/
test-dapp.sh
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
# Runs the test suites for dapps against our gateway.
# CLI args: "augur", "celer" or "ens".
# Helpful tips on writing build scripts:
# https://buildkite.com/docs/pipelines/writing-build-scripts
set -euxo pipefail
WORKDIR=$(pwd)
source scripts/utils.sh $WORKDIR
# Ensure cleanup on exit.
# cleanup() is defined in scripts/utils.sh
trap 'cleanup' EXIT
run_test() {
source ./scripts/oasis.sh false
run_test_network
# Location for all the dapp repos
mkdir -p /tmp/dapps
cd /tmp/dapps
run_dapp $1
# Dump gateway metrics
curl -v http://localhost:3001/metrics
}
run_dapp() {
case "$1" in
"augur")
run_augur
;;
"celer")
run_celer
;;
"ens")
run_ens
;;
esac
}
run_ens() {
if [ ! -d ens ]; then
git clone \
https://github.com/oasislabs/ens.git \
--depth 1 \
--branch ekiden
fi
cd ens
git pull
npm install > /dev/null
npm run test
}
run_celer() {
if [ ! -d cChannel-eth ]; then
git clone \
https://github.com/oasislabs/cChannel-eth.git \
--depth 1 \
--branch ekiden
fi
cd cChannel-eth
git pull
npm install > /dev/null
npm run test
}
run_augur() {
apt-get update
apt-get install -y python3-pip
pip3 install virtualenv
npm install npx
if [ ! -d augur-core ]; then
git clone \
https://github.com/oasislabs/augur-core.git \
--depth 1 \
--branch ekiden
fi
cd augur-core
git pull
npm install > /dev/null
pip3 install -r requirements.txt
export OASIS_PRIVATE_KEY=c61675c22aee77da8f6e19444ece45557dc80e1482aa848f541e94e3e5d91179
export PATH=$PATH:$(pwd)/bin
npm run build
npm run test:integration
}
run_test $1