Skip to content

Commit 2ea4d99

Browse files
authored
.github/workflows/integration-tests-smoke.yml: bump ctf-build-image for parameterized loopps; fix integration tests (#599)
1 parent 9a78065 commit 2ea4d99

File tree

6 files changed

+97
-161
lines changed

6 files changed

+97
-161
lines changed

.github/workflows/integration-tests-smoke.yml

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -27,40 +27,31 @@ env:
2727

2828
jobs:
2929
build_chainlink_image:
30-
name: Build Chainlink Image ${{matrix.image.name}}
30+
name: Build Chainlink Image
3131
runs-on: ubuntu-latest
3232
env:
3333
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3434
environment: integration
3535
permissions:
3636
id-token: write
3737
contents: read
38-
strategy:
39-
matrix:
40-
image:
41-
- name: ""
42-
dockerfile: core/chainlink.Dockerfile
43-
tag-suffix: ""
44-
- name: (plugins)
45-
dockerfile: plugins/chainlink.Dockerfile
46-
tag-suffix: -plugins
4738
steps:
4839
- name: Collect Metrics
4940
id: collect-gha-metrics
5041
uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1
5142
with:
52-
id: starknet-e2e-build${{ matrix.image.tag-suffix }}
43+
id: starknet-e2e-build
5344
org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
5445
basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
5546
hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }}
56-
this-job-name: Build Chainlink Image${{matrix.image.name}}
47+
this-job-name: Build Chainlink Image
5748
continue-on-error: true
5849
- name: Check if chainlink-starknet image exists
5950
id: check-image
6051
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
6152
with:
6253
repository: chainlink
63-
tag: starknet.${{ github.sha }}${{ matrix.image.tag-suffix }}
54+
tag: starknet.${{ github.sha }}
6455
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
6556
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
6657
- name: Get core ref from PR body
@@ -79,24 +70,24 @@ jobs:
7970
echo "CUSTOM_CORE_REF=${CL_REF}" >> "${GITHUB_ENV}"
8071
env:
8172
CL_REF: ${{ github.event.inputs.cl_branch_ref }}
82-
- name: Build Image ${{ matrix.image.name }}
73+
- name: Build Image
8374
if: steps.check-image.outputs.exists == 'false'
84-
uses: smartcontractkit/.github/actions/ctf-build-image@c4705bfdbf6c8e57c080d82a3c4f013aa96a2dfb # v2.3.19
75+
uses: smartcontractkit/.github/actions/ctf-build-image@7b28f2c598c26a8a0af8818b64d5344247752c71 # v0.1.3
8576
with:
8677
cl_repo: smartcontractkit/chainlink
8778
cl_ref: ${{ env.CUSTOM_CORE_REF }}
8879
should_checkout: true
89-
cl_dockerfile: ${{ matrix.image.dockerfile }}
80+
cl_dockerfile: plugins/chainlink.Dockerfile
9081
# commit of the caller branch
9182
dep_starknet_sha: ${{ github.event.pull_request.head.sha || github.sha }}
92-
push_tag: ${{ env.CL_ECR }}:starknet.${{ github.sha }}${{ matrix.image.tag-suffix }}
83+
push_tag: ${{ env.CL_ECR }}:starknet.${{ github.sha }}
9384
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
9485
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
9586
QA_PRIVATE_GHA_PULL: ${{ secrets.QA_PRIVATE_GHA_PULL }}
9687
- name: Print Chainlink Image Built
9788
run: |
9889
echo "### chainlink image tag used for this test run :link:" >> $GITHUB_STEP_SUMMARY
99-
echo "\`starknet.${{ github.sha }}${{ matrix.image.tag-suffix }}\`" >> $GITHUB_STEP_SUMMARY
90+
echo "\`starknet.${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
10091
10192
build_test_image:
10293
environment: integration
@@ -137,20 +128,10 @@ jobs:
137128
GITHUB_TOKEN: ${{ steps.setup-github-token.outputs.access-token }}
138129

