Skip to content

Commit

Permalink
Improving GitHub Actions tests (#886)
Browse files Browse the repository at this point in the history
* fix: moving compression.mjs and fq2.mjs to common-files + adding a 'test' script

* fix: deprecating 'neg-http.mjs' test and removing it from package.json script

* fix: adding script for running general test stuff

* fix: organizing scripts; adding new ones for allowing running in GA

* fix: refactoring to fix test names

* fix: adding new actions to GA pipeline

* fix: removing 'id' element from GA

* fix: fixing 'needs' dependency

Co-authored-by: Israel Boudoux <iboudoux@polygon.technology>
  • Loading branch information
israelboudoux and Israel Boudoux authored Aug 22, 2022
1 parent 8487eb2 commit a18899d
Show file tree
Hide file tree
Showing 8 changed files with 667 additions and 100 deletions.
90 changes: 71 additions & 19 deletions .github/workflows/check-PRs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ on:

jobs:
dependency-review:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v1.0.2

eslint-check:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: '14.17.0'
Expand All @@ -28,10 +28,69 @@ jobs:
cd ..
npm run lint
general-tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: '14.17.0'
- name: General Tests
run: |
npm ci
npm run test-general-stuff
cd common-files
npm ci
npm run test
circuits-test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: '14.17.0'

- name: Start Containers
run: |
./setup-nightfall
./start-nightfall -g -d &> circuit-test.log &disown
- name: Wait for images to be ready
uses: Wandalen/wretry.action@v1.0.11
with:
command: |
docker wait nightfall_3_deployer_1
attempt_limit: 100
attempt_delay: 20000

- name: Debug logs - after image builds
if: always()
run: cat circuit-test.log

- name: Circuits Test
run: |
npm run test-circuits
- name: Debug logs - after integration test run
if: always()
run: cat circuit-test.log

- name: If integration test failed, shutdown the Containers
if: failure()
run: docker-compose -f docker-compose.yml -f docker-compose.ganache.yml down -v

- name: If integration test failed, upload logs files as artifacts
if: failure()
uses: actions/upload-artifact@master
with:
name: circuit-test-logs
path: ./circuit-test.log

ganache-test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: '14.17.0'
Expand All @@ -55,8 +114,6 @@ jobs:

- name: Run integration test
run: |
npm ci
docker wait nightfall_3_deployer_1
npm run test-e2e-protocol
npm run test-e2e-tokens
Expand All @@ -76,11 +133,11 @@ jobs:
path: ./ganache-test.log

adversary-test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
env:
TRANSACTIONS_PER_BLOCK: 32
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: '14.17.0'
Expand Down Expand Up @@ -109,9 +166,7 @@ jobs:

- name: Run integration test
run: |
npm ci
docker wait nightfall_3_deployer_1
VERBOSE=true npm run adversary-test
VERBOSE=true npm run test-adversary
- name: debug logs - after integration test run
if: always()
Expand All @@ -125,15 +180,15 @@ jobs:
- name: If integration test failed, upload logs files as artifacts
if: failure()
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v3
with:
name: adversary-test-logs
path: ./adversary-test.log

ping-pong-test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: '14.17.0'
Expand All @@ -155,7 +210,6 @@ jobs:
uses: Wandalen/wretry.action@v1.0.11
with:
command: |
docker ps
docker wait ping-pong_deployer_1
attempt_limit: 100
attempt_delay: 20000
Expand Down Expand Up @@ -189,7 +243,7 @@ jobs:
name: check gas for 32 transactions per block
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: '14.17.0'
Expand All @@ -205,7 +259,6 @@ jobs:
uses: Wandalen/wretry.action@v1.0.11
with:
command: |
docker ps
docker wait nightfall_3_deployer_1
attempt_limit: 100
attempt_delay: 20000
Expand All @@ -216,7 +269,6 @@ jobs:

- name: Run tx-gas.mjs test suites
run: |
npm ci
VERBOSE=true npm run test-gas
- name: Debug logs - after integration test run
Expand Down
Loading

0 comments on commit a18899d

Please sign in to comment.