-
Notifications
You must be signed in to change notification settings - Fork 66
78 lines (65 loc) · 1.87 KB
/
Copy pathcomprehensive-test.yml
File metadata and controls
78 lines (65 loc) · 1.87 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
68
69
70
71
72
73
74
75
76
77
78
name: Comprehensive Testing Suite
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
schedule:
- cron: '0 2 * * *' # Run nightly at 2 AM
jobs:
test:
name: Run Test Pyramid
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14-alpine
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: nepa_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:alpine
ports:
- 6379:6379
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install Dependencies
run: |
npm ci
cd api-testing && npm ci
- name: Setup Test Environment
run: |
npm run db:setup
# Start services in background for integration tests
npm run start:services:test &
sleep 30 # Wait for services to be ready
- name: 🧪 Run Unit Tests
run: cd api-testing && npm run test:unit
- name: 🔗 Run Integration Tests
run: cd api-testing && npm run test:integration
env:
USER_SERVICE_URL: http://localhost:3001
PAYMENT_SERVICE_URL: http://localhost:3002
- name: 🔒 Run Security Tests
run: cd api-testing && npm run test:security
- name: 📜 Run Contract Tests
run: cd api-testing && npm run test:contract
- name: 📊 Generate Test Report
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: api-testing/test-reports/