139130
run_tests:
140-
name: Run Smoke Tests ${{matrix.image.name}}
131+
name: Run Smoke Tests
141132
runs-on: ubuntu20.04-16cores-64GB
142133
needs: [ build_chainlink_image, build_test_image ]
143134
environment: integration
144-
# these values need to match those used to build the chainlink image
145-
strategy:
146-
matrix:
147-
image:
148-
- name: ""
149-
tag-suffix: ""
150-
test-name: embedded
151-
- name: plugins
152-
tag-suffix: -plugins
153-
test-name: plugins
154135
env:
155136
INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com
156137
permissions:
@@ -163,11 +144,11 @@ jobs:
163144
id: collect-gha-metrics
164145
uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1
165146
with:
166-
id: starknet-e2e-smoke${{ matrix.image.name }}
147+
id: starknet-e2e-smoke
167148
org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
168149
basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
169150
hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }}
170-
this-job-name: Run Smoke Tests ${{ matrix.image.name }}
151+
this-job-name: Run Smoke Tests
171152
test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}'
172153
continue-on-error: true
173154
- name: Checkout the repo
@@ -182,7 +163,7 @@ jobs:
182163
uses: ./.github/actions/install-cairo
183164
- name: Setup GitHub Token
184165
id: setup-github-token
185-
uses: smartcontractkit/.github/actions/setup-github-token@9e7cc0779934cae4a9028b8588c9adb64d8ce68c # [email protected]
166+
uses: smartcontractkit/.github/actions/setup-github-token@ef78fa97bf3c77de6563db1175422703e9e6674f # 0.2.1
186167
with:
187168
aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }}
188169
aws-lambda-url: ${{ secrets.GATI_RELENG_LAMBDA_URL }}
@@ -208,15 +189,15 @@ jobs:
208189
echo ::add-mask::$BASE64_CONFIG_OVERRIDE
209190
# shellcheck disable=SC2086
210191
echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV
211-
- name: Run Tests ${{ matrix.image.name }}
212-
uses: smartcontractkit/.github/actions/ctf-run-tests@4229fea727f6eb36b4559c6eefbbf9f3825fa677 # 0.2.1
192+
- name: Run Tests
193+
uses: smartcontractkit/.github/actions/ctf-run-tests@6a6f23140de2d90b020ba3795568d2ed85cb11b9 # 0.7.0
213194
with:
214195
cl_internal_docker_repo: ${{ env.INTERNAL_DOCKER_REPO }}
215196
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
216-
test_command_to_run: nix develop -c sh -c "make test=${{ matrix.image.test-name }} test-integration-smoke-ci"
197+
test_command_to_run: nix develop -c sh -c "make test-integration-smoke-ci"
217198
test_download_vendor_packages_command: cd integration-tests && nix develop -c go mod download
218199
cl_repo: ${{ env.CL_ECR }}
219-
cl_image_tag: starknet.${{ github.sha }}${{ matrix.image.tag-suffix }}
200+
cl_image_tag: starknet.${{ github.sha }}
220201
token: ${{ secrets.GITHUB_TOKEN }}
221202
go_mod_path: ./integration-tests/go.mod
222203
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
@@ -228,8 +209,9 @@ jobs:
228209
PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.PROD_AWS_ACCOUNT_NUMBER }}
229210
gauntlet_plus_plus_image: ${{ secrets.PROD_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.PROD_AWS_REGION }}.amazonaws.com/gauntlet-plus-plus:v2.5.0
230211
gati_token: ${{ steps.setup-github-token.outputs.access-token }}
212+
enable-gap: false
231213
env:
232214
KILLGRAVE_INTERNAL_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/friendsofgo/killgrave
233215
CHAINLINK_IMAGE: ${{ env.CL_ECR }}
234-
CHAINLINK_VERSION: starknet.${{ github.sha }}${{ matrix.image.tag-suffix }}
216+
CHAINLINK_VERSION: starknet.${{ github.sha }}
235217
CHAINLINK_USER_TEAM: ${{ github.event.inputs.team || 'BIX' }}

