Skip to content

Commit

Permalink
Update ci/ethereum_test to check echo_server/RunLog
Browse files Browse the repository at this point in the history
  • Loading branch information
dimroc authored and se3000 committed May 4, 2018
1 parent 61d41db commit 4a1faf6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
1 change: 1 addition & 0 deletions internal/bin/cldev
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export ROOT=./internal/clroot
export ETH_URL=ws://localhost:18546
export ETH_CHAIN_ID=17
export TX_MIN_CONFIRMATIONS=2
export MINIMUM_CONTRACT_PAYMENT=1000000000000

LDFLAGS="-X github.com/smartcontractkit/chainlink/store.Sha=`git rev-parse HEAD`"

Expand Down
33 changes: 28 additions & 5 deletions internal/ci/ethereum_test
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,52 @@ cd examples/echo_server
yarn install
truffle migrate
node echo.js &
sleep 1

########################
## runlog
########################

./send_runlog_transaction.js
sleep 2

# Check echo count
count=`curl -sS localhost:6690/count`
assert "Echo count" 1 $count

# Check CL counts
cd ../../

## Check job counts using jq to parse json: https://stedolan.github.io/jq/
jobs=`cldev -j j | jq length`
assert "Jobs count" 1 $jobs

# Check job runs
jid=`cldev -j j | jq 'first | .id' | tr -d '"'`
runs=`cldev -j s $jid | jq '.runs | length'`
assert "RunLog Runs count" 1 $runs

########################
## ethlog
########################

cd examples/echo_server
ethjob=`./create_ethlog_job`
./send_ethlog_transaction.js
sleep 2

# Check echo count
count=`curl -sS localhost:6690/count`
assert "Echo count" 1 $count
assert "Echo count" 2 $count

# Check CL counts
cd ../../

## Check job counts
jobs=`cldev -j j | jq length`
assert "Jobs count" 1 $jobs
assert "Jobs count" 2 $jobs

## Check job runs
jid=`echo $ethjob | jq .id | tr -d '"'`
echo Retrieved job id $jid
runs=`cldev -j s $jid | jq '.runs | length'`
echo Retrieved $runs runs
assert "Runs count" 1 $runs
assert "EthLog Runs count" 1 $runs

0 comments on commit 4a1faf6

Please sign in to comment.