Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Test against core 1.0.0-alpha.3 from lisk-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
francoilol committed Mar 27, 2018
1 parent 27f59fc commit c59ae6e
Showing 1 changed file with 20 additions and 31 deletions.
51 changes: 20 additions & 31 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,34 +42,6 @@ node('lisk-nano') {
echo "Error: ${err}"
fail('Stopping build: checkout failed')
}

try {
sh '''
N=${EXECUTOR_NUMBER:-0}; N=$((N+1))
cd ~/lisk-Linux-x86_64
# work around core bug: config.json gets overwritten; use backup
cp .config.json config_$N.json
# change core port, listen only on 127.0.0.1
sed -i -r -e "s/^(.*ort\\":) 4000,/\\1 400$N,/" config_$N.json
sed -i -r -e "s/^(.*\\"address\\":) \\"0.0.0.0\\",/\\1 \\"127.0.0.1\\",/" config_$N.json
# disable redis
sed -i -r -e "s/^(\\s*\\"cacheEnabled\\":) true/\\1 false/" config_$N.json
# change postgres databse
sed -i -r -e "s/^(\\s*\\"database\\": \\"lisk_test)\\",/\\1_$N\\",/" config_$N.json
cp etc/pm2-lisk.json etc/pm2-lisk_$N.json
sed -i -r -e "s/config.json/config_$N.json/" etc/pm2-lisk_$N.json
sed -i -r -e "s/(lisk.app)/\\1_$N/" etc/pm2-lisk_$N.json
# logs
sed -i -r -e "s/lisk.log/lisk_${JOB_BASE_NAME}_${BUILD_ID}.log/" config_$N.json
sed -i -r -e "s/lisk.app_$N/lisk.app_$N_${JOB_BASE_NAME}_${BUILD_ID}/" etc/pm2-lisk_$N.json
#
JENKINS_NODE_COOKIE=dontKillMe bash lisk.sh start_db -p etc/pm2-lisk_$N.json
bash lisk.sh rebuild -p etc/pm2-lisk_$N.json -f blockchain_explorer.db.gz
'''
} catch (err) {
echo "Error: ${err}"
fail('Stopping build: Lisk Core failed to start')
}
}

stage ('Install npm dependencies') {
Expand Down Expand Up @@ -144,14 +116,21 @@ node('lisk-nano') {
export DISPLAY=:1$N
Xvfb :1$N -ac -screen 0 1280x1024x24 &
cp -r ~/lisk-docker/examples/development $WORKSPACE/$BRANCH_NAME
cd $WORKSPACE/$BRANCH_NAME
cp /home/lisk/blockchain_explorer.db.gz ./blockchain.db.gz
LISK_VERSION=1.0.0-alpha.3 make coldstart
LISK_PORT=$( docker-compose port lisk 4000 |cut -d ":" -f 2 )
cd -
# Run end-to-end tests
if [ -z $CHANGE_BRANCH ]; then
npm run --silent e2e-test -- --params.baseURL file://$WORKSPACE/app/build/index.html --params.liskCoreURL https://testnet.lisk.io --cucumberOpts.tags @testnet --params.useTestnetPassphrase true
else
echo "Skipping @testnet end-to-end tests because we're not on 'development' branch"
fi
npm run --silent e2e-test -- --params.baseURL file://$WORKSPACE/app/build/index.html --params.liskCoreURL http://127.0.0.1:400$N
npm run --silent e2e-test -- --params.baseURL file://$WORKSPACE/app/build/index.html --params.liskCoreURL http://127.0.0.1:$LISK_PORT
if [ -z $CHANGE_BRANCH ]; then
npm run --silent e2e-test -- --params.baseURL file://$WORKSPACE/app/build/index.html --cucumberOpts.tags @testnet --params.useTestnetPassphrase true --params.network testnet
else
Expand All @@ -167,11 +146,21 @@ node('lisk-nano') {
}
} catch(err) {
echo "Error: ${err}"
ansiColor('xterm') {
sh '''
cd $WORKSPACE/$BRANCH_NAME
docker-compose logs
'''
}
} finally {
ansiColor('xterm') {
sh '''
cd $WORKSPACE/$BRANCH_NAME
make mrproper
'''
}
sh '''
N=${EXECUTOR_NUMBER:-0}; N=$((N+1))
curl --verbose http://127.0.0.1:400$N/api/blocks/getNethash || true
( cd ~/lisk-Linux-x86_64 && bash lisk.sh stop_node -p etc/pm2-lisk_$N.json ) || true
pgrep --list-full -f "Xvfb :1$N" || true
pkill --echo -f "Xvfb :1$N" -9 || echo "pkill returned code $?"
Expand Down

0 comments on commit c59ae6e

Please sign in to comment.