Skip to content

Commit 60f4157

Browse files
authored
Merge pull request #1503 from input-output-hk/feat/deployed-e2e-test
LW-11615 Update deployed envs e2e test to latest sdk version
2 parents 31dd8a4 + 9fcfb60 commit 60f4157

File tree

2 files changed

+69
-33
lines changed

2 files changed

+69
-33
lines changed

.github/workflows/test-deploy-e2e.yaml

+23-18
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,25 @@ on:
44
workflow_dispatch:
55
inputs:
66
environment:
7-
description: 'Environment to run e2e tests against'
7+
description: 'Target environment'
88
type: choice
99
required: true
10-
default: 'dev-preprod'
1110
options:
12-
- live-preprod
13-
- live-preview
14-
- dev-preprod
15-
- dev-preview
16-
- staging-preprod
11+
- 'dev'
12+
- 'staging'
13+
- 'live'
14+
network:
15+
description: 'Target network'
16+
type: choice
17+
required: true
18+
options:
19+
- 'preview'
20+
- 'preprod'
21+
- 'sanchonet'
1722
cluster:
18-
description: 'Specific cluster to run e2e tests against'
23+
description: 'Target cluster'
1924
type: choice
2025
required: true
21-
default: 'any'
2226
options:
2327
- any
2428
- eu-central-1
@@ -27,7 +31,6 @@ on:
2731
description: 'Log level'
2832
type: choice
2933
required: true
30-
default: 'fatal'
3134
options:
3235
- fatal
3336
- error
@@ -36,10 +39,6 @@ on:
3639
- debug
3740
- trace
3841

39-
env:
40-
TL_DEPTH: ${{ github.event.pull_request.head.repo.fork && '0' || fromJson(vars.TL_DEPTH) }}
41-
TL_LEVEL: ${{ github.event.pull_request.head.repo.fork && 'info' || vars.TL_LEVEL }}
42-
4342
jobs:
4443
build_and_test:
4544
strategy:
@@ -52,10 +51,13 @@ jobs:
5251

5352
- name: Generate .env file
5453
working-directory: ./packages/e2e/
54+
env:
55+
CLUSTER: ${{ inputs.cluster }}
56+
ENVIRONMENT: ${{ inputs.environment }}
57+
MNEMONIC: ${{ secrets.MNEMONIC }}
58+
NETWORK: ${{ inputs.network }}
5559
run: |
56-
if [[ "${{ inputs.environment }}" == *"preprod"* ]]; then networkMagic=1; else networkMagic=2; fi
57-
./src/scripts/generate-dotenv.sh ${{ inputs.environment }} ${{ inputs.cluster }}
58-
echo "KEY_MANAGEMENT_PARAMS='$(jq --argjson networkMagic $networkMagic --arg mnemonic "${{ secrets.MNEMONIC }}" <<< '{"bip32Ed25519": "Sodium", "accountIndex": 0, "chainId":{"networkId": 0, "networkMagic": 0}, "passphrase":"some_passphrase","mnemonic":"mnemonics"}' '.mnemonic=$mnemonic | .chainId.networkMagic=$networkMagic')'" >> .env
60+
./src/scripts/generate-dotenv.sh
5961
6062
- name: 🧰 Setup Node.js
6163
uses: actions/setup-node@v3
@@ -71,6 +73,9 @@ jobs:
7173
NODE_OPTIONS: '--max_old_space_size=8192'
7274

7375
- name: 🔬 Test - e2e - wallet
76+
env:
77+
TL_DEPTH: 0
78+
TL_LEVEL: ${{ inputs.level }}
7479
run: |
75-
TL_DEPTH=0 TL_LEVEL=${{ inputs.level }} yarn workspace @cardano-sdk/e2e test:wallet-real-ada
80+
yarn workspace @cardano-sdk/e2e test:wallet-real-ada
7681
shell: bash
+46-15
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,79 @@
11
#!/bin/bash
22

