Skip to content

Commit 62d447e

Browse files
lukaszclsmickovskidaalu1418
authored
Use test secrets for E2E tests (#817)
* Rebase * Fix lint * Bump run-tests action * Add default solana secret * Fix DEFAULT_CHAINLINK_IMAGE * Fix * Bump gha * Fix --------- Co-authored-by: Damjan Smickovski <smickovskid@outlook.com> Co-authored-by: Aaron Lu <50029043+aalu1418@users.noreply.github.com>
1 parent 880f71f commit 62d447e

File tree

6 files changed

+233
-33
lines changed

6 files changed

+233
-33
lines changed

.github/workflows/e2e_custom_cl.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ jobs:
301301
run: | # https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md
302302
cat << EOF > config.toml
303303
[ChainlinkImage]
304-
image="${{ env.CL_ECR }}"
305304
version="solana.${{ env.CUSTOM_CORE_REF || github.event.inputs.cl_branch_ref || github.sha }}"
306305
[Common]
307306
user="${{ github.actor }}"
@@ -315,10 +314,11 @@ jobs:
315314
# shellcheck disable=SC2086
316315
echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV
317316
- name: Run Tests
318-
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
317+
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@00c164251be2a7c5b2b23a6e5f7014982f232c14 # v2.3.31
319318
with:
320319
test_command_to_run: cd ./integration-tests && go test -timeout 24h -count=1 -run TestSolanaOCRV2Smoke -json $(args) ./smoke 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci=true -singlepackage=true -hidepassingtests=false -hidepassinglogs=false
321320
test_download_vendor_packages_command: cd ./integration-tests && go mod download
321+
test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }}
322322
download_contract_artifacts_path: ${{ env.CONTRACT_ARTIFACTS_PATH }}
323323
go_mod_path: ./integration-tests/go.mod
324324
cl_repo: ${{ env.CL_ECR }}
@@ -332,6 +332,9 @@ jobs:
332332
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
333333
cache_key_id: solana-e2e-${{ env.MOD_CACHE_VERSION }}
334334
cache_restore_only: "false"
335+
env:
336+
E2E_TEST_CHAINLINK_IMAGE: ${{ env.CL_ECR }}
337+
E2E_TEST_SOLANA_SECRET: thisisatestingonlysecret
335338

336339
e2e_program_upgrade_tests:
337340
name: E2E Program Upgrade Tests
@@ -394,10 +397,11 @@ jobs:
394397
# shellcheck disable=SC2086
395398
echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV
396399
- name: Run Upgrade Test
397-
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
400+
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@00c164251be2a7c5b2b23a6e5f7014982f232c14 # v2.3.31
398401
with:
399402
test_command_to_run: cd ./integration-tests && go test -timeout 24h -count=1 -run TestSolanaOCRV2UpgradeSmoke -json $(args) ./smoke 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci=true -singlepackage=true -hidepassingtests=false -hidepassinglogs=false
400403
test_download_vendor_packages_command: cd ./integration-tests && go mod download
404+
test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }}
401405
download_contract_artifacts_path: ${{ env.CONTRACT_ARTIFACTS_PATH }}
402406
go_mod_path: ./integration-tests/go.mod
403407
cl_repo: ${{ env.CL_ECR }}
@@ -411,3 +415,7 @@ jobs:
411415
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
412416
cache_key_id: solana-e2e-${{ env.MOD_CACHE_VERSION }}
413417
cache_restore_only: "false"
418+
env:
419+
E2E_TEST_CHAINLINK_IMAGE: ${{ env.CL_ECR }}
420+
E2E_TEST_SOLANA_SECRET: thisisatestingonlysecret
421+

.github/workflows/e2e_testnet_daily.yml