.github/workflows/integration-tests-soak.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
uses: smartcontractkit/.github/actions/ctf-run-tests@4229fea727f6eb36b4559c6eefbbf9f3825fa677 # 0.2.1
8585
with:
8686
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
87-
test_command_to_run: cd ./integration-tests && go test -timeout 24h -count=1 -run TestOCRBasicSoak/embedded ./soak
87+
test_command_to_run: cd ./integration-tests && go test -timeout 24h -count=1 -run TestOCRBasicSoak ./soak
8888
test_download_vendor_packages_command: cd integration-tests && nix develop -c go mod download
8989
cl_repo: ${{ env.CL_ECR }}
9090
token: ${{ secrets.GITHUB_TOKEN }}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ test-integration-smoke: test-integration-prep
217217
.PHONY: test-integration-smoke-ci
218218
test-integration-smoke-ci:
219219
cd integration-tests/ && \
220-
go test --timeout=2h -v -count=1 -run TestOCRBasic/$(test) -json ./smoke | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage
220+
go test --timeout=2h -v -count=1 -run TestOCRBasic -json ./smoke | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage
221221

222222
.PHONY: test-integration-soak
223223
test-integration-soak: test-integration-prep

integration-tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ If you want to kick off the test from local:
4747
- `export ENV_JOB_IMAGE: <internal_repo>/chainlink-solana-tests:<tag>`
4848
- Base64 the .toml config
4949
- Run `export BASE64_CONFIG_OVERRIDE="<config>"`
50-
- `cd integration-tests/soak && go test -timeout 24h -count=1 -run TestOCRBasicSoak/embedded -test.timeout 30m;`
50+
- `cd integration-tests/soak && go test -timeout 24h -count=1 -run TestOCRBasicSoak -test.timeout 30m;`
5151

5252

integration-tests/smoke/ocr2_test.go