33
set -e
4-
set -x
5-
set -o
64

7-
case $2 in
5+
target="${ENVIRONMENT}-${NETWORK}"
6+
7+
case $CLUSTER in
88
any)
9-
environment="$1"
9+
environment="${target}"
10+
;;
11+
*)
12+
environment="${target}.${CLUSTER}"
13+
;;
14+
esac
15+
16+
case $NETWORK in
17+
preprod)
18+
networkMagic=1
19+
;;
20+
preview)
21+
networkMagic=2
22+
;;
23+
sanchonet)
24+
networkMagic=4
1025
;;
1126
*)
12-
environment="$1.$2"
27+
echo "${NETWORK}: Unknown network"
28+
exit 1
1329
;;
1430
esac
1531

1632
domain="${environment}.lw.iog.io"
1733
url="https://${domain}/"
1834

1935
# Construct the environment file content
20-
envFileContent="
21-
# Logger
36+
envFileContent="\
2237
LOGGER_MIN_SEVERITY=info
2338
24-
# Key management setup - required by getWallet
25-
KEY_MANAGEMENT_PROVIDER=inMemory
26-
27-
# Providers setup - required by getWallet
2839
TEST_CLIENT_ASSET_PROVIDER=http
2940
TEST_CLIENT_ASSET_PROVIDER_PARAMS='{\"baseUrl\":\"${url}\"}'
30-
TEST_CLIENT_CHAIN_HISTORY_PROVIDER=http
41+
TEST_CLIENT_CHAIN_HISTORY_PROVIDER=ws
3142
TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS='{\"baseUrl\":\"${url}\"}'
3243
TEST_CLIENT_HANDLE_PROVIDER=http
3344
TEST_CLIENT_HANDLE_PROVIDER_PARAMS='{\"baseUrl\":\"${url}\"}'
34-
TEST_CLIENT_NETWORK_INFO_PROVIDER=http
45+
TEST_CLIENT_NETWORK_INFO_PROVIDER=ws
3546
TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS='{\"baseUrl\":\"${url}\"}'
3647
TEST_CLIENT_REWARDS_PROVIDER=http
3748
TEST_CLIENT_REWARDS_PROVIDER_PARAMS='{\"baseUrl\":\"${url}\"}'
3849
TEST_CLIENT_TX_SUBMIT_PROVIDER=http
3950
TEST_CLIENT_TX_SUBMIT_PROVIDER_PARAMS='{\"baseUrl\":\"${url}\"}'
40-
TEST_CLIENT_UTXO_PROVIDER=http
51+
TEST_CLIENT_UTXO_PROVIDER=ws
4152
TEST_CLIENT_UTXO_PROVIDER_PARAMS='{\"baseUrl\":\"${url}\"}'
4253
TEST_CLIENT_STAKE_POOL_PROVIDER=http
4354
TEST_CLIENT_STAKE_POOL_PROVIDER_PARAMS='{\"baseUrl\":\"${url}\"}'
4455
WS_PROVIDER_URL='wss://${domain}/ws'
45-
"
56+
57+
KEY_MANAGEMENT_PROVIDER=inMemory
58+
KEY_MANAGEMENT_PARAMS='{
59+
\"bip32Ed25519\": \"Sodium\",
60+
\"accountIndex\": 0,
61+
\"chainId\": {
62+
\"networkId\": 0,
63+
\"networkMagic\": ${networkMagic}
64+
},
65+
\"passphrase\": \"some_passphrase\",
66+
\"mnemonic\": \"${MNEMONIC}\"
67+
}'"
4668

4769
# Write the environment file content to the specified file
4870
echo "$envFileContent" > .env
71+
72+
# Dump inputs and outputs
73+
echo "
74+
Target environment: ${ENVIRONMENT}
75+
Target network: ${NETWORK}
76+
Target cluster: ${CLUSTER}
77+
78+
Result .env:"
79+
cat .env

0 commit comments

Comments
 (0)