Skip to content

Commit 820d241

Browse files
committed
feat(e2e): enable blockfrst e2e test in CI
1 parent 6b2de2e commit 820d241

File tree

3 files changed

+114
-1
lines changed

3 files changed

+114
-1
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Continuous Integration - E2E (Blockfrost Providers)
2+
3+
env:
4+
TL_DEPTH: ${{ github.event.pull_request.head.repo.fork && '0' || fromJson(vars.TL_DEPTH) }}
5+
TL_LEVEL: ${{ github.event.pull_request.head.repo.fork && 'info' || vars.TL_LEVEL }}
6+
# -----------------------------------------------------------------------------------------
7+
KEY_MANAGEMENT_PROVIDER: 'inMemory'
8+
KEY_MANAGEMENT_PARAMS: '{"bip32Ed25519": "Sodium", "accountIndex": 0, "chainId":{"networkId": 0, "networkMagic": 888}, "passphrase":"some_passphrase","mnemonic":"vacant violin soft weird deliver render brief always monitor general maid smart jelly core drastic erode echo there clump dizzy card filter option defense"}'
9+
TEST_CLIENT_ASSET_PROVIDER: 'http'
10+
TEST_CLIENT_ASSET_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4014/"}'
11+
TEST_CLIENT_CHAIN_HISTORY_PROVIDER: 'http'
12+
TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}'
13+
DB_SYNC_CONNECTION_STRING: 'postgresql://postgres:doNoUseThisSecret!@localhost:5435/cexplorer'
14+
TEST_CLIENT_HANDLE_PROVIDER: 'http'
15+
TEST_CLIENT_HANDLE_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4011/"}'
16+
STAKE_POOL_CONNECTION_STRING: 'postgresql://postgres:doNoUseThisSecret!@localhost:5435/stake_pool'
17+
STAKE_POOL_TEST_CONNECTION_STRING: 'postgresql://postgres:doNoUseThisSecret!@localhost:5435/stake_pool_test'
18+
TEST_CLIENT_NETWORK_INFO_PROVIDER: 'ws'
19+
TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}'
20+
OGMIOS_URL: 'ws://localhost:1340/'
21+
TEST_CLIENT_REWARDS_PROVIDER: 'http'
22+
TEST_CLIENT_REWARDS_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}'
23+
TEST_CLIENT_TX_SUBMIT_PROVIDER: 'http'
24+
TEST_CLIENT_TX_SUBMIT_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}'
25+
TEST_CLIENT_UTXO_PROVIDER: 'http'
26+
TEST_CLIENT_UTXO_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}'
27+
TEST_CLIENT_STAKE_POOL_PROVIDER: 'http'
28+
TEST_CLIENT_STAKE_POOL_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}'
29+
WS_PROVIDER_URL: 'http://localhost:4100/ws'
30+
# enable Blockfrost backed providers, the rest will use defaults
31+
ASSET_PROVIDER: 'blockfrost'
32+
UTXO_PROVIDER: 'blockfrost'
33+
CHAIN_HISTORY_PROVIDER: 'blockfrost'
34+
REWARDS_PROVIDER: 'blockfrost'
35+
NETWORK_INFO_PROVIDER: 'blockfrost'
36+
TX_SUBMIT_PROVIDER: 'blockfrost'
37+
38+
on:
39+
pull_request:
40+
push:
41+
branches: ['master']
42+
tags: ['*.*.*']
43+
44+
jobs:
45+
build_and_test:
46+
strategy:
47+
matrix:
48+
os: [ubuntu-20.04]
49+
runs-on: ${{ matrix.os }}
50+
steps:
51+
- name: 📥 Checkout repository
52+
uses: actions/checkout@v3
53+
54+
- name: 🧰 Setup Node.js
55+
uses: actions/setup-node@v3
56+
with:
57+
node-version: 18.12.0
58+
59+
- name: 🔨 Build
60+
run: |
61+
yarn install --immutable --inline-builds --mode=skip-build
62+
yarn workspace @cardano-sdk/cardano-services-client build:cjs
63+
yarn workspace @cardano-sdk/cardano-services build:cjs
64+
yarn workspace @cardano-sdk/e2e build:cjs
65+
yarn workspace @cardano-sdk/util-dev build:cjs
66+
docker build --no-cache .
67+
env:
68+
NODE_OPTIONS: '--max_old_space_size=8192'
69+
70+
- name: 🌐 Setup local test network
71+
working-directory: packages/e2e
72+
run: |
73+
yarn local-network:blockfrost:up -d
74+
env:
75+
CARDANO_NODE_CHAINDB_LOG_LEVEL: 'Warning'
76+
CARDANO_NODE_LOG_LEVEL: 'Warning'
77+
OGMIOS_PORT: '1340'
78+
OGMIOS_URL: 'ws://ogmios:1340'
79+
POSTGRES_PORT: '5435'
80+
81+
- name: Wait for network init
82+
run: |
83+
yarn workspace @cardano-sdk/e2e wait-for-network-init
84+
85+
- name: 🔬 Test - e2e - wallet at epoch 0
86+
run: |
87+
yarn workspace @cardano-sdk/e2e test:wallet:epoch0
88+
yarn workspace @cardano-sdk/e2e test:projection
89+
yarn workspace @cardano-sdk/e2e test:ws
90+
91+
- name: Wait for epoch 3
92+
run: |
93+
yarn workspace @cardano-sdk/e2e wait-for-network-epoch-3
94+
95+
- name: 🔬 Test - e2e - wallet at epoch 3
96+
run: |
97+
yarn workspace @cardano-sdk/e2e test:wallet:epoch3
98+
yarn workspace @cardano-sdk/e2e test:pg-boss
99+
yarn workspace @cardano-sdk/e2e test:providers
100+
env:
101+
STAKE_POOL_PROVIDER_URL: 'http://localhost:4000/'
102+
103+
- name: 🔬 Test - e2e - wallet - typeorm stake pool provider
104+
run: |
105+
yarn workspace @cardano-sdk/e2e test:providers -t StakePoolProvider
106+
env:
107+
STAKE_POOL_PROVIDER_URL: 'http://localhost:4010/'
108+
109+
- name: Dump docker logs
110+
if: ${{ cancelled() || failure() }}
111+
uses: jwalton/gh-docker-logs@v2

