Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: integration tests #2380

Merged
merged 68 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
9e3a707
feat: setup basic test env
BlairCurrey Jan 30, 2024
11200cd
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Jan 30, 2024
5c6acb5
feat: seed integration environment
BlairCurrey Feb 2, 2024
aaa2103
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Feb 2, 2024
71b0257
refactor(localenv,integration): move graphql url to config from seed
BlairCurrey Feb 5, 2024
ec4fe8f
refactor: move testenv configuration into new dir
BlairCurrey Feb 5, 2024
5ab8b67
refactor: cleanup env vars
BlairCurrey Feb 5, 2024
b64d369
feat: add webhook server, fix env vars
BlairCurrey Feb 6, 2024
b95aff8
chore: comment
BlairCurrey Feb 6, 2024
322970e
feat: start grant request test
BlairCurrey Feb 12, 2024
c9096ec
fix: eslint errors
BlairCurrey Feb 12, 2024
9a654a9
fix: docker compose env vars
BlairCurrey Feb 13, 2024
dcc156e
feat: add --build arg
BlairCurrey Feb 13, 2024
83431e0
fix: incoming-payment grant initiation request
BlairCurrey Feb 13, 2024
551ffc3
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Feb 20, 2024
f02db32
fix: ts error
BlairCurrey Feb 20, 2024
24a46f0
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Feb 22, 2024
b7378f6
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Feb 22, 2024
fb0d87f
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Feb 26, 2024
a12910d
feat: implement tests through Create Quote
BlairCurrey Feb 28, 2024
f1f1c59
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Feb 29, 2024
3be48e1
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Mar 1, 2024
afaa594
chore: upgrade op client
BlairCurrey Mar 1, 2024
57f7d7f
feat: partially implemented grant request outgoing payment test
BlairCurrey Mar 1, 2024
52f35b9
feat: rework to host.docker.internal
BlairCurrey Mar 4, 2024
7702441
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Mar 4, 2024
83dc970
feat: add p2p flow test
BlairCurrey Mar 5, 2024
716891e
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Mar 5, 2024
cc93982
feat: add continuation step with consent mocking
BlairCurrey Mar 7, 2024
9e1e215
fix: rm obsolete type cast to any and comment
BlairCurrey Mar 8, 2024
51fc325
feat: add create ougoing payment test
BlairCurrey Mar 8, 2024
b845cd7
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Mar 8, 2024
09e1314
fix: bad pnpm-lock merge
BlairCurrey Mar 8, 2024
b94f452
feat: build deps in mock ase job
BlairCurrey Mar 8, 2024
82e84d6
feat: get non existant wallet address test
BlairCurrey Mar 9, 2024
7dd1f13
fix: update open payments pkg
BlairCurrey Mar 11, 2024
53773cc
chore: fix lint warnings
BlairCurrey Mar 11, 2024
4cd2646
feat: implement continuation polling
BlairCurrey Mar 11, 2024
b17465d
chore: test cleanup
BlairCurrey Mar 12, 2024
af0a038
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Mar 12, 2024
42ab964
refactor: generate gql in tests instead of import from lib
BlairCurrey Mar 12, 2024
e29b58c
chore: rm old comment
BlairCurrey Mar 12, 2024
187df0b
chore: use latest http-singature-utils to match other deps
BlairCurrey Mar 12, 2024
d9a425e
chore: pnpm i
BlairCurrey Mar 12, 2024
5c53d9c
chore: use latest koa-bodyparser
BlairCurrey Mar 12, 2024
d312900
chore: rm engine strict
BlairCurrey Mar 12, 2024
b33ca1f
chore: revert rm engine strict
BlairCurrey Mar 13, 2024
36fd545
chore(integration): dont ignore env, rm example env
BlairCurrey Mar 13, 2024
366d02f
refactor: use docker healthcheck for running tests
BlairCurrey Mar 13, 2024
f85a804
chore: move healthcheck to last started docker container
BlairCurrey Mar 13, 2024
1320b98
feat: use latest open payments pkg, no body requird on continuation
BlairCurrey Mar 14, 2024
2f587d8
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Mar 14, 2024
636832d
chore: pnpm i, fix broken lockfile (no apollo version)
BlairCurrey Mar 14, 2024
f4ad75c
refactor: move webhook event enum to types
BlairCurrey Mar 16, 2024
9c19b9a
refactor: move run integration script to test/integration
BlairCurrey Mar 16, 2024
12c4cb7
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Mar 16, 2024
6085663
Update packages/mock-account-servicing-lib/package.json
BlairCurrey Mar 16, 2024
8994ead
refactor: simplify mock-account-servicing-entity ci step
BlairCurrey Mar 16, 2024
bb98b70
feat(integration): exit run-tests early if containers fail to start
BlairCurrey Mar 16, 2024
0ab5844
feat: use pino logger
BlairCurrey Mar 17, 2024
43d536b
refactor: rename mock account servicing lib
BlairCurrey Mar 18, 2024
a154e4c
Merge branch 'main' into bc/2049/rafiki-to-rafiki-test
BlairCurrey Mar 18, 2024
c4262bb
refactor: rename class files to camel case
BlairCurrey Mar 18, 2024
7f39cd4
fix: import correct body parser
BlairCurrey Mar 18, 2024
a6b937e
refactor: poll instead of delay
BlairCurrey Mar 18, 2024
53c3f30
refactor: simplify call to poll condition only
BlairCurrey Mar 18, 2024
ba612eb
fix: update filenames
BlairCurrey Mar 18, 2024
20c135f
refactor: change filename name to kebab case
BlairCurrey Mar 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 67 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ packages:
- 'packages/*'
- 'localenv/mock-account-servicing-entity'
# exclude packages that are inside test directories
- '!**/test/**'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was not excluding anything from what I can tell (using pnpm ls --depth -1 -r to get packages). Removed to accommodate the test/integration workspace pkg but can rework this if it's actually doing something.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was probably a typo and should have been tests

