Skip to content

Commit bfe099e

Browse files
authored
feat: add integration test for pos-card flow (#3678)
* added integration test for pos flow * updated pnpm lock * Added webhook urls and signature secrets to c9 and hlf env * Set up hosts for card service and pos for IT * Added test env to performance test job * Updated IT structure and test name, removed unnecessary formatting * Forgot to remove 'card_expired' from result * Updated result model after merging pos-cards branch * Used prod docker files for pos and card services, added open api files to card-service build, fixed axios dependency issue
1 parent e73a86e commit bfe099e

File tree

17 files changed

+312
-161
lines changed

17 files changed

+312
-161
lines changed

.github/workflows/node-build.yml

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Node Build
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: '0 21 * * *'
6+
- cron: "0 21 * * *"
77
pull_request:
88
branches:
9-
- '**'
9+
- "**"
1010
push:
1111
branches:
1212
- main
@@ -17,9 +17,9 @@ jobs:
1717
runs-on: ubuntu-latest
1818
timeout-minutes: 5
1919
steps:
20-
- uses: actions/checkout@v4
21-
- uses: ./.github/workflows/rafiki/env-setup
22-
- run: pnpm checks
20+
- uses: actions/checkout@v4
21+
- uses: ./.github/workflows/rafiki/env-setup
22+
- run: pnpm checks
2323

2424
backend:
2525
runs-on: ubuntu-latest
@@ -141,7 +141,7 @@ jobs:
141141
- name: fail if GraphQL was generated
142142
if: steps.verify-changed-files.outputs.files_changed == 'true'
143143
run: exit 1
144-
144+
145145
codeql-analyze:
146146
runs-on: ubuntu-latest
147147
needs: prerequisite
@@ -153,20 +153,20 @@ jobs:
153153
strategy:
154154
fail-fast: false
155155
matrix:
156-
language: [ 'javascript' ]
156+
language: ["javascript"]
157157
config:
158-
- './.github/codeql/source.yml'
159-
- './.github/codeql/tests.yml'
158+
- "./.github/codeql/source.yml"
159+
- "./.github/codeql/tests.yml"
160160
steps:
161-
- uses: actions/checkout@v4
162-
- uses: ./.github/workflows/rafiki/env-setup
163-
- name: Initialize CodeQL
164-
uses: github/codeql-action/init@v3
165-
with:
166-
languages: ${{ matrix.language }}
167-
config-file: ${{ matrix.config }}
168-
- name: Perform CodeQL Analysis
169-
uses: github/codeql-action/analyze@v3
161+
- uses: actions/checkout@v4
162+
- uses: ./.github/workflows/rafiki/env-setup
163+
- name: Initialize CodeQL
164+
uses: github/codeql-action/init@v3
165+
with:
166+
languages: ${{ matrix.language }}
167+
config-file: ${{ matrix.config }}
168+
- name: Perform CodeQL Analysis
169+
uses: github/codeql-action/analyze@v3
170170

171171
integration-test:
172172
runs-on: ubuntu-22.04
@@ -186,8 +186,10 @@ jobs:
186186
run: |
187187
echo "127.0.0.1 cloud-nine-wallet-test-backend" | sudo tee -a /etc/hosts
188188
echo "127.0.0.1 cloud-nine-wallet-test-auth" | sudo tee -a /etc/hosts
189+
echo "127.0.0.1 cloud-nine-wallet-test-card-service" | sudo tee -a /etc/hosts
189190
echo "127.0.0.1 happy-life-bank-test-backend" | sudo tee -a /etc/hosts
190191
echo "127.0.0.1 happy-life-bank-test-auth" | sudo tee -a /etc/hosts
192+
echo "127.0.0.1 happy-life-bank-test-point-of-sale" | sudo tee -a /etc/hosts
191193
- name: Build dependencies
192194
run: pnpm --filter integration build:deps
193195

@@ -214,9 +216,11 @@ jobs:
214216
- name: Setup hosts
215217
run: |
216218
echo "127.0.0.1 cloud-nine-wallet-test-backend" | sudo tee -a /etc/hosts
219+
echo "127.0.0.1 cloud-nine-wallet-test-card-service" | sudo tee -a /etc/hosts
217220
echo "127.0.0.1 cloud-nine-wallet-test-auth" | sudo tee -a /etc/hosts
218221
echo "127.0.0.1 happy-life-bank-test-backend" | sudo tee -a /etc/hosts
219222
echo "127.0.0.1 happy-life-bank-test-auth" | sudo tee -a /etc/hosts
223+
echo "127.0.0.1 happy-life-bank-test-point-of-sale" | sudo tee -a /etc/hosts
220224
221225
- name: Build dependencies
222226
run: pnpm --filter performance build:deps
@@ -338,8 +342,20 @@ jobs:
338342
node-build:
339343
runs-on: ubuntu-latest
340344
timeout-minutes: 5
341-
needs: [auth, backend, frontend, token-introspection, card-service, point-of-sale, mock-account-servicing-entity, graphql, codeql-analyze, integration-test]
342-
steps:
345+
needs:
346+
[
347+
auth,
348+
backend,
349+
frontend,
350+
token-introspection,
351+
card-service,
352+
point-of-sale,
353+
mock-account-servicing-entity,
354+
graphql,
355+
codeql-analyze,
356+
integration-test,
357+
]
358+
steps:
343359
- uses: actions/checkout@v4
344360
- uses: ./.github/workflows/rafiki/env-setup
345361
- run: pnpm build
@@ -453,7 +469,7 @@ jobs:
453469
with:
454470
path: /tmp/${{ github.sha }}-${{ matrix.package }}-${{ matrix.platform.name }}-${{ needs.version-generator.outputs.version }}.tar
455471
key: ${{ github.sha }}-${{ matrix.package }}-${{ matrix.platform.name }}-${{ needs.version-generator.outputs.version }}
456-
472+
457473
docker-grype:
458474
name: Docker Grype Scan
459475
needs: [version-generator, docker-build]
@@ -553,10 +569,10 @@ jobs:
553569
platform_name: ${{ matrix.platform.name }}
554570
version: ${{ needs.version-generator.outputs.version }}
555571
gh_token: ${{ secrets.GITHUB_TOKEN }}
556-
572+
557573
push-manifest:
558574
name: Push multi-arch manifest list
559-
needs: [version-generator,push]
575+
needs: [version-generator, push]
560576
runs-on: ubuntu-latest
561577
if: needs.version-generator.outputs.dockerPush == 'true'
562578
strategy:
@@ -576,7 +592,7 @@ jobs:
576592
package: ${{ matrix.package }}
577593
gh_token: ${{ secrets.GITHUB_TOKEN }}
578594
version: ${{ needs.version-generator.outputs.version }}
579-
595+
580596
generate-release:
581597
runs-on: ubuntu-latest
582598
needs: [push-manifest, version-generator]
@@ -597,7 +613,7 @@ jobs:
597613
allowUpdates: true
598614
draft: false
599615
makeLatest: true
600-
prerelease: endsWith(needs.version-generator.outputs.version, '-alpha')
616+
prerelease: endsWith(needs.version-generator.outputs.version, '-alpha')
601617
name: ${{ needs.version-generator.outputs.version }}
602618
body: ${{ steps.changelog.outputs.changes }}
603619
tag: ${{ needs.version-generator.outputs.version }}

packages/card-service/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
"name": "card-service",
33
"main": "index.js",
44
"scripts": {
5-
"build": "pnpm clean && tsc --build tsconfig.json",
5+
"build": "pnpm clean && tsc --build tsconfig.json && pnpm copy-files",
66
"clean": "rm -fr dist/",
77
"test": "NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests --maxWorkers=50%",
88
"test:ci": "NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests --maxWorkers=2",
99
"test:cov": "pnpm test -- --coverage",
1010
"dev": "ts-node-dev --inspect=0.0.0.0:9229 --respawn --transpile-only src/index.ts",
11-
"knex": "knex"
11+
"knex": "knex",
12+
"copy-files": "cp -r ./src/openapi ./dist/"
1213
},
1314
"dependencies": {
1415
"@adonisjs/fold": "^8.2.0",

packages/point-of-sale/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"license": "ISC",
2121
"dependencies": {
2222
"@adonisjs/fold": "^8.2.0",
23+
"@apollo/client": "^3.11.8",
2324
"@apollo/server": "^4.11.2",
2425
"@faker-js/faker": "^8.4.1",
2526
"@koa/cors": "^5.0.0",
@@ -39,7 +40,6 @@
3940
"uuid": "^9.0.1"
4041
},
4142
"devDependencies": {
42-
"@apollo/client": "^3.11.8",
4343
"@faker-js/faker": "^8.4.1",
4444
"@graphql-codegen/cli": "5.0.4",
4545
"@graphql-codegen/introspection": "4.0.3",

0 commit comments

Comments
 (0)