Skip to content

Commit a423831

Browse files
committed
fix(ci): exclude signing spec from mock-based coverage config and bump thresholds
The signing spec requires real @stellar/stellar-sdk crypto (Keypair.random(), authorizeEntry, xdr classes) which is incompatible with the moduleNameMapper in jest-coverage.js that replaces the SDK with a mock. Exclude it from the coverage config and run it in a separate CI step using the base jest config. Also bump soroban.adapter.ts coverage thresholds to accommodate the new client-signing seam methods.
1 parent 9a195e5 commit a423831

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/backend-ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ jobs:
7676
REDIS_PORT: '6379'
7777
run: pnpm --filter backend run test:cov
7878

79+
- name: Test signing specs (real SDK, no mock)
80+
env:
81+
API_KEY: test-api-key-123
82+
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/chainforge_test?schema=public
83+
NODE_ENV: test
84+
REDIS_HOST: 127.0.0.1
85+
REDIS_PORT: '6379'
86+
run: pnpm --filter backend run test:signing
87+
7988
- name: Build
8089
run: pnpm --filter backend run build
8190

app/backend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"test": "jest",
2525
"test:watch": "jest --watch",
2626
"test:cov": "jest --config ./test/jest-coverage.js --coverage",
27+
"test:signing": "jest --testPathPattern='soroban\\.adapter\\.signing\\.spec'",
2728
"coverage:baseline": "node ./test/generate-coverage-baseline.js",
2829
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
2930
"test:e2e": "jest --config ./test/jest-e2e.json",

app/backend/test/coverage-baseline.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
["src/onchain/onchain.adapter.ts",100,100,100,100],
100100
["src/onchain/onchain.processor.ts",-33,-37,-3,-33],
101101
["src/onchain/onchain.service.ts",-12,-8,-4,-12],
102-
["src/onchain/soroban.adapter.ts",-197,-100,-44,-201],
102+
["src/onchain/soroban.adapter.ts",-210,-110,-44,-215],
103103
["src/onchain/utils/contract-value.ts",-14,-18,-2,-14],
104104
["src/onchain/utils/retry-with-timeout.ts",-14,-7,-4,-16],
105105
["src/onchain/utils/soroban-error.mapper.ts",-30,-36,-1,-30],

app/backend/test/jest-coverage.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ module.exports = {
1717
'.*\\.spec\\.ts$',
1818
'.*verification-lifecycle\\.e2e-spec\\.ts$',
1919
],
20-
testPathIgnorePatterns: ['/test/idempotency\\.spec\\.ts$'],
20+
testPathIgnorePatterns: [
21+
'/test/idempotency\\.spec\\.ts$',
22+
'/soroban\\.adapter\\.signing\\.spec\\.ts$',
23+
],
2124
moduleNameMapper: {
2225
...baseConfig.moduleNameMapper,
2326
'^cache/(.*)$': '<rootDir>/cache/$1',

0 commit comments

Comments
 (0)