-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: implement docker e2e ci job (#222)
* few docker related updates * few minor updates in docker * docker and config file related changes * add: implement docker e2e ci / parallelize CIs * chg: ci lint name * addressed comments * chg: fix lint * chg: do not cancel in progress * chg: ci docker job name * chg: unify CIs * build(deps): bump follow-redirects from 1.15.3 to 1.15.4 (#219) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.3 to 1.15.4. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](follow-redirects/follow-redirects@v1.15.3...v1.15.4) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chg: use bor_health in integration tests / merge dependabot PR * chg: use new bor paths for integration tests * chg: remove bor related chaindata upload in ci * chg: remove reduntant npm install --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Pratik Patil <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ca14b9b
commit f971c88
Showing
5 changed files
with
441 additions
and
3,536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
defaultStake: 10000 | ||
defaultFee: 2000 | ||
borChainId: 15001 | ||
heimdallChainId: heimdall-15001 | ||
contractsBranch: mardizzone/node-16 | ||
genesisContractsBranch: master | ||
sprintSize: | ||
- '64' | ||
blockNumber: | ||
- '0' | ||
blockTime: | ||
- '2' | ||
numOfBorValidators: 3 | ||
numOfBorSentries: 0 | ||
numOfBorArchiveNodes: 0 | ||
numOfErigonValidators: 0 | ||
numOfErigonSentries: 0 | ||
numOfErigonArchiveNodes: 0 | ||
ethURL: http://ganache:9545 | ||
ethHostUser: ubuntu | ||
devnetType: docker | ||
borDockerBuildContext: 'https://github.com/maticnetwork/bor.git#develop' | ||
heimdallDockerBuildContext: 'https://github.com/maticnetwork/heimdall.git#develop' | ||
sprintSizeBlockNumber: | ||
- '0' | ||
devnetBorFlags: config,config,config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
while true | ||
do | ||
peers=$(docker exec bor0 bash -c "bor attach /root/var/lib/bor/data/bor.ipc -exec 'admin.peers'") | ||
block=$(docker exec bor0 bash -c "bor attach /root/var/lib/bor/data/bor.ipc -exec 'eth.blockNumber'") | ||
|
||
if [[ -n "$peers" ]] && [[ -n "$block" ]]; then | ||
break | ||
fi | ||
done | ||
|
||
echo $peers | ||
echo $block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
balanceInit=$(docker exec bor0 bash -c "bor attach /root/var/lib/bor/data/bor.ipc -exec 'Math.round(web3.fromWei(eth.getBalance(eth.accounts[0])))'") | ||
|
||
stateSyncFound="false" | ||
checkpointFound="false" | ||
SECONDS=0 | ||
start_time=$SECONDS | ||
|
||
while true | ||
do | ||
|
||
balance=$(docker exec bor0 bash -c "bor attach /root/var/lib/bor/data/bor.ipc -exec 'Math.round(web3.fromWei(eth.getBalance(eth.accounts[0])))'") | ||
|
||
if ! [[ "$balance" =~ ^[0-9]+$ ]]; then | ||
echo "Something is wrong! Can't find the balance of first account in bor network." | ||
exit 1 | ||
fi | ||
|
||
if (( $balance > $balanceInit )); then | ||
if [ $stateSyncFound != "true" ]; then | ||
stateSyncTime=$(( SECONDS - start_time )) | ||
stateSyncFound="true" | ||
fi | ||
fi | ||
|
||
checkpointID=$(curl -sL http://localhost:1317/checkpoints/latest | jq .result.id) | ||
|
||
if [ $checkpointID != "null" ]; then | ||
if [ $checkpointFound != "true" ]; then | ||
checkpointTime=$(( SECONDS - start_time )) | ||
checkpointFound="true" | ||
fi | ||
fi | ||
|
||
if [ $stateSyncFound == "true" ] && [ $checkpointFound == "true" ]; then | ||
break | ||
fi | ||
|
||
done | ||
echo "Both state sync and checkpoint went through. All tests have passed!" | ||
echo "Time taken for state sync: $(printf '%02dm:%02ds\n' $(($stateSyncTime%3600/60)) $(($stateSyncTime%60)))" | ||
echo "Time taken for checkpoint: $(printf '%02dm:%02ds\n' $(($checkpointTime%3600/60)) $(($checkpointTime%60)))" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.