1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

run E2E tests against local Spree

This commit is contained in:
Matthias Kretschmann 2019-07-17 16:30:43 +02:00
parent 0a196f462a
commit 62cc0b407d
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 47 additions and 9 deletions

View File

@ -4,6 +4,10 @@ language: node_js
node_js:
- '11'
services:
- mongodb
- docker
addons:
apt:
packages:
@ -12,13 +16,18 @@ addons:
env:
global:
# run E2E tests against these values
- REACT_APP_NODE_URI="https://pacific.oceanprotocol.com"
- REACT_APP_AQUARIUS_URI="https://aquarius.test.oceanprotocol.com"
- REACT_APP_BRIZO_URI="https://brizo.test.oceanprotocol.com"
- REACT_APP_SECRET_STORE_URI="https://secret-store.oceanprotocol.com"
- REACT_APP_FAUCET_URI="https://faucet.oceanprotocol.com"
- REACT_APP_BRIZO_ADDRESS="0x0474ed05ba757dde575dfaaaa267d9e7f3643abc"
# run E2E tests against local Spree
- REACT_APP_NODE_URI="http://localhost:8545"
- REACT_APP_AQUARIUS_URI="http://localhost:5000"
- REACT_APP_BRIZO_URI="http://localhost:8030"
- REACT_APP_SECRET_STORE_URI="http://localhost:12001"
- REACT_APP_FAUCET_URI="http://localhost:3001"
- REACT_APP_BRIZO_ADDRESS="0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e"
- AQUARIUS_VERSION=v0.3.8
- BRIZO_VERSION=v0.3.14
- KEEPER_VERSION=v0.10.3
- KEEPER_OWNER_ROLE_ADDRESS="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260"
- MONGO_URL="mongodb://localhost:27017/faucetdbtest"
before_install:
- npm install -g npm
@ -27,12 +36,22 @@ before_install:
# https://stackoverflow.com/questions/22475849/node-js-error-enospc#32600959
- echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
before_script:
# Faucet
- docker run -d -p 127.0.0.1:3001:3001 oceanprotocol/faucet > faucet.log &
# Barge
- git clone https://github.com/oceanprotocol/barge
- cd barge
- bash -x start_ocean.sh --no-pleuston --local-spree-node 2>&1 > start_ocean.log &
- cd ..
script:
# - ./scripts/install.sh # runs automatically with npm ci
# executing `npm test` scripts individually here, so first one failing will exit the build
- npm run lint || travis_terminate 1
- ./scripts/test.sh || travis_terminate 1
- ./scripts/coverage.sh
- ./scripts/keeper.sh
- npm run test:e2e || travis_terminate 1
- ./scripts/build.sh
@ -42,8 +61,6 @@ notifications:
cache:
npm: true
directories:
- client/node_modules
- server/node_modules
# cache folder with Cypress binary
- ~/.cache

21
scripts/keeper.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
# Wait for contracts migration and extract Keeper artifacts
RETRY_COUNT=0
COMMAND_STATUS=1
mkdir -p artifacts
until [ $COMMAND_STATUS -eq 0 ] || [ $RETRY_COUNT -eq 120 ]; do
keeper_contracts_docker_id=$(docker container ls | grep keeper-contracts | awk '{print $1}')
docker cp ${keeper_contracts_docker_id}:/keeper-contracts/artifacts/ready ./artifacts/
COMMAND_STATUS=$?
sleep 5
let RETRY_COUNT=RETRY_COUNT+1
done
if [ $COMMAND_STATUS -ne 0 ]; then
echo "Waited for more than two minutes, but keeper contracts have not been migrated yet. Did you run an Ethereum RPC client and the migration script?"
exit 1
fi