-
Notifications
You must be signed in to change notification settings - Fork 130
67 lines (57 loc) Β· 2.2 KB
/
Copy pathintegration-tests.yml
File metadata and controls
67 lines (57 loc) Β· 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Backend Integration Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
integration-tests:
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: backend
env:
NODE_ENV: test
RPC_URL: https://soroban-testnet.stellar.org
CONTRACT_ID: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
NEXT_PUBLIC_NETWORK: testnet
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: backend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run backend integration tests
env:
NODE_ENV: test
run: npx jest --runInBand --testMatch="**/*.integration.test.ts" --testTimeout=60000 --json --outputFile=coverage/jest-integration-results.json || true
- name: Annotate Jest integration failures
if: always()
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const path = require('path');
const reportPath = path.join(process.cwd(), 'coverage', 'jest-integration-results.json');
if (!fs.existsSync(reportPath)) return;
const report = JSON.parse(fs.readFileSync(reportPath, 'utf8'));
for (const testResult of report.testResults || []) {
const file = path.relative(process.cwd(), testResult.name);
for (const assertion of testResult.assertionResults || []) {
if (assertion.status !== 'failed') continue;
const message = `${assertion.ancestorTitles.join(' > ')} > ${assertion.title}\n${assertion.failureMessages.join('\n')}`;
console.log(`::error file=${file}::${message.replace(/\r?\n/g, '%0A')}`);
}
}
if (!report.success) throw new Error('Backend integration tests failed');
- name: Upload coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: backend/coverage/