Skip to content

Commit 4357857

Browse files
committed
ci: add missing gh job for event-replay test suite
1 parent fdf56bc commit 4357857

File tree

3 files changed

+60
-2
lines changed

3 files changed

+60
-2
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,62 @@ jobs:
168168
flag-name: run-${{ github.job }}
169169
parallel: true
170170

171+
test-event-replay:
172+
runs-on: ubuntu-latest
173+
steps:
174+
- uses: actions/checkout@v2
175+
176+
- name: Use Node.js
177+
uses: actions/setup-node@v2
178+
with:
179+
node-version-file: '.nvmrc'
180+
181+
- name: Cache node modules
182+
uses: actions/cache@v2
183+
env:
184+
cache-name: cache-node-modules
185+
with:
186+
path: |
187+
~/.npm
188+
**/node_modules
189+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
190+
restore-keys: |
191+
${{ runner.os }}-build-${{ env.cache-name }}-
192+
${{ runner.os }}-build-
193+
${{ runner.os }}-
194+
195+
- name: Install deps
196+
run: npm ci --audit=false
197+
198+
- name: Setup integration environment
199+
run: |
200+
sudo ufw disable
201+
docker compose -f docker/docker-compose.dev.postgres.yml up -d
202+
npm run devenv:logs -- --no-color &> docker-compose-logs.txt &
203+
204+
- name: Run RPC tests
205+
run: npm run test:event-replay
206+
207+
- name: Print integration environment logs
208+
run: cat docker-compose-logs.txt
209+
if: failure()
210+
211+
- name: Teardown integration environment
212+
run: npm run devenv:stop
213+
if: always()
214+
215+
- name: Upload coverage to Codecov
216+
uses: codecov/codecov-action@v2
217+
if: always()
218+
219+
- name: Upload coverage to Coveralls
220+
uses: coverallsapp/github-action@master
221+
if: always()
222+
with:
223+
github-token: ${{ secrets.github_token }}
224+
flag-name: run-${{ github.job }}
225+
parallel: true
226+
171227
test-rpc:
172228
runs-on: ubuntu-latest
173229
steps:

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"test:rosetta-cli:construction": "cross-env NODE_ENV=development STACKS_CHAIN_ID=0x80000000 jest --config ./tests/jest.config.rosetta-cli-construction.js --coverage --runInBand",
1616
"test:bns": "cross-env NODE_ENV=development jest --config ./tests/jest.config.bns.js --coverage --runInBand",
1717
"test:rpc": "cross-env NODE_ENV=development jest --config ./tests/jest.config.rpc.js --coverage --runInBand",
18+
"test:event-replay": "cross-env NODE_ENV=development jest --config ./tests/jest.config.event-replay.js --coverage --runInBand",
1819
"test:btc-faucet": "cross-env NODE_ENV=development jest --config ./tests/jest.config.btc-faucet.js --coverage --runInBand",
1920
"test:tokens": "cross-env NODE_ENV=development jest --config ./tests/jest.config.tokens.js --coverage --runInBand",
2021
"test:watch": "cross-env NODE_ENV=development jest --config ./tests/jest.config.js --watch",
@@ -27,6 +28,7 @@
2728
"test:integration:bns": "concurrently \"docker compose -f docker/docker-compose.dev.postgres.yml -f docker/docker-compose.dev.stacks-blockchain.yml up --force-recreate -V\" \"cross-env NODE_ENV=development jest --config ./tests/jest.config.bns.js --no-cache --runInBand; npm run devenv:stop\"",
2829
"test:integration:tokens": "concurrently \"docker compose -f docker/docker-compose.dev.postgres.yml -f docker/docker-compose.dev.stacks-blockchain.yml up --force-recreate -V\" \"cross-env NODE_ENV=development jest --config ./tests/jest.config.tokens.js --no-cache --runInBand; npm run devenv:stop\"",
2930
"test:integration:rpc": "concurrently \"docker compose -f docker/docker-compose.dev.postgres.yml -f docker/docker-compose.dev.stacks-blockchain.yml up --force-recreate -V\" \"cross-env NODE_ENV=development jest --config ./tests/jest.config.rpc.js --no-cache --runInBand; npm run devenv:stop\"",
31+
"test:integration:event-replay": "concurrently \"docker compose -f docker/docker-compose.dev.postgres.yml up --force-recreate -V\" \"cross-env NODE_ENV=development jest --config ./tests/jest.config.event-replay.js --no-cache --runInBand; npm run devenv:stop\"",
3032
"test:integration:btc-faucet": "concurrently \"docker compose -f docker/docker-compose.dev.postgres.yml -f docker/docker-compose.dev.bitcoind.yml up --force-recreate -V\" \"cross-env NODE_ENV=development jest --config ./tests/jest.config.btc-faucet.js --no-cache --runInBand; npm run devenv:stop\"",
3133
"generate:git-info": "node ./git-info-generator.mjs",
3234
"build": "npm run generate:git-info && rimraf ./lib && tsc -p tsconfig.build.json",

jest.config.event-replay.js renamed to tests/jest.config.event-replay.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
module.exports = {
22
preset: 'ts-jest',
3-
rootDir: 'src',
3+
rootDir: `${require('path').dirname(__dirname)}/src`,
44
testMatch: ['<rootDir>/tests-event-replay/**/*.ts'],
55
testPathIgnorePatterns: [
66
'<rootDir>/tests-event-replay/setup.ts',
77
'<rootDir>/tests-event-replay/teardown.ts',
88
],
99
collectCoverageFrom: ['<rootDir>/**/*.ts'],
1010
coveragePathIgnorePatterns: ['<rootDir>/tests*'],
11-
coverageDirectory: '../coverage',
11+
coverageDirectory: '<rootDir>/../coverage',
1212
globalSetup: '<rootDir>/tests-event-replay/setup.ts',
1313
globalTeardown: '<rootDir>/tests-event-replay/teardown.ts',
1414
testTimeout: 20000,

0 commit comments

Comments
 (0)