- 'test/integration'
15 changes: 15 additions & 0 deletions test/integration/dbinit.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE USER cloud_nine_wallet_test_backend WITH PASSWORD 'cloud_nine_wallet_test_backend';
CREATE DATABASE cloud_nine_wallet_test_backend;
ALTER DATABASE cloud_nine_wallet_test_backend OWNER TO cloud_nine_wallet_test_backend;

CREATE USER cloud_nine_wallet_test_auth WITH PASSWORD 'cloud_nine_wallet_test_auth';
CREATE DATABASE cloud_nine_wallet_test_auth;
ALTER DATABASE cloud_nine_wallet_test_auth OWNER TO cloud_nine_wallet_test_auth;

CREATE USER happy_life_bank_test_backend WITH PASSWORD 'happy_life_bank_test_backend';
CREATE DATABASE happy_life_bank_test_backend;
ALTER DATABASE happy_life_bank_test_backend OWNER TO happy_life_bank_test_backend;

CREATE USER happy_life_bank_test_auth WITH PASSWORD 'happy_life_bank_test_auth';
CREATE DATABASE happy_life_bank_test_auth;
ALTER DATABASE happy_life_bank_test_auth OWNER TO happy_life_bank_test_auth;
59 changes: 59 additions & 0 deletions test/integration/docker-compose.cloud-nine-wallet-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: cloud-nine-wallet-test
services:
cloud-nine-wallet-test-backend:
hostname: cloud-nine-wallet-test-backend
image: rafiki-backend
build:
context: ../..
dockerfile: ./packages/backend/Dockerfile
restart: always
privileged: true
ports:
- '3000:80'
- '3001:3001'
- '3002:3002'
networks:
- rafiki-test
environment:
NODE_ENV: ${NODE_ENV:-development}
TRUST_PROXY: ${TRUST_PROXY}
LOG_LEVEL: debug
ADMIN_PORT: 3001
CONNECTOR_PORT: 3002
OPEN_PAYMENTS_PORT: 80
DATABASE_URL: postgresql://cloud_nine_wallet_test_backend:cloud_nine_wallet_test_backend@shared-database/cloud_nine_wallet_test_backend
USE_TIGERBEETLE: ${USE_TIGERBEETLE-false}
TIGERBEETLE_CLUSTER_ID: ${TIGERBEETLE_CLUSTER_ID-0}
TIGERBEETLE_REPLICA_ADDRESSES: ${TIGERBEETLE_REPLICA_ADDRESSES-''}
AUTH_SERVER_GRANT_URL: ${CLOUD_NINE_WALLET_TEST_AUTH_SERVER_DOMAIN:-http://cloud-nine-wallet-test-auth:3006}
AUTH_SERVER_INTROSPECTION_URL: http://cloud-nine-wallet-test-auth:3007
ILP_ADDRESS: ${ILP_ADDRESS:-test.cloud-nine-wallet-test}
STREAM_SECRET: BjPXtnd00G2mRQwP/8ZpwyZASOch5sUXT5o0iR5b5wU=
OPEN_PAYMENTS_URL: ${CLOUD_NINE_WALLET_TEST_OPEN_PAYMENTS_URL:-http://cloud-nine-wallet-test-backend}
WEBHOOK_URL: http://cloud-nine-wallet-test/webhooks
EXCHANGE_RATES_URL: http://cloud-nine-wallet-test/rates
REDIS_URL: redis://shared-redis:6379/0
WALLET_ADDRESS_URL: ${CLOUD_NINE_WALLET_TEST_WALLET_ADDRESS_URL:-https://cloud-nine-wallet-test/.well-known/pay}
ILP_CONNECTOR_ADDRESS: ${CLOUD_NINE_WALLET_TEST_CONNECTOR_URL}
depends_on:
- shared-database
- shared-redis
cloud-nine-wallet-test-auth:
hostname: cloud-nine-wallet-test-auth
image: rafiki-auth
build:
context: ../..
dockerfile: ./packages/auth/Dockerfile
restart: always
networks:
- rafiki-test
ports:
- '3003:3003'
- '3006:3006'
environment:
NODE_ENV: ${NODE_ENV:-development}
TRUST_PROXY: ${TRUST_PROXY}
AUTH_DATABASE_URL: postgresql://cloud_nine_wallet_test_auth:cloud_nine_wallet_test_auth@shared-database/cloud_nine_wallet_test_auth
AUTH_SERVER_DOMAIN: ${CLOUD_NINE_WALLET_TEST_AUTH_SERVER_DOMAIN:-http://localhost:3006}
depends_on:
- shared-database
50 changes: 50 additions & 0 deletions test/integration/docker-compose.happy_life_bank_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: happy-life-bank-test
services:
happy-life-bank-test:
hostname: happy-life-bank-test
image: rafiki-backend
pull_policy: never
restart: always
privileged: true
ports:
- "4000:80"
- "4001:3001"
networks:
- rafiki-test
environment:
NODE_ENV: development
LOG_LEVEL: debug
ADMIN_PORT: 3001
CONNECTOR_PORT: 3002
OPEN_PAYMENTS_PORT: 80
DATABASE_URL: postgresql://happy_life_bank_test_backend:happy_life_bank_test_backend@shared-database/happy_life_bank_test_backend
USE_TIGERBEETLE: ${USE_TIGERBEETLE-false}
TIGERBEETLE_CLUSTER_ID: ${TIGERBEETLE_CLUSTER_ID-0}
TIGERBEETLE_REPLICA_ADDRESSES: ${TIGERBEETLE_REPLICA_ADDRESSES-''}
AUTH_SERVER_GRANT_URL: ${HAPPY_LIFE_BANK_TEST_AUTH_SERVER_DOMAIN:-http://happy-life-bank-test-auth:3006}
AUTH_SERVER_INTROSPECTION_URL: http://happy-life-bank-test-auth:3007
ILP_ADDRESS: test.happy-life-bank-test
STREAM_SECRET: BjPXtnd00G2mRQwP/8ZpwyZASOch5sUXT5o0iR5b5wU=
WEBHOOK_URL: http://happy-life-bank-test/webhooks
OPEN_PAYMENTS_URL: ${HAPPY_LIFE_BANK_TEST_OPEN_PAYMENTS_URL:-http://happy-life-bank-test}
EXCHANGE_RATES_URL: http://happy-life-bank-test/rates
REDIS_URL: redis://shared-redis:6379/1
WALLET_ADDRESS_URL: ${HAPPY_LIFE_BANK_TEST_WALLET_ADDRESS_URL:-https://happy-life-bank-test/.well-known/pay}
depends_on:
- cloud-nine-wallet-test-backend
happy-life-auth:
hostname: happy-life-bank-test-auth
image: rafiki-auth
pull_policy: never
restart: always
networks:
- rafiki-test
ports:
- '4003:3003'
- '4006:3006'
environment:
NODE_ENV: development
AUTH_DATABASE_URL: postgresql://happy_life_bank_test_auth:happy_life_bank_test_auth@shared-database/happy_life_bank_test_auth
AUTH_SERVER_DOMAIN: ${HAPPY_LIFE_BANK_TEST_AUTH_SERVER_DOMAIN:-http://localhost:4006}
depends_on:
- cloud-nine-wallet-test-auth
Loading
Loading