Lines changed: 35 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package smoke_test
33
import (
44
"flag"
55
"fmt"
6-
"maps"
76
"os"
87
"testing"
98

@@ -12,7 +11,6 @@ import (
1211

1312
"github.com/smartcontractkit/chainlink-testing-framework/lib/logging"
1413
"github.com/smartcontractkit/chainlink/integration-tests/actions"
15-
"github.com/smartcontractkit/chainlink/integration-tests/docker/test_env"
1614

1715
"github.com/smartcontractkit/chainlink-starknet/integration-tests/common"
1816
tc "github.com/smartcontractkit/chainlink-starknet/integration-tests/testconfig"
@@ -30,65 +28,44 @@ func init() {
3028
}
3129

3230
func TestOCRBasic(t *testing.T) {
33-
for _, test := range []struct {
34-
name string
35-
env map[string]string
36-
}{
37-
{name: "embedded"},
38-
{name: "plugins", env: map[string]string{
39-
"CL_MEDIAN_CMD": "chainlink-feeds",
40-
"CL_SOLANA_CMD": "chainlink-solana",
41-
}},
42-
} {
43-
config, err := tc.GetConfig("Smoke", tc.OCR2)
44-
if err != nil {
45-
t.Fatal(err)
46-
}
47-
err = os.Setenv("CHAINLINK_ENV_USER", *config.Common.User)
48-
require.NoError(t, err, "Could not set CHAINLINK_ENV_USER")
49-
err = os.Setenv("INTERNAL_DOCKER_REPO", *config.Common.InternalDockerRepo)
50-
require.NoError(t, err, "Could not set INTERNAL_DOCKER_REPO")
51-
t.Run(test.name, func(t *testing.T) {
52-
t.Parallel()
53-
logging.Init()
54-
//
55-
state, err := common.NewOCRv2State(t, "smoke-ocr2", &config)
56-
require.NoError(t, err, "Could not setup the ocrv2 state")
31+
config, err := tc.GetConfig("Smoke", tc.OCR2)
32+
if err != nil {
33+
t.Fatal(err)
34+
}
35+
err = os.Setenv("CHAINLINK_ENV_USER", *config.Common.User)
36+
require.NoError(t, err, "Could not set CHAINLINK_ENV_USER")
37+
err = os.Setenv("INTERNAL_DOCKER_REPO", *config.Common.InternalDockerRepo)
38+
require.NoError(t, err, "Could not set INTERNAL_DOCKER_REPO")
5739

58-
// K8s specific config and cleanup
59-
if *config.Common.InsideK8s {
60-
t.Cleanup(func() {
61-
if err = actions.TeardownSuite(t, nil, state.Common.Env, state.ChainlinkNodesK8s, nil, zapcore.PanicLevel, nil); err != nil {
62-
state.TestConfig.L.Error().Err(err).Msg("Error tearing down environment")
63-
}
64-
})
65-
}
66-
if len(test.env) > 0 {
67-
state.Common.TestEnvDetails.NodeOpts = append(state.Common.TestEnvDetails.NodeOpts, func(n *test_env.ClNode) {
68-
if n.ContainerEnvs == nil {
69-
n.ContainerEnvs = map[string]string{}
70-
}
71-
maps.Copy(n.ContainerEnvs, test.env)
72-
})
40+
logging.Init()
41+
//
42+
state, err := common.NewOCRv2State(t, "smoke-ocr2", &config)
43+
require.NoError(t, err, "Could not setup the ocrv2 state")
44+
45+
// K8s specific config and cleanup
46+
if *config.Common.InsideK8s {
47+
t.Cleanup(func() {
48+
if err = actions.TeardownSuite(t, nil, state.Common.Env, state.ChainlinkNodesK8s, nil, zapcore.PanicLevel, nil); err != nil {
49+
state.TestConfig.L.Error().Err(err).Msg("Error tearing down environment")
7350
}
74-
state.DeployCluster()
75-
// Setting up G++ Client
76-
rpcURL := state.Common.RPCDetails.RPCL2Internal
77-
gppURL := state.TestConfig.TestConfig.Common.GauntletPlusPlusURL
78-
state.Clients.GauntletPPClient, err = gauntlet.NewStarknetGauntletPlusPlus(gppURL, rpcURL, state.Account.Account, state.Account.PrivateKey)
79-
require.NoError(t, err, "Setting up gauntlet++ should not fail")
51+
})
52+
}
53+
state.DeployCluster()
54+
// Setting up G++ Client
55+
rpcURL := state.Common.RPCDetails.RPCL2Internal
56+
gppURL := state.TestConfig.TestConfig.Common.GauntletPlusPlusURL
57+
state.Clients.GauntletPPClient, err = gauntlet.NewStarknetGauntletPlusPlus(gppURL, rpcURL, state.Account.Account, state.Account.PrivateKey)
58+
require.NoError(t, err, "Setting up gauntlet++ should not fail")
8059

81-
state.Clients.GauntletClient, err = gauntlet.NewStarknetGauntlet(fmt.Sprintf("%s/", utils.ProjectRoot))
82-
require.NoError(t, err, "Setting up gauntlet should not fail")
83-
err = state.Clients.GauntletClient.SetupNetwork(state.Common.RPCDetails.RPCL2External, state.Account.Account, state.Account.PrivateKey)
84-
require.NoError(t, err, "Setting up gauntlet network should not fail")
85-
err = state.DeployGauntletPP(0, 100000000000, decimals, "auto", 1, 1)
86-
require.NoError(t, err, "Deploying contracts should not fail")
60+
state.Clients.GauntletClient, err = gauntlet.NewStarknetGauntlet(fmt.Sprintf("%s/", utils.ProjectRoot))
61+
require.NoError(t, err, "Setting up gauntlet should not fail")
62+
err = state.Clients.GauntletClient.SetupNetwork(state.Common.RPCDetails.RPCL2External, state.Account.Account, state.Account.PrivateKey)
63+
require.NoError(t, err, "Setting up gauntlet network should not fail")
64+
err = state.DeployGauntletPP(0, 100000000000, decimals, "auto", 1, 1)
65+
require.NoError(t, err, "Deploying contracts should not fail")
8766

88-
state.SetUpNodes()
67+
state.SetUpNodes()
8968

90-
err = state.ValidateRounds(*config.OCR2.NumberOfRounds, false)
91-
require.NoError(t, err, "Validating round should not fail")
92-
})
93-
}
69+
err = state.ValidateRounds(*config.OCR2.NumberOfRounds, false)
70+
require.NoError(t, err, "Validating round should not fail")
9471
}

0 commit comments

Comments
 (0)