2019-06-27 09:57:45 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
cd $(dirname $0)
|
|
|
|
set -e # exit when any command fails
|
|
|
|
|
|
|
|
|
|
|
|
##### Helper Functions #####
|
|
|
|
|
|
|
|
function cleanup {
|
|
|
|
../e2e-commons/down.sh
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
|
|
|
FILES=(getBalances.json validators.json eventsStats.json alerts.json)
|
|
|
|
|
|
|
|
check_files_exist() {
|
|
|
|
rc=0
|
|
|
|
for f in "${FILES[@]}"; do
|
|
|
|
command="test -f responses/$f"
|
|
|
|
(docker-compose -f ../e2e-commons/docker-compose.yml exec monitor /bin/bash -c "$command") || rc=1
|
2019-08-01 10:26:20 +02:00
|
|
|
(docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-erc20 /bin/bash -c "$command") || rc=1
|
|
|
|
(docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-erc20-native /bin/bash -c "$command") || rc=1
|
2019-06-27 09:57:45 +02:00
|
|
|
done
|
|
|
|
return $rc
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
##### Initialization #####
|
|
|
|
|
2019-08-01 10:26:20 +02:00
|
|
|
../e2e-commons/up.sh deploy oracle monitor
|
2019-06-27 09:57:45 +02:00
|
|
|
|
|
|
|
|
2019-08-01 10:26:20 +02:00
|
|
|
##### Initial checks #####
|
2019-06-27 09:57:45 +02:00
|
|
|
|
2019-08-01 10:26:20 +02:00
|
|
|
docker-compose -f ../e2e-commons/docker-compose.yml exec monitor /bin/bash -c "yarn check-all"
|
|
|
|
docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-erc20 /bin/bash -c "yarn check-all"
|
|
|
|
docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-erc20-native /bin/bash -c "yarn check-all"
|
2019-06-27 09:57:45 +02:00
|
|
|
check_files_exist
|
|
|
|
|
2019-08-01 10:26:20 +02:00
|
|
|
|
|
|
|
##### Test cases #####
|
|
|
|
|
|
|
|
./native-to-erc.sh
|
|
|
|
|
|
|
|
./erc-to-erc.sh
|
|
|
|
|
|
|
|
./erc-to-native.sh
|
2019-06-27 09:57:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
##### Cleanup #####
|
|
|
|
|
|
|
|
cleanup
|