From 0b6c76f499ea4b3aafa581b80048ad3d5f2e3b1a Mon Sep 17 00:00:00 2001 From: Antony Denyer Date: Mon, 21 Feb 2022 08:39:41 +0000 Subject: [PATCH] build - add PEEPS tests (#1327) --- .github/workflows/build.yml | 38 ++++++++++++++++++ .github/workflows/pr.yml | 38 +++++++++++++++++- .gitignore | 4 +- build/install-constellation-linux.sh | 7 ---- build/install-constellation-mac.sh | 15 ------- build/run-peeps.sh | 13 ++++++ build/travis-install-linux.sh | 42 -------------------- build/travis-run-acceptance-tests-linux.sh | 20 ---------- build/travis_keepalive.sh | 46 ---------------------- 9 files changed, 91 insertions(+), 132 deletions(-) delete mode 100755 build/install-constellation-linux.sh delete mode 100755 build/install-constellation-mac.sh create mode 100755 build/run-peeps.sh delete mode 100755 build/travis-install-linux.sh delete mode 100755 build/travis-run-acceptance-tests-linux.sh delete mode 100755 build/travis_keepalive.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9fa23f9cc5..a9e45b55d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -230,6 +230,43 @@ jobs: run: | docker images docker ps -a + peeps-tests: + name: Run PEEPS tests + needs: + - docker-build + runs-on: ubuntu-18.04 + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + - name: 'Download workflow artifact - Docker image' + uses: actions/download-artifact@v1 + with: + name: docker-image + - name: 'Load Docker image' + id: setup + run: | + tar xfvz docker-image/quorum-pr.tar.gz + docker load --input quorum-pr.tar + docker image tag quorumengineering/quorum:pr quorumengineering/quorum:develop + docker image ls + - name: Set up Java + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: 11 + check-latest: true + - name: PEEPS + run: | + cd build + ./run-peeps.sh + - name: PEEPS Test Report + uses: mikepenz/action-junit-report@v2 + if: always() + with: + report_paths: '**/build/test-results/*/TEST-*.xml' + check_name: PEEPS test report + + publish-docker: name: Publish Docker Image needs: @@ -453,6 +490,7 @@ jobs: curl -X POST ${{ secrets.SLACK_WEBHOOK_URL }} -H "Content-type: application/json" --data "@${1}" } _post "long_message.json" || _post "short_message.json" + build-sentinel: if: always() needs: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 57081776fb..518cf55b6e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -69,10 +69,46 @@ jobs: tar cfvz $output_dir/quorum-pr.tar.gz quorum-pr.tar echo "::set-output name=output_dir::$output_dir" - name: 'Upload workflow artifact - Docker image' - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v2 with: name: docker-image path: ${{ steps.build.outputs.output_dir }} + peeps-tests: + name: Run PEEPS tests + needs: + - docker-build + runs-on: ubuntu-18.04 + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + - name: 'Download workflow artifact - Docker image' + uses: actions/download-artifact@v1 + with: + name: docker-image + - name: 'Load Docker image' + id: setup + run: | + tar xfvz docker-image/quorum-pr.tar.gz + docker load --input quorum-pr.tar + docker image tag quorumengineering/quorum:pr quorumengineering/quorum:develop + docker image ls + - name: Set up Java + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: 11 + check-latest: true + - name: PEEPS + run: | + cd build + ./run-peeps.sh + - name: PEEPS Test Report + uses: mikepenz/action-junit-report@v2 + if: always() + with: + report_paths: '**/build/test-results/*/TEST-*.xml' + check_name: PEEPS test report + acceptance-tests: name: Acceptance tests (${{ matrix.tag }}) needs: diff --git a/.gitignore b/.gitignore index f1fcc40fa5..65b2e259a8 100644 --- a/.gitignore +++ b/.gitignore @@ -51,4 +51,6 @@ profile.cov **/yarn-error.log # QUORUM -generated-release-notes.md \ No newline at end of file +generated-release-notes.md + +build/PEEPS diff --git a/build/install-constellation-linux.sh b/build/install-constellation-linux.sh deleted file mode 100755 index 17cb323a5d..0000000000 --- a/build/install-constellation-linux.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -curl -L https://github.com/jpmorganchase/constellation/releases/download/v0.3.2/constellation-0.3.2-ubuntu1604.tar.xz -o constellation.tar.xz - -tar xf constellation.tar.xz - -export PATH \ No newline at end of file diff --git a/build/install-constellation-mac.sh b/build/install-constellation-mac.sh deleted file mode 100755 index 6bae76b0cb..0000000000 --- a/build/install-constellation-mac.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -echo "Going into $HOME" -cd $HOME - -echo "Cloning Constellation repo" -git clone https://github.com/jpmorganchase/constellation.git - -cd constellation - -echo "Running stack setup in $(pwd)" -stack setup - -echo "Now installing Constellation from $(pwd)" -stack install \ No newline at end of file diff --git a/build/run-peeps.sh b/build/run-peeps.sh new file mode 100755 index 0000000000..527f64bc29 --- /dev/null +++ b/build/run-peeps.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +if ! git clone https://github.com/ConsenSys/PEEPS.git +then + cd PEEPS + git reset --hard HEAD + git pull origin master +else + cd PEEPS +fi + +./gradlew --no-daemon --parallel endToEndTest + diff --git a/build/travis-install-linux.sh b/build/travis-install-linux.sh deleted file mode 100755 index e18e2139e5..0000000000 --- a/build/travis-install-linux.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -set -e -# install geth and dependencies for acceptance tests -echo "---> install started ..." -echo "---> installing tools ..." -sudo apt-get update -# upgrade dpkg to fix issue with trusty: dpkg-deb: error -sudo apt-get -y install dpkg -java -version -mvn --version - -sudo wget https://github.com/ethereum/solidity/releases/download/v0.5.4/solc-static-linux -O /usr/local/bin/solc -q -sudo chmod +x /usr/local/bin/solc -solc --version -echo "---> tools installation done" - -echo "---> building geth ..." -sudo modprobe fuse -sudo chmod 666 /dev/fuse -sudo chown root:${USER} /etc/fuse.conf -go run build/ci.go install -echo "---> building geth done" - -echo "---> cloning quorum-cloud and quorum-acceptance-tests ..." -git clone https://github.com/jpmorganchase/quorum-acceptance-tests.git ${TRAVIS_HOME}/quorum-acceptance-tests -git clone https://github.com/jpmorganchase/quorum-cloud.git ${TRAVIS_HOME}/quorum-cloud - -echo "---> cloning done" - -echo "---> getting tessera jar ..." -wget https://oss.sonatype.org/service/local/repositories/releases/content/com/jpmorgan/quorum/tessera-app/0.10.4/tessera-app-0.10.4-app.jar -O $HOME/tessera.jar -q -echo "---> tessera done" - -echo "---> getting gauge jar ..." -wget https://github.com/getgauge/gauge/releases/download/v1.0.8/gauge-1.0.8-linux.x86_64.zip -O gauge.zip -q -sudo unzip -o gauge.zip -d /usr/local/bin -gauge telemetry off -cd ${TRAVIS_HOME}/quorum-acceptance-tests -gauge install -echo "---> gauge installation done" - -echo "---> install done" \ No newline at end of file diff --git a/build/travis-run-acceptance-tests-linux.sh b/build/travis-run-acceptance-tests-linux.sh deleted file mode 100755 index 66ad3c5605..0000000000 --- a/build/travis-run-acceptance-tests-linux.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -e -# start network and run acceptance tests -echo "---> start quorum network for consensus ${TF_VAR_consensus_mechanism} ..." -java --version -export PATH=${TRAVIS_BUILD_DIR}/build/bin:$PATH -export TESSERA_JAR=${HOME}/tessera.jar -cd ${TRAVIS_HOME}/quorum-cloud/travis/4nodes -./init.sh ${TF_VAR_consensus_mechanism} -./start.sh ${TF_VAR_consensus_mechanism} tessera -echo "---> network started" -cd ${TRAVIS_HOME}/quorum-acceptance-tests -cp config/application-local.4nodes.yml config/application-local.yml -echo "---> run acceptance tests for consensus ${TF_VAR_consensus_mechanism} ..." -java --version -./src/travis/run_tests.sh -echo "---> acceptance tests finished" -echo "---> stop the network..." -${TRAVIS_HOME}/quorum-cloud/travis/4nodes/stop.sh -echo "---> network stopped" \ No newline at end of file diff --git a/build/travis_keepalive.sh b/build/travis_keepalive.sh deleted file mode 100755 index 77cc623eaf..0000000000 --- a/build/travis_keepalive.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash - -# travis_keepalive runs the given command and preserves its return value, -# while it forks a child process what periodically produces a log line, -# so that Travis won't abort the build after 10 minutes. - -# Why? -# `t.Log()` in Go holds the buffer until the test does not pass or fail, -# and `-race` can increase the execution time by 2-20x. - -set -euo pipefail - -readonly KEEPALIVE_INTERVAL=300 # seconds => 5m - -main() { - keepalive - $@ -} - -# Keepalive produces a log line in each KEEPALIVE_INTERVAL. -keepalive() { - local child_pid - # Note: We fork here! - repeat "keepalive" & - child_pid=$! - ensureChildOnEXIT "${child_pid}" -} - -repeat() { - local this="$1" - while true; do - echo "${this}" - sleep "${KEEPALIVE_INTERVAL}" - done -} - -# Ensures that the child gets killed on normal program exit. -ensureChildOnEXIT() { - # Note: SIGINT and SIGTERM are forwarded to the child process by Bash - # automatically, so we don't have to deal with signals. - - local child_pid="$1" - trap "kill ${child_pid}" EXIT -} - -main "$@"