packages/e2e/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ services:
1515
NODE_ENV: local-network
1616
volumes:
1717
- ./local-network/config/network/blockfrost-ryo:/app/config
18+
profiles: [blockfrost-ryo]
1819

1920
local-testnet:
2021
<<: *logging

packages/e2e/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@
4646
"test:web-extension:watch": "run-s test:web-extension:build test:web-extension:watch:bg",
4747
"test:web-extension:watch:bg": "run-p test:web-extension:watch:build test:web-extension:watch:run",
4848
"test:ws": "jest -c jest.config.js --forceExit --selectProjects ws-server --runInBand --verbose",
49-
"local-network:common": "DISABLE_DB_CACHE=${DISABLE_DB_CACHE:-true} SUBMIT_API_ARGS='--testnet-magic 888' USE_BLOCKFROST=false __FIX_UMASK__=$(chmod -R a+r ../../compose/placeholder-secrets) docker compose --env-file ../cardano-services/environments/.env.local -p local-network-e2e -f docker-compose.yml -f ../../compose/common.yml -f ../../compose/$(uname -m).yml $FILES up",
49+
"local-network:common": "DISABLE_DB_CACHE=${DISABLE_DB_CACHE:-true} SUBMIT_API_ARGS='--testnet-magic 888' USE_BLOCKFROST=false __FIX_UMASK__=$(chmod -R a+r ../../compose/placeholder-secrets) docker compose --env-file ../cardano-services/environments/.env.local -p local-network-e2e -f docker-compose.yml -f ../../compose/common.yml -f ../../compose/$(uname -m).yml $FILES --profile ${DOCKER_COMPOSE_PROFILE:-none} up",
5050
"local-network:up": "FILES='' yarn local-network:common",
51+
"local-network:blockfrost:up": "FILES='' DOCKER_COMPOSE_PROFILE='blockfrost-ryo' yarn local-network:common",
5152
"local-network:single:up": "FILES='' yarn local-network:common cardano-node file-server local-testnet ogmios postgres",
5253
"local-network:profile:up": "FILES='-f ../../compose/pg-agent.yml' yarn local-network:common",
5354
"local-network:down": "docker compose -p local-network-e2e -f docker-compose.yml -f ../../compose/common.yml -f ../../compose/pg-agent.yml down -v --remove-orphans",

0 commit comments

Comments
 (0)