WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit c113f4e

Browse files
committed
fix: tests on ci
Signed-off-by: ananeridev <[email protected]>
1 parent be7a985 commit c113f4e

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Install dependencies
4444
run: npm ci
4545

46-
- name: Initialize database
46+
- name: Initialize database schema
4747
run: |
4848
export PGPASSWORD=test_password
4949
psql -h localhost -U test_user -d payment_processor_test -f docker/postgres/init/01-init.sql
@@ -60,26 +60,17 @@ jobs:
6060
env:
6161
NODE_ENV: test
6262

63-
- name: Setup test environment
64-
run: npm run test:setup
63+
- name: Seed test database
64+
run: npm run test:seed
6565
env:
6666
NODE_ENV: test
67-
DATABASE_URL: postgres://test_user:[email protected]:5432/payment_processor_test
68-
DB_URL: postgres://test_user:[email protected]:5432/payment_processor_test
67+
TEST_DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }}
6968

7069
- name: Run E2E tests
71-
run: npm run test:e2e
72-
env:
73-
NODE_ENV: test
74-
DATABASE_URL: postgres://test_user:[email protected]:5432/payment_processor_test
75-
DB_URL: postgres://test_user:[email protected]:5432/payment_processor_test
76-
77-
- name: Run stability tests
78-
run: npm run test:stability
70+
run: npx poku tests/e2e/*.test.js
7971
env:
8072
NODE_ENV: test
81-
DATABASE_URL: postgres://test_user:[email protected]:5432/payment_processor_test
82-
DB_URL: postgres://test_user:[email protected]:5432/payment_processor_test
73+
TEST_DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }}
8374

8475
- name: Upload coverage reports
8576
uses: codecov/codecov-action@v3
@@ -177,7 +168,7 @@ jobs:
177168
kill %1 || true
178169
env:
179170
NODE_ENV: production
180-
DATABASE_URL: postgres://dummy:dummy@localhost:5432/dummy
171+
DB_URL: postgres://dummy:dummy@localhost:5432/dummy
181172

182173
load-test:
183174
name: Load Testing
@@ -234,18 +225,18 @@ jobs:
234225
sleep 10
235226
env:
236227
NODE_ENV: test
237-
DATABASE_URL: postgres://test_user:test_password@localhost:5432/payment_processor_test
228+
TEST_DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }}
238229

239230
- name: Run load tests
240231
run: |
241232
npm run test:load
242233
npm run test:stress
243234
env:
244235
NODE_ENV: test
245-
DATABASE_URL: postgres://test_user:test_password@localhost:5432/payment_processor_test
236+
TEST_DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }}
246237

247238
- name: Run concurrency tests
248239
run: npm run test:concurrency
249240
env:
250241
NODE_ENV: test
251-
DATABASE_URL: postgres://test_user:test_password@localhost:5432/payment_processor_test
242+
TEST_DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }}

0 commit comments

Comments
 (0)