+13-19
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,10 @@ on:
77
required: true
88
default: develop
99
type: string
10-
RPC_URL:
11-
description: RPC URL for the tests
12-
required: true
13-
default: https://api.devnet.solana.com
14-
type: string
15-
WS_URL:
16-
description: WS URL for the tests
17-
required: true
18-
default: wss://api.devnet.solana.com/
19-
type: string
20-
PRIVATE_KEY:
21-
description: Private key in byte format [12, 12 ...]
22-
required: true
23-
type: string
10+
test_secrets_override_key:
11+
description: 'Key to run tests with custom test secrets like ws url, rpc url, private key, etc.'
12+
required: false
13+
type: string
2414
schedule:
2515
- cron: '0 6 * * *'
2616
# Only run 1 of this workflow at a time per PR
@@ -147,15 +137,11 @@ jobs:
147137
run: | # https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md
148138
cat << EOF > config.toml
149139
[ChainlinkImage]
150-
image="${{ env.CL_ECR }}"
151140
version="solana.${{ env.CUSTOM_CORE_REF || github.event.inputs.cl_branch_ref || github.sha }}"
152141
[Common]
153142
user="${{ github.actor }}"
154143
network="devnet"
155-
private_key="${{ github.event_name == 'workflow_dispatch' && github.event.inputs.PRIVATE_KEY || secrets.PRIVATE_KEY }}"
156144
internal_docker_repo = "${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com"
157-
rpc_url = "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.RPC_URL || 'https://api.devnet.solana.com' }}"
158-
ws_url = "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.RPC_URL || 'https://api.devnet.solana.com' }}"
159145
EOF
160146
161147
# shellcheck disable=SC2002
@@ -165,10 +151,12 @@ jobs:
165151
# shellcheck disable=SC2086
166152
echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV
167153
- name: Run Tests
168-
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@b49a9d04744b0237908831730f8553f26d73a94b # v2.3.17
154+
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@fdaf56b1df7248d18e30ad09982d03ec67d6b71c # v2.3.29
169155
with:
170156
test_command_to_run: cd ./integration-tests && go test -timeout 24h -count=1 -run TestSolanaOCRV2Smoke/embedded -json $(args) ./smoke 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage
171157
test_download_vendor_packages_command: cd ./integration-tests && go mod download
158+
test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }}
159+
test_secrets_override_base64: ${{ secrets[inputs.test_secrets_override_key] }}
172160
download_contract_artifacts_path: ${{ env.CONTRACT_ARTIFACTS_PATH }}
173161
go_mod_path: ./integration-tests/go.mod
174162
cl_repo: ${{ env.CL_ECR }}
@@ -182,3 +170,9 @@ jobs:
182170
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
183171
cache_key_id: solana-e2e-${{ env.MOD_CACHE_VERSION }}
184172
cache_restore_only: "false"
173+
DEFAULT_CHAINLINK_IMAGE: ${{ env.CL_ECR }}
174+
env:
175+
E2E_TEST_COMMON_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} # default private key
176+
E2E_TEST_COMMON_RPC_URL: https://api.devnet.solana.com # default url
177+
E2E_TEST_COMMON_WS_URL: https://api.devnet.solana.com # default url
178+
E2E_TEST_SOLANA_SECRET: thisisatestingonlysecret

.github/workflows/soak.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ on:
33
workflow_dispatch:
44
inputs:
55
base64_config:
6-
description: Your .toml file as base64
6+
description: Your .toml file as base64 (must NOT contain test secrets)
77
required: true
8+
test_secrets_override_key:
9+
description: 'Key to run tests with custom test secrets like ws url, rpc url, private key, etc.'
10+
required: false
11+
type: string
812
cl_image_tag:
913
description: Core image tag
1014
required: true
@@ -92,10 +96,12 @@ jobs:
9296
echo "::add-mask::$BASE64_CONFIG_OVERRIDE"
9397
echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> "$GITHUB_ENV"
9498
- name: Run Tests
95-
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@b49a9d04744b0237908831730f8553f26d73a94b # v2.3.17
99+
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@fdaf56b1df7248d18e30ad09982d03ec67d6b71c # v2.3.29
96100
with:
97101
test_command_to_run: cd ./integration-tests && go test -timeout 24h -count=1 -run TestSolanaOCRV2Soak/embedded -json $(args) ./soak 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage
98102
test_download_vendor_packages_command: cd ./integration-tests && go mod download
103+
test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }}
104+
test_secrets_override_base64: ${{ secrets[inputs.test_secrets_override_key] }}
99105
download_contract_artifacts_path: ${{ env.CONTRACT_ARTIFACTS_PATH }}
100106
go_mod_path: ./integration-tests/go.mod
101107
cl_repo: ${{ env.CL_ECR }}
@@ -109,3 +115,5 @@ jobs:
109115
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
110116
cache_key_id: solana-e2e-${{ env.MOD_CACHE_VERSION }}
111117
cache_restore_only: "false"
118+
env:
119+
E2E_TEST_SOLANA_SECRET: thisisatestingonlysecret

docs/RunningE2eTests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Devnet requires previously deployed programs that are owned by the person runnin
1515

1616
- `Common.network` needs to be set to `devnet` which will instruct the tests to run against devnet
1717
- `ocr2_program_id`, `access_controller_program_id`, `store_program_id`, `link_token_address`, `vault_address` need to be set so the tests know what programs to use so we avoid deploying each time.
18-
- `rpc_url` and `ws_url` need to be set
18+
- `E2E_TEST_COMMON_RPC_URL` and `E2E_TEST_COMMON_WS_URL` need to be set
1919

2020
**Localnet**
2121
Setting localnet will instruct the tests to run in localnet, the program ID's are not taken from the TOML in this scenario, but rather defined in the `integration-tests/config/config.go`.

integration-tests/testconfig/default.toml

-3
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@ access_controller_program_id = "9xi644bRR8birboDGdTiwBq3C7VEeR7VuamRYYXCubUW"
3131
store_program_id = "HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny"
3232
link_token_address = "7CF1GrsZsny5j9JESPj98MdYVZK38RE8ZpmTEMwECK4c"
3333
vault_address = "FdM4dnhVpFQfjPqNG6LEfzArhuGhUjtidYu89qtGwJCS"
34-
secret="thisisatestingonlysecret"
3534

3635
[Common]
37-
rpc_url = "https://api.devnet.solana.com"
38-
ws_url = "wss://api.devnet.solana.com/"
3936
internal_docker_repo = "public.ecr.aws/chainlink"
4037
inside_k8 = false
4138
network = "localnet"

0 commit comments

Comments
 (0)