From 6ba8f4a08073e71c24014c714611ea7811c37535 Mon Sep 17 00:00:00 2001 From: Balamurali Gopalswami Date: Fri, 22 Nov 2024 11:02:49 -0500 Subject: [PATCH 01/11] CCIP-4303:Enabling in-memory test in integration-tests workflow --- .github/e2e-tests.yml | 3 ++- .github/workflows/integration-tests.yml | 8 ++++---- integration-tests/smoke/ccip/ccip_test.go | 4 +--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/e2e-tests.yml b/.github/e2e-tests.yml index 79bdae33a89..5bd73c1d86b 100644 --- a/.github/e2e-tests.yml +++ b/.github/e2e-tests.yml @@ -947,7 +947,8 @@ runner-test-matrix: test_env_vars: E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 E2E_JD_VERSION: 0.6.0 - + PG_INSTANCE: true + - id: smoke/ccip/ccip_messaging_test.go:* path: integration-tests/smoke/ccip/ccip_messaging_test.go test_env_type: docker diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index ea0016014a7..c228904c1c0 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -210,7 +210,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 #ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@2da3cdc159329fb60245799313ac6a8329d04f26 #ctf-run-tests@0.2.0 with: workflow_name: Run Core E2E Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -251,7 +251,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 #ctf-run-tests@1.0.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@2da3cdc159329fb60245799313ac6a8329d04f26 #ctf-run-tests@1.0.0 with: workflow_name: Run Core E2E Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -296,7 +296,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@5412507526722a7b1c5d719fa686eed5a1bc4035 # ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@2da3cdc159329fb60245799313ac6a8329d04f26 # ctf-run-tests@0.2.0 with: workflow_name: Run CCIP E2E Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -337,7 +337,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@5412507526722a7b1c5d719fa686eed5a1bc4035 # ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@2da3cdc159329fb60245799313ac6a8329d04f26 # ctf-run-tests@0.2.0 with: workflow_name: Run CCIP E2E Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} diff --git a/integration-tests/smoke/ccip/ccip_test.go b/integration-tests/smoke/ccip/ccip_test.go index ee740496fa7..d5698efa75f 100644 --- a/integration-tests/smoke/ccip/ccip_test.go +++ b/integration-tests/smoke/ccip/ccip_test.go @@ -8,7 +8,6 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" "github.com/smartcontractkit/chainlink/integration-tests/testsetups" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp" @@ -18,8 +17,7 @@ import ( func TestInitialDeployOnLocal(t *testing.T) { t.Parallel() - lggr := logger.TestLogger(t) - tenv, _, _ := testsetups.NewLocalDevEnvironmentWithDefaultPrice(t, lggr, nil) + tenv := changeset.NewMemoryEnvironmentWithJobsAndContracts(t, logger.TestLogger(t), 2, 4, nil) e := tenv.Env state, err := changeset.LoadOnchainState(e) require.NoError(t, err) From 73e4131cdebd28e75d92058d644354f8ad6ae751 Mon Sep 17 00:00:00 2001 From: Balamurali Gopalswami Date: Fri, 22 Nov 2024 17:17:36 -0500 Subject: [PATCH 02/11] Fix naming for integration-tests.yml file to e2e-tests.yml --- .github/E2E_TESTS_ON_GITHUB_CI.md | 4 +- .github/e2e-tests.yml | 1 - .github/integration-tests.yml | 23 + .github/workflows/e2e-tests.yml | 739 ++++++++++++++++++ .github/workflows/integration-tests.yml | 474 +---------- .../smoke/ccip/ccip_messaging_test.go | 5 +- integration-tests/smoke/ccip/ccip_test.go | 4 +- 7 files changed, 794 insertions(+), 456 deletions(-) create mode 100644 .github/integration-tests.yml create mode 100644 .github/workflows/e2e-tests.yml diff --git a/.github/E2E_TESTS_ON_GITHUB_CI.md b/.github/E2E_TESTS_ON_GITHUB_CI.md index 26d3c9daf92..628c7fd6b95 100644 --- a/.github/E2E_TESTS_ON_GITHUB_CI.md +++ b/.github/E2E_TESTS_ON_GITHUB_CI.md @@ -22,7 +22,7 @@ These workflows are designed to run on every commit in a PR, nightly or before r Tests triggered on every commit in a PR to ensure changes do not introduce regressions. -**Workflow:** [integration-tests.yml](https://github.com/smartcontractkit/chainlink/blob/develop/.github/workflows/integration-tests.yml) +**Workflow:** [e2e-tests.yml](https://github.com/smartcontractkit/chainlink/blob/develop/.github/workflows/e2e-tests.yml) ### Nightly E2E Tests @@ -36,7 +36,7 @@ E2E tests triggered on a release tag. #### Integration (smoke) Tests -**Workflow:** [integration-tests.yml](https://github.com/smartcontractkit/chainlink/blob/develop/.github/workflows/integration-tests.yml) +**Workflow:** [e2e-tests.yml](https://github.com/smartcontractkit/chainlink/blob/develop/.github/workflows/e2e-tests.yml) #### Client Compatibility Tests diff --git a/.github/e2e-tests.yml b/.github/e2e-tests.yml index 5bd73c1d86b..5155ba80b4b 100644 --- a/.github/e2e-tests.yml +++ b/.github/e2e-tests.yml @@ -947,7 +947,6 @@ runner-test-matrix: test_env_vars: E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 E2E_JD_VERSION: 0.6.0 - PG_INSTANCE: true - id: smoke/ccip/ccip_messaging_test.go:* path: integration-tests/smoke/ccip/ccip_messaging_test.go diff --git a/.github/integration-tests.yml b/.github/integration-tests.yml new file mode 100644 index 00000000000..08d46fd761b --- /dev/null +++ b/.github/integration-tests.yml @@ -0,0 +1,23 @@ +# This file specifies the GitHub runner for each integration test and is utilized by all integration CI workflows. +# +# Each entry in this file includes the following: +# - The GitHub runner (runs_on field) that will execute tests. +# - The tests that will be run by the runner. +# - The triggers (e.g., Run PR Integration Tests) that should trigger these tests. +# +runner-test-matrix: + # START: CCIPv1.6 tests + + - id: smoke/ccip/ccip_messaging_test.go:* + path: integration-tests/smoke/ccip/ccip_messaging_test.go + test_env_type: docker + runs_on: ubuntu-latest + triggers: + - PR Integration Core Tests + test_cmd: cd integration-tests/smoke/ccip && go test ccip_messaging_test.go -timeout 12m -test.parallel=2 -count=1 -json + test_env_vars: + E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 + E2E_JD_VERSION: 0.6.0 + PG_INSTANCE: true + + # END: CCIP tests diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml new file mode 100644 index 00000000000..304cbb5dfa7 --- /dev/null +++ b/.github/workflows/e2e-tests.yml @@ -0,0 +1,739 @@ +name: E2E Tests +run-name: E2E Tests ${{ inputs.distinct_run_name && inputs.distinct_run_name || '' }} +on: + merge_group: + pull_request: + push: + tags: + - "*" + workflow_dispatch: + inputs: + cl_ref: + description: 'The ref to checkout, defaults to the calling branch' + required: false + type: string + evm-ref: + description: 'The sha of the chainlink-evm commit to use if wanted' + required: false + type: string + run_solana: + description: 'Run solana tests' + required: false + type: string + default: 'false' + distinct_run_name: + description: 'A unique identifier for this run, only use from other repos' + required: false + type: string + +# Only run 1 of this workflow at a time per PR +concurrency: + group: ${{ github.ref }}-${{ github.repository }}-${{ github.event_name }}--e2e-tests-${{ inputs.distinct_run_name }} + cancel-in-progress: true + +env: + # for run-test variables and environment + ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ inputs.evm-ref || github.sha }} + CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink + TEST_SUITE: smoke + TEST_ARGS: -test.timeout 12m + INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com + MOD_CACHE_VERSION: 2 + COLLECTION_ID: chainlink-e2e-tests + +jobs: + enforce-ctf-version: + name: Enforce CTF Version + runs-on: ubuntu-latest + # We don't directly merge dependabot PRs, so let's not waste the resources + if: github.actor != 'dependabot[bot]' + steps: + - run: echo "${{github.event_name}}" + - name: Checkout the repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref }} + - name: Check Merge Group Condition + id: condition-check + run: | + echo "Checking event condition..." + SHOULD_ENFORCE="false" + if [[ "$GITHUB_EVENT_NAME" == "merge_group" ]]; then + echo "We are in a merge_group event, now check if we are on the develop branch" + target_branch=$(cat $GITHUB_EVENT_PATH | jq -r .merge_group.base_ref) + if [[ "$target_branch" == "refs/heads/develop" ]]; then + echo "We are on the develop branch, we should enforce ctf version" + SHOULD_ENFORCE="true" + fi + fi + echo "should we enforce ctf version = $SHOULD_ENFORCE" + echo "should-enforce=$SHOULD_ENFORCE" >> $GITHUB_OUTPUT + - name: Enforce CTF Version + if: steps.condition-check.outputs.should-enforce == 'true' + uses: smartcontractkit/.github/actions/ctf-check-mod-version@21b0189c5fdca0318617d259634b1a91e6d80262 # ctf-check-mod-version@0.0.0 + with: + go-project-path: ./integration-tests + module-name: github.com/smartcontractkit/chainlink-testing-framework/lib + enforce-semantic-tag: "true" + changes: + environment: e2e + name: Check Paths That Require Tests To Run + runs-on: ubuntu-latest + # We don't directly merge dependabot PRs, so let's not waste the resources + if: github.actor != 'dependabot[bot]' + steps: + - name: Checkout the repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref }} + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + id: changes + with: + filters: | + github_ci_changes: + - '.github/workflows/e2e-tests.yml' + - '.github/workflows/run-e2e-tests-reusable-workflow.yml' + - '.github/e2e-tests.yml' + core_changes: + - '**/*.go' + - '**/*go.sum' + - '**/*go.mod' + - '**/*Dockerfile' + - 'core/**/migrations/*.sql' + - 'core/**/config/**/*.toml' + - 'integration-tests/**/*.toml' + ccip_changes: + - '**/*ccip*' + - '**/*ccip*/**' + - name: Ignore Filter On Workflow Dispatch + if: ${{ github.event_name == 'workflow_dispatch' }} + id: ignore-filter + run: echo "changes=true" >> $GITHUB_OUTPUT + outputs: + github_ci_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.github_ci_changes }} + core_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.core_changes }} + ccip_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.ccip_changes }} + + lint-e2e-tests: + name: Lint ${{ matrix.project.name }} + runs-on: ubuntu-24.04-8cores-32GB-ARM + # We don't directly merge dependabot PRs, so let's not waste the resources + if: github.actor != 'dependabot[bot]' + strategy: + matrix: + project: + - name: e2e-tests + id: e2e-tests + path: ./integration-tests + cache_id: e2e-tests + - name: load + id: load + path: ./integration-tests/load + cache_id: load + steps: + - name: Checkout the repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref }} + - name: Setup Go + uses: smartcontractkit/.github/actions/ctf-setup-go@b0d756c57fcdbcff187e74166562a029fdd5d1b9 # ctf-setup-go@0.0.0 + with: + test_download_vendor_packages_command: cd ${{ matrix.project.path }} && go mod download + go_mod_path: ${{ matrix.project.path }}/go.mod + cache_key_id: ${{ matrix.project.cache_id }} + cache_restore_only: "true" + - name: Lint Go + uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0 + with: + version: v1.62.0 + # We already cache these directories in setup-go + skip-pkg-cache: true + skip-build-cache: true + # only-new-issues is only applicable to PRs, otherwise it is always set to false + only-new-issues: false # disabled for PRs due to unreliability + args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml + working-directory: ${{ matrix.project.path }} + + build-chainlink: + environment: e2e + permissions: + id-token: write + contents: read + strategy: + matrix: + image: + - name: "" + dockerfile: core/chainlink.Dockerfile + tag-suffix: "" + - name: (plugins) + dockerfile: plugins/chainlink.Dockerfile + tag-suffix: -plugins + name: Build Chainlink Image ${{ matrix.image.name }} + runs-on: ubuntu22.04-8cores-32GB + needs: [changes, enforce-ctf-version] + steps: + - name: Checkout the repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + - name: Setup Github Token + if: ${{ inputs.evm-ref }} + id: get-gh-token + uses: smartcontractkit/.github/actions/setup-github-token@ef78fa97bf3c77de6563db1175422703e9e6674f # setup-github-token@0.2.1 + with: + aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }} + aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }} + aws-region: ${{ secrets.AWS_REGION }} + set-git-config: "true" + - name: Build Chainlink Image + if: needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true' || github.event_name == 'workflow_dispatch' + uses: ./.github/actions/build-chainlink-image + with: + tag_suffix: ${{ matrix.image.tag-suffix }} + dockerfile: ${{ matrix.image.dockerfile }} + git_commit_sha: ${{ inputs.evm-ref || github.sha }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + dep_evm_sha: ${{ inputs.evm-ref }} + + run-core-e2e-tests-for-pr: + name: Run Core E2E Tests For PR + permissions: + actions: read + checks: write + pull-requests: write + id-token: write + contents: read + needs: [build-chainlink, changes] + if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@6c81cac2e88ab503602121fe866d67830a27fc7d #ctf-run-tests@0.2.0 + with: + workflow_name: Run Core E2E Tests For PR + chainlink_version: ${{ inputs.evm-ref || github.sha }} + chainlink_upgrade_version: ${{ github.sha }} + test_path: .github/e2e-tests.yml + test_trigger: PR E2E Core Tests + upload_cl_node_coverage_artifact: true + upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ + enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: ${{ secrets.LOKI_URL }} + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + + run-core-e2e-tests-for-merge-queue: + name: Run Core E2E Tests For Merge Queue + permissions: + actions: read + checks: write + pull-requests: write + id-token: write + contents: read + needs: [build-chainlink, changes] + if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@6c81cac2e88ab503602121fe866d67830a27fc7d #ctf-run-tests@1.0.0 + with: + workflow_name: Run Core E2E Tests For Merge Queue + chainlink_version: ${{ inputs.evm-ref || github.sha }} + chainlink_upgrade_version: ${{ github.sha }} + test_path: .github/e2e-tests.yml + test_trigger: Merge Queue E2E Core Tests + upload_cl_node_coverage_artifact: true + upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ + enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} + # Notify Test Tooling team in slack when merge queue tests fail + slack_notification_after_tests: on_failure + slack_notification_after_tests_channel_id: "#team-test-tooling-internal" + slack_notification_after_tests_name: Core E2E Tests In Merge Queue + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: ${{ secrets.LOKI_URL }} + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + + run-ccip-e2e-tests-for-pr: + name: Run CCIP E2E Tests For PR + permissions: + actions: read + checks: write + pull-requests: write + id-token: write + contents: read + needs: [build-chainlink, changes] + if: github.event_name == 'pull_request' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@6c81cac2e88ab503602121fe866d67830a27fc7d # ctf-run-tests@0.2.0 + with: + workflow_name: Run CCIP E2E Tests For PR + chainlink_version: ${{ inputs.evm-ref || github.sha }} + chainlink_upgrade_version: ${{ github.sha }} + test_path: .github/e2e-tests.yml + test_trigger: PR E2E CCIP Tests + upload_cl_node_coverage_artifact: true + upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ + enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: ${{ secrets.LOKI_URL }} + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + + run-ccip-e2e-tests-for-merge-queue: + name: Run CCIP E2E Tests For Merge Queue + permissions: + actions: read + checks: write + pull-requests: write + id-token: write + contents: read + needs: [build-chainlink, changes] + if: github.event_name == 'merge_group' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@6c81cac2e88ab503602121fe866d67830a27fc7d # ctf-run-tests@0.2.0 + with: + workflow_name: Run CCIP E2E Tests For Merge Queue + chainlink_version: ${{ inputs.evm-ref || github.sha }} + chainlink_upgrade_version: ${{ github.sha }} + test_path: .github/e2e-tests.yml + test_trigger: Merge Queue E2E CCIP Tests + upload_cl_node_coverage_artifact: true + upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ + enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: ${{ secrets.LOKI_URL }} + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + + check-e2e-test-results: + if: always() + name: ETH Smoke Tests + runs-on: ubuntu-latest + needs: [lint-e2e-tests, run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] + steps: + - name: Check Core test results + id: check_core_results + run: | + results='${{ needs.run-core-e2e-tests-for-pr.outputs.test_results }}' + echo "Core test results:" + echo "$results" | jq . + + node_migration_tests_failed=$(echo $results | jq '[.[] | select(.id == "integration-tests/migration/upgrade_version_test.go:*" ) | select(.result != "success")] | length > 0') + echo "node_migration_tests_failed=$node_migration_tests_failed" >> $GITHUB_OUTPUT + + - name: Check CCIP test results + id: check_ccip_results + run: | + if [[ '${{ needs.run-ccip-e2e-tests-for-pr.result }}' != 'skipped' ]]; then + results='${{ needs.run-ccip-e2e-tests-for-pr.outputs.test_results }}' + echo "CCIP test results:" + echo "$results" | jq . + else + echo "CCIP tests were skipped." + fi + + - name: Send slack notification for failed migration tests + if: steps.check_core_results.outputs.node_migration_tests_failed == 'true' && github.event_name != 'workflow_dispatch' + uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 + env: + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + with: + channel-id: "#team-test-tooling-internal" + slack-message: ":x: :mild-panic-intensifies: Node Migration Tests Failed: \n${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}\n${{ format('Notifying ', secrets.GUARDIAN_SLACK_NOTIFICATION_HANDLE) }}" + + - name: Fail the job if core tests in PR not successful + if: always() && needs.run-core-e2e-tests-for-pr.result == 'failure' + run: exit 1 + + - name: Fail the job if core tests in merge queue not successful + if: always() && needs.run-core-e2e-tests-for-merge-queue.result == 'failure' + run: exit 1 + + - name: Fail the job if lint not successful + if: always() && needs.lint-e2e-tests.result == 'failure' + run: exit 1 + + cleanup: + name: Clean up e2e environment deployments + if: always() + needs: [run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] + runs-on: ubuntu-latest + steps: + - name: Checkout repo + if: ${{ github.event_name == 'pull_request' }} + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref }} + + - name: 🧼 Clean up Environment + if: ${{ github.event_name == 'pull_request' }} + uses: ./.github/actions/delete-deployments + with: + environment: e2e + ref: ${{ github.head_ref }} # See https://github.com/github/docs/issues/15319#issuecomment-1476705663 + + show-chainlink-node-coverage: + name: Show Chainlink Node Go Coverage + if: always() + needs: [run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] + runs-on: ubuntu-latest + steps: + - name: Checkout the repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + - name: Download All Artifacts + uses: actions/download-artifact@v4.1.8 + with: + path: cl_node_coverage_data + pattern: cl_node_coverage_data_* + merge-multiple: true + - name: Show Coverage + run: go run ./integration-tests/scripts/show_coverage.go "${{ github.workspace }}/cl_node_coverage_data/*/merged" + + ## Solana Section + get_solana_sha: + # We don't directly merge dependabot PRs, so let's not waste the resources + if: ${{ github.actor != 'dependabot[bot]' && inputs.run_solana != 'false' }} + name: Get Solana Sha From Go Mod + environment: e2e + runs-on: ubuntu-latest + outputs: + sha: ${{ steps.getsha.outputs.sha }} + steps: + - name: Checkout the repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + - name: Setup Go + uses: ./.github/actions/setup-go + with: + only-modules: "true" + - name: Get the sha from go mod + id: getshortsha + run: | + sol_ver=$(go list -m -json github.com/smartcontractkit/chainlink-solana | jq -r .Version) + if [ -z "${sol_ver}" ]; then + echo "Error: could not get the solana version from the go.mod file, look above for error(s)" + exit 1 + fi + short_sha="${sol_ver##*-}" + echo "short sha is: ${short_sha}" + echo "short_sha=${short_sha}" >> "$GITHUB_OUTPUT" + - name: Checkout solana + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink-solana + ref: develop + fetch-depth: 0 + path: solanapath + - name: Get long sha + id: getsha + run: | + cd solanapath + full_sha=$(git rev-parse ${{steps.getshortsha.outputs.short_sha}}^{}) # additional suffix allows handling tagged versions as well + if [ -z "${full_sha}" ]; then + echo "Error: could not get the full sha from the short sha using git, look above for error(s)" + exit 1 + fi + echo "sha is: ${full_sha}" + echo "sha=${full_sha}" >> "$GITHUB_OUTPUT" + + get_projectserum_version: + name: Get ProjectSerum Version + environment: e2e + runs-on: ubuntu-latest + needs: [get_solana_sha] + outputs: + projectserum_version: ${{ steps.psversion.outputs.projectserum_version }} + steps: + - name: Checkout the solana repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink-solana + ref: ${{ needs.get_solana_sha.outputs.sha }} + - name: Get ProjectSerum Version + id: psversion + uses: smartcontractkit/chainlink-solana/.github/actions/projectserum_version@4b971869e26b79c7ce3fb7c98005cc2e3f350915 # stable action on Oct 12 2022 + + solana-test-image-exists: + environment: e2e + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + name: Check If Solana Test Image Exists + runs-on: ubuntu-latest + needs: [get_solana_sha] + outputs: + exists: ${{ steps.check-image.outputs.exists }} + steps: + - name: Check if image exists + id: check-image + uses: smartcontractkit/chainlink-github-actions/docker/image-exists@0ce1e67b254a4f041e03cc6f0e3afc987b47c7bd # v2.3.30 + with: + repository: chainlink-solana-tests + tag: ${{ needs.get_solana_sha.outputs.sha }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + + solana-build-contracts: + environment: e2e + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + name: Solana Build Artifacts + runs-on: ubuntu22.04-8cores-32GB + needs: + [ + changes, + get_projectserum_version, + solana-test-image-exists, + get_solana_sha, + ] + steps: + - name: Checkout the solana repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink-solana + ref: ${{ needs.get_solana_sha.outputs.sha }} + - name: Build contracts + if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' + uses: smartcontractkit/chainlink-solana/.github/actions/build_contract_artifacts@46b1311a5a83f33d08ffa8e1e0ab04f9ad51665d # node20 update on may 10, 2024 + with: + ref: ${{ needs.get_solana_sha.outputs.sha }} + image: backpackapp/build + image-version: ${{ needs.get_projectserum_version.outputs.projectserum_version }} + + solana-build-test-image: + environment: e2e + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + name: Solana Build Test Image + runs-on: ubuntu22.04-8cores-32GB + needs: + [ + solana-build-contracts, + solana-test-image-exists, + changes, + get_solana_sha, + ] + env: + CONTRACT_ARTIFACTS_PATH: contracts/target/deploy + steps: + - name: Checkout the repo + if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink-solana + ref: ${{ needs.get_solana_sha.outputs.sha }} + - name: Download Artifacts + if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' + uses: actions/download-artifact@v4.1.8 + with: + name: artifacts + path: ${{ env.CONTRACT_ARTIFACTS_PATH }} + - name: Build Test Image + if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' + uses: smartcontractkit/.github/actions/ctf-build-test-image@a5e4f4c8fbb8e15ab2ad131552eca6ac83c4f4b3 # ctf-build-test-image@0.1.0 + with: + repository: chainlink-solana-tests + tag: ${{ needs.get_solana_sha.outputs.sha }} + suites: smoke + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + - run: echo "this exists so we don't have to run anything else if the build is skipped" + if: needs.changes.outputs.core_changes == 'false' || needs.solana-test-image-exists.outputs.exists == 'true' + + solana-smoke-tests: + if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }} + environment: e2e + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + name: Solana Smoke Tests + runs-on: ubuntu22.04-8cores-32GB + needs: + [ + build-chainlink, + solana-build-contracts, + solana-build-test-image, + changes, + get_solana_sha, + ] + env: + CHAINLINK_COMMIT_SHA: ${{ inputs.evm-ref || github.sha }} + CHAINLINK_ENV_USER: ${{ github.actor }} + TEST_LOG_LEVEL: debug + CONTRACT_ARTIFACTS_PATH: contracts/target/deploy + steps: + - name: Checkout the repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink-solana + ref: ${{ needs.get_solana_sha.outputs.sha }} + - name: Run Setup + if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' + uses: smartcontractkit/.github/actions/ctf-setup-run-tests-environment@49cb1613e96c9ce17f7290e4dabd38f43aa9bd4d # ctf-setup-run-tests-environment@0.0.0 + with: + go_mod_path: ./integration-tests/go.mod + cache_restore_only: true + cache_key_id: core-solana-e2e-${{ env.MOD_CACHE_VERSION }} + aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} + dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + - name: Pull Artifacts + if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' + run: | + IMAGE_NAME=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }} + # Pull the Docker image + docker pull "$IMAGE_NAME" + + # Create a container without starting it + CONTAINER_ID=$(docker create "$IMAGE_NAME") + + # Copy the artifacts from the container + mkdir -p ./${{env.CONTRACT_ARTIFACTS_PATH}}/ + docker cp "$CONTAINER_ID:/go/testdir/${{env.CONTRACT_ARTIFACTS_PATH}}/" "./${{env.CONTRACT_ARTIFACTS_PATH}}/../" + + # Remove the created container + docker rm "$CONTAINER_ID" + - name: Install Solana CLI # required for ensuring the local test validator is configured correctly + run: ./scripts/install-solana-ci.sh + + - name: Install gauntlet + run: | + yarn --cwd ./gauntlet install --frozen-lockfile + yarn --cwd ./gauntlet build + yarn --cwd ./gauntlet gauntlet + - name: Generate config overrides + run: | # https://github.com/smartcontractkit/chainlink-testing-framework/lib/blob/main/config/README.md + cat << EOF > config.toml + [ChainlinkImage] + version="${{ inputs.evm-ref || github.sha }}" + [Common] + user="${{ github.actor }}" + internal_docker_repo = "${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com" + EOF + # shellcheck disable=SC2002 + BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) + # shellcheck disable=SC2086 + echo ::add-mask::$BASE64_CONFIG_OVERRIDE + # shellcheck disable=SC2086 + echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV + - name: Run Tests + if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' + uses: smartcontractkit/.github/actions/ctf-run-tests@b8731364b119e88983e94b0c4da87fc27ddb41b8 # ctf-run-tests@0.0.0 + with: + test_command_to_run: export ENV_JOB_IMAGE=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }} && make test_smoke + test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }} + cl_repo: ${{ env.CHAINLINK_IMAGE }} + cl_image_tag: ${{ inputs.evm-ref || github.sha }} + publish_check_name: Solana Smoke Test Results + go_mod_path: ./integration-tests/go.mod + cache_key_id: core-solana-e2e-${{ env.MOD_CACHE_VERSION }} + token: ${{ secrets.GITHUB_TOKEN }} + aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + artifacts_name: solana-test-artifacts + artifacts_location: | + ./integration-tests/smoke/logs + ./integration-tests/smoke/db_dumps + ./integration-tests/smoke/seth_artifacts + /tmp/gotest.log + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_KUBECONFIG: "" + run_setup: false + go_coverage_src_dir: /var/tmp/go-coverage + go_coverage_dest_dir: ${{ github.workspace }}/.covdata + env: + E2E_TEST_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} + E2E_TEST_SOLANA_SECRET: thisisatestingonlysecret + + - name: Upload Coverage Data + uses: actions/upload-artifact@v4.4.3 + timeout-minutes: 2 + continue-on-error: true + with: + name: cl_node_coverage_data_solana_tests + path: .covdata + retention-days: 1 + diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index c228904c1c0..d204dc19fea 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -16,11 +16,6 @@ on: description: 'The sha of the chainlink-evm commit to use if wanted' required: false type: string - run_solana: - description: 'Run solana tests' - required: false - type: string - default: 'false' distinct_run_name: description: 'A unique identifier for this run, only use from other repos' required: false @@ -28,7 +23,7 @@ on: # Only run 1 of this workflow at a time per PR concurrency: - group: ${{ github.ref }}-${{ github.repository }}-${{ github.event_name }}--e2e-tests-${{ inputs.distinct_run_name }} + group: ${{ github.ref }}-${{ github.repository }}-${{ github.event_name }}--integration-tests-${{ inputs.distinct_run_name }} cancel-in-progress: true env: @@ -39,7 +34,7 @@ env: TEST_ARGS: -test.timeout 12m INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com MOD_CACHE_VERSION: 2 - COLLECTION_ID: chainlink-e2e-tests + COLLECTION_ID: chainlink-integration-tests jobs: enforce-ctf-version: @@ -94,8 +89,7 @@ jobs: filters: | github_ci_changes: - '.github/workflows/integration-tests.yml' - - '.github/workflows/run-e2e-tests-reusable-workflow.yml' - - '.github/e2e-tests.yml' + - '.github/integration-tests.yml' core_changes: - '**/*.go' - '**/*go.sum' @@ -115,7 +109,6 @@ jobs: github_ci_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.github_ci_changes }} core_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.core_changes }} ccip_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.ccip_changes }} - lint-integration-tests: name: Lint ${{ matrix.project.name }} runs-on: ubuntu-24.04-8cores-32GB-ARM @@ -125,9 +118,9 @@ jobs: matrix: project: - name: integration-tests - id: e2e-tests + id: integration-tests path: ./integration-tests - cache_id: e2e-tests + cache_id: integration-tests - name: load id: load path: ./integration-tests/load @@ -200,8 +193,8 @@ jobs: AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} dep_evm_sha: ${{ inputs.evm-ref }} - run-core-e2e-tests-for-pr: - name: Run Core E2E Tests For PR + run-core-integration-tests-for-pr: + name: Run Core integration Tests For PR permissions: actions: read checks: write @@ -210,39 +203,28 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@2da3cdc159329fb60245799313ac6a8329d04f26 #ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@6c81cac2e88ab503602121fe866d67830a27fc7d #ctf-run-tests@0.2.0 with: - workflow_name: Run Core E2E Tests For PR + workflow_name: Run Core Integration Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} chainlink_upgrade_version: ${{ github.sha }} - test_path: .github/e2e-tests.yml - test_trigger: PR E2E Core Tests + test_path: .github/integration-tests.yml + test_trigger: PR Integration Core Tests upload_cl_node_coverage_artifact: true upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ - enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} - QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} - QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} - GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} - LOKI_URL: ${{ secrets.LOKI_URL }} - LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - run-core-e2e-tests-for-merge-queue: - name: Run Core E2E Tests For Merge Queue + run-core-integration-tests-for-merge-queue: + name: Run Core Integration Tests For Merge Queue permissions: actions: read checks: write @@ -251,165 +233,42 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@2da3cdc159329fb60245799313ac6a8329d04f26 #ctf-run-tests@1.0.0 + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@6c81cac2e88ab503602121fe866d67830a27fc7d #ctf-run-tests@1.0.0 with: - workflow_name: Run Core E2E Tests For Merge Queue + workflow_name: Run Core Integration Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} chainlink_upgrade_version: ${{ github.sha }} - test_path: .github/e2e-tests.yml - test_trigger: Merge Queue E2E Core Tests + test_path: .github/integration-tests.yml + test_trigger: Merge Queue integration Core Tests upload_cl_node_coverage_artifact: true upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ - enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} # Notify Test Tooling team in slack when merge queue tests fail slack_notification_after_tests: on_failure - slack_notification_after_tests_channel_id: "#team-test-tooling-internal" - slack_notification_after_tests_name: Core E2E Tests In Merge Queue - secrets: - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} - QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} - QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} - GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} - LOKI_URL: ${{ secrets.LOKI_URL }} - LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - - run-ccip-e2e-tests-for-pr: - name: Run CCIP E2E Tests For PR - permissions: - actions: read - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, changes] - if: github.event_name == 'pull_request' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@2da3cdc159329fb60245799313ac6a8329d04f26 # ctf-run-tests@0.2.0 - with: - workflow_name: Run CCIP E2E Tests For PR - chainlink_version: ${{ inputs.evm-ref || github.sha }} - chainlink_upgrade_version: ${{ github.sha }} - test_path: .github/e2e-tests.yml - test_trigger: PR E2E CCIP Tests - upload_cl_node_coverage_artifact: true - upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ - enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} - secrets: - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} - QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} - QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} - GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} - LOKI_URL: ${{ secrets.LOKI_URL }} - LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - - run-ccip-e2e-tests-for-merge-queue: - name: Run CCIP E2E Tests For Merge Queue - permissions: - actions: read - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, changes] - if: github.event_name == 'merge_group' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@2da3cdc159329fb60245799313ac6a8329d04f26 # ctf-run-tests@0.2.0 - with: - workflow_name: Run CCIP E2E Tests For Merge Queue - chainlink_version: ${{ inputs.evm-ref || github.sha }} - chainlink_upgrade_version: ${{ github.sha }} - test_path: .github/e2e-tests.yml - test_trigger: Merge Queue E2E CCIP Tests - upload_cl_node_coverage_artifact: true - upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ - enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} + slack_notification_after_tests_channel_id: "#ccip-testing" + slack_notification_after_tests_name: Core integration Tests In Merge Queue secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} - QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} - QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} - GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} - LOKI_URL: ${{ secrets.LOKI_URL }} - LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - check-e2e-test-results: + check-integration-test-results: if: always() - name: ETH Smoke Tests + name: Integration Tests runs-on: ubuntu-latest - needs: [lint-integration-tests, run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] + needs: [lint-integration-tests,run-core-integration-tests-for-pr,run-core-integration-tests-for-merge-queue] steps: - - name: Check Core test results - id: check_core_results - run: | - results='${{ needs.run-core-e2e-tests-for-pr.outputs.test_results }}' - echo "Core test results:" - echo "$results" | jq . - - node_migration_tests_failed=$(echo $results | jq '[.[] | select(.id == "integration-tests/migration/upgrade_version_test.go:*" ) | select(.result != "success")] | length > 0') - echo "node_migration_tests_failed=$node_migration_tests_failed" >> $GITHUB_OUTPUT - - - name: Check CCIP test results - id: check_ccip_results - run: | - if [[ '${{ needs.run-ccip-e2e-tests-for-pr.result }}' != 'skipped' ]]; then - results='${{ needs.run-ccip-e2e-tests-for-pr.outputs.test_results }}' - echo "CCIP test results:" - echo "$results" | jq . - else - echo "CCIP tests were skipped." - fi - - - name: Send slack notification for failed migration tests - if: steps.check_core_results.outputs.node_migration_tests_failed == 'true' && github.event_name != 'workflow_dispatch' - uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - env: - SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - with: - channel-id: "#team-test-tooling-internal" - slack-message: ":x: :mild-panic-intensifies: Node Migration Tests Failed: \n${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}\n${{ format('Notifying ', secrets.GUARDIAN_SLACK_NOTIFICATION_HANDLE) }}" - - name: Fail the job if core tests in PR not successful - if: always() && needs.run-core-e2e-tests-for-pr.result == 'failure' + if: always() && needs.run-core-integration-tests-for-pr.result == 'failure' run: exit 1 - name: Fail the job if core tests in merge queue not successful - if: always() && needs.run-core-e2e-tests-for-merge-queue.result == 'failure' + if: always() && needs.run-core-integration-tests-for-merge-queue.result == 'failure' run: exit 1 - name: Fail the job if lint not successful @@ -419,7 +278,7 @@ jobs: cleanup: name: Clean up integration environment deployments if: always() - needs: [run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] + needs: [run-core-integration-tests-for-pr, run-core-integration-tests-for-merge-queue] runs-on: ubuntu-latest steps: - name: Checkout repo @@ -439,7 +298,7 @@ jobs: show-chainlink-node-coverage: name: Show Chainlink Node Go Coverage if: always() - needs: [run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] + needs: [run-core-integration-tests-for-pr, run-core-integration-tests-for-merge-queue] runs-on: ubuntu-latest steps: - name: Checkout the repo @@ -456,284 +315,3 @@ jobs: - name: Show Coverage run: go run ./integration-tests/scripts/show_coverage.go "${{ github.workspace }}/cl_node_coverage_data/*/merged" - ## Solana Section - get_solana_sha: - # We don't directly merge dependabot PRs, so let's not waste the resources - if: ${{ github.actor != 'dependabot[bot]' && inputs.run_solana != 'false' }} - name: Get Solana Sha From Go Mod - environment: Integration - runs-on: ubuntu-latest - outputs: - sha: ${{ steps.getsha.outputs.sha }} - steps: - - name: Checkout the repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Setup Go - uses: ./.github/actions/setup-go - with: - only-modules: "true" - - name: Get the sha from go mod - id: getshortsha - run: | - sol_ver=$(go list -m -json github.com/smartcontractkit/chainlink-solana | jq -r .Version) - if [ -z "${sol_ver}" ]; then - echo "Error: could not get the solana version from the go.mod file, look above for error(s)" - exit 1 - fi - short_sha="${sol_ver##*-}" - echo "short sha is: ${short_sha}" - echo "short_sha=${short_sha}" >> "$GITHUB_OUTPUT" - - name: Checkout solana - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink-solana - ref: develop - fetch-depth: 0 - path: solanapath - - name: Get long sha - id: getsha - run: | - cd solanapath - full_sha=$(git rev-parse ${{steps.getshortsha.outputs.short_sha}}^{}) # additional suffix allows handling tagged versions as well - if [ -z "${full_sha}" ]; then - echo "Error: could not get the full sha from the short sha using git, look above for error(s)" - exit 1 - fi - echo "sha is: ${full_sha}" - echo "sha=${full_sha}" >> "$GITHUB_OUTPUT" - - get_projectserum_version: - name: Get ProjectSerum Version - environment: integration - runs-on: ubuntu-latest - needs: [get_solana_sha] - outputs: - projectserum_version: ${{ steps.psversion.outputs.projectserum_version }} - steps: - - name: Checkout the solana repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink-solana - ref: ${{ needs.get_solana_sha.outputs.sha }} - - name: Get ProjectSerum Version - id: psversion - uses: smartcontractkit/chainlink-solana/.github/actions/projectserum_version@4b971869e26b79c7ce3fb7c98005cc2e3f350915 # stable action on Oct 12 2022 - - solana-test-image-exists: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: Check If Solana Test Image Exists - runs-on: ubuntu-latest - needs: [get_solana_sha] - outputs: - exists: ${{ steps.check-image.outputs.exists }} - steps: - - name: Check if image exists - id: check-image - uses: smartcontractkit/chainlink-github-actions/docker/image-exists@0ce1e67b254a4f041e03cc6f0e3afc987b47c7bd # v2.3.30 - with: - repository: chainlink-solana-tests - tag: ${{ needs.get_solana_sha.outputs.sha }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - - solana-build-contracts: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: Solana Build Artifacts - runs-on: ubuntu22.04-8cores-32GB - needs: - [ - changes, - get_projectserum_version, - solana-test-image-exists, - get_solana_sha, - ] - steps: - - name: Checkout the solana repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink-solana - ref: ${{ needs.get_solana_sha.outputs.sha }} - - name: Build contracts - if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' - uses: smartcontractkit/chainlink-solana/.github/actions/build_contract_artifacts@46b1311a5a83f33d08ffa8e1e0ab04f9ad51665d # node20 update on may 10, 2024 - with: - ref: ${{ needs.get_solana_sha.outputs.sha }} - image: backpackapp/build - image-version: ${{ needs.get_projectserum_version.outputs.projectserum_version }} - - solana-build-test-image: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: Solana Build Test Image - runs-on: ubuntu22.04-8cores-32GB - needs: - [ - solana-build-contracts, - solana-test-image-exists, - changes, - get_solana_sha, - ] - env: - CONTRACT_ARTIFACTS_PATH: contracts/target/deploy - steps: - - name: Checkout the repo - if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink-solana - ref: ${{ needs.get_solana_sha.outputs.sha }} - - name: Download Artifacts - if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' - uses: actions/download-artifact@v4.1.8 - with: - name: artifacts - path: ${{ env.CONTRACT_ARTIFACTS_PATH }} - - name: Build Test Image - if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' - uses: smartcontractkit/.github/actions/ctf-build-test-image@a5e4f4c8fbb8e15ab2ad131552eca6ac83c4f4b3 # ctf-build-test-image@0.1.0 - with: - repository: chainlink-solana-tests - tag: ${{ needs.get_solana_sha.outputs.sha }} - suites: smoke - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - - run: echo "this exists so we don't have to run anything else if the build is skipped" - if: needs.changes.outputs.core_changes == 'false' || needs.solana-test-image-exists.outputs.exists == 'true' - - solana-smoke-tests: - if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }} - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: Solana Smoke Tests - runs-on: ubuntu22.04-8cores-32GB - needs: - [ - build-chainlink, - solana-build-contracts, - solana-build-test-image, - changes, - get_solana_sha, - ] - env: - CHAINLINK_COMMIT_SHA: ${{ inputs.evm-ref || github.sha }} - CHAINLINK_ENV_USER: ${{ github.actor }} - TEST_LOG_LEVEL: debug - CONTRACT_ARTIFACTS_PATH: contracts/target/deploy - steps: - - name: Checkout the repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink-solana - ref: ${{ needs.get_solana_sha.outputs.sha }} - - name: Run Setup - if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' - uses: smartcontractkit/.github/actions/ctf-setup-run-tests-environment@49cb1613e96c9ce17f7290e4dabd38f43aa9bd4d # ctf-setup-run-tests-environment@0.0.0 - with: - go_mod_path: ./integration-tests/go.mod - cache_restore_only: true - cache_key_id: core-solana-e2e-${{ env.MOD_CACHE_VERSION }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Pull Artifacts - if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' - run: | - IMAGE_NAME=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }} - # Pull the Docker image - docker pull "$IMAGE_NAME" - - # Create a container without starting it - CONTAINER_ID=$(docker create "$IMAGE_NAME") - - # Copy the artifacts from the container - mkdir -p ./${{env.CONTRACT_ARTIFACTS_PATH}}/ - docker cp "$CONTAINER_ID:/go/testdir/${{env.CONTRACT_ARTIFACTS_PATH}}/" "./${{env.CONTRACT_ARTIFACTS_PATH}}/../" - - # Remove the created container - docker rm "$CONTAINER_ID" - - name: Install Solana CLI # required for ensuring the local test validator is configured correctly - run: ./scripts/install-solana-ci.sh - - - name: Install gauntlet - run: | - yarn --cwd ./gauntlet install --frozen-lockfile - yarn --cwd ./gauntlet build - yarn --cwd ./gauntlet gauntlet - - name: Generate config overrides - run: | # https://github.com/smartcontractkit/chainlink-testing-framework/lib/blob/main/config/README.md - cat << EOF > config.toml - [ChainlinkImage] - version="${{ inputs.evm-ref || github.sha }}" - [Common] - user="${{ github.actor }}" - internal_docker_repo = "${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com" - EOF - # shellcheck disable=SC2002 - BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) - # shellcheck disable=SC2086 - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - # shellcheck disable=SC2086 - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Run Tests - if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' - uses: smartcontractkit/.github/actions/ctf-run-tests@b8731364b119e88983e94b0c4da87fc27ddb41b8 # ctf-run-tests@0.0.0 - with: - test_command_to_run: export ENV_JOB_IMAGE=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }} && make test_smoke - test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }} - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ inputs.evm-ref || github.sha }} - publish_check_name: Solana Smoke Test Results - go_mod_path: ./integration-tests/go.mod - cache_key_id: core-solana-e2e-${{ env.MOD_CACHE_VERSION }} - token: ${{ secrets.GITHUB_TOKEN }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_name: solana-test-artifacts - artifacts_location: | - ./integration-tests/smoke/logs - ./integration-tests/smoke/db_dumps - ./integration-tests/smoke/seth_artifacts - /tmp/gotest.log - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: "" - run_setup: false - go_coverage_src_dir: /var/tmp/go-coverage - go_coverage_dest_dir: ${{ github.workspace }}/.covdata - env: - E2E_TEST_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} - E2E_TEST_SOLANA_SECRET: thisisatestingonlysecret - - - name: Upload Coverage Data - uses: actions/upload-artifact@v4.4.3 - timeout-minutes: 2 - continue-on-error: true - with: - name: cl_node_coverage_data_solana_tests - path: .covdata - retention-days: 1 - diff --git a/integration-tests/smoke/ccip/ccip_messaging_test.go b/integration-tests/smoke/ccip/ccip_messaging_test.go index 1eb16838c92..a8aa4bea916 100644 --- a/integration-tests/smoke/ccip/ccip_messaging_test.go +++ b/integration-tests/smoke/ccip/ccip_messaging_test.go @@ -15,10 +15,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/hashutil" "github.com/smartcontractkit/chainlink-common/pkg/merklemulti" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" - "github.com/smartcontractkit/chainlink/integration-tests/testsetups" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" @@ -47,9 +45,8 @@ type messagingTestCaseOutput struct { func Test_CCIPMessaging(t *testing.T) { // Setup 2 chains and a single lane. - lggr := logger.TestLogger(t) ctx := changeset.Context(t) - e, _, _ := testsetups.NewLocalDevEnvironmentWithDefaultPrice(t, lggr, nil) + e := changeset.NewMemoryEnvironmentWithJobsAndContracts(t, logger.TestLogger(t), 2, 4, nil) state, err := changeset.LoadOnchainState(e.Env) require.NoError(t, err) diff --git a/integration-tests/smoke/ccip/ccip_test.go b/integration-tests/smoke/ccip/ccip_test.go index d5698efa75f..ee740496fa7 100644 --- a/integration-tests/smoke/ccip/ccip_test.go +++ b/integration-tests/smoke/ccip/ccip_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" "github.com/smartcontractkit/chainlink/integration-tests/testsetups" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp" @@ -17,7 +18,8 @@ import ( func TestInitialDeployOnLocal(t *testing.T) { t.Parallel() - tenv := changeset.NewMemoryEnvironmentWithJobsAndContracts(t, logger.TestLogger(t), 2, 4, nil) + lggr := logger.TestLogger(t) + tenv, _, _ := testsetups.NewLocalDevEnvironmentWithDefaultPrice(t, lggr, nil) e := tenv.Env state, err := changeset.LoadOnchainState(e) require.NoError(t, err) From 56fc8d5eb778d6804ea1b7e93959aec4f5994a1b Mon Sep 17 00:00:00 2001 From: Balamurali Gopalswami Date: Mon, 25 Nov 2024 16:07:36 -0500 Subject: [PATCH 03/11] Rename the existing integration-tests to e2e-tests and adding new integration-tests workflow --- .github/e2e-tests.yml | 13 ----------- .github/integration-tests.yml | 6 ++--- .github/workflows/e2e-tests.yml | 20 ++++++++--------- .github/workflows/integration-tests.yml | 30 +++++++++++-------------- 4 files changed, 26 insertions(+), 43 deletions(-) diff --git a/.github/e2e-tests.yml b/.github/e2e-tests.yml index bf3b49eef7b..9f6495c46f7 100644 --- a/.github/e2e-tests.yml +++ b/.github/e2e-tests.yml @@ -947,19 +947,6 @@ runner-test-matrix: test_env_vars: E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 E2E_JD_VERSION: 0.6.0 - - - id: smoke/ccip/ccip_messaging_test.go:* - path: integration-tests/smoke/ccip/ccip_messaging_test.go - test_env_type: docker - runs_on: ubuntu-latest - triggers: - - PR E2E Core Tests - - Nightly E2E Tests - test_cmd: cd integration-tests/smoke/ccip && go test ccip_messaging_test.go -timeout 15m -test.parallel=1 -count=1 -json - pyroscope_env: ci-smoke-ccipv1_6-evm-simulated - test_env_vars: - E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 - E2E_JD_VERSION: 0.6.0 - id: smoke/ccip/ccip_batching_test.go:* path: integration-tests/smoke/ccip/ccip_batching_test.go diff --git a/.github/integration-tests.yml b/.github/integration-tests.yml index 08d46fd761b..1a43914ac75 100644 --- a/.github/integration-tests.yml +++ b/.github/integration-tests.yml @@ -10,14 +10,14 @@ runner-test-matrix: - id: smoke/ccip/ccip_messaging_test.go:* path: integration-tests/smoke/ccip/ccip_messaging_test.go - test_env_type: docker + test_env_type: in-memory runs_on: ubuntu-latest triggers: - - PR Integration Core Tests + - PR Integration CCIP Tests test_cmd: cd integration-tests/smoke/ccip && go test ccip_messaging_test.go -timeout 12m -test.parallel=2 -count=1 -json test_env_vars: E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 E2E_JD_VERSION: 0.6.0 PG_INSTANCE: true - + # END: CCIP tests diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 304cbb5dfa7..b2e9805c31a 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -77,7 +77,7 @@ jobs: module-name: github.com/smartcontractkit/chainlink-testing-framework/lib enforce-semantic-tag: "true" changes: - environment: e2e + environment: integration name: Check Paths That Require Tests To Run runs-on: ubuntu-latest # We don't directly merge dependabot PRs, so let's not waste the resources @@ -158,7 +158,7 @@ jobs: working-directory: ${{ matrix.project.path }} build-chainlink: - environment: e2e + environment: integration permissions: id-token: write contents: read @@ -210,7 +210,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@6c81cac2e88ab503602121fe866d67830a27fc7d #ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7d412133c4083bef6ceab13d897ac16d9c184b97 #ctf-run-tests@0.2.0 with: workflow_name: Run Core E2E Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -251,7 +251,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@6c81cac2e88ab503602121fe866d67830a27fc7d #ctf-run-tests@1.0.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7d412133c4083bef6ceab13d897ac16d9c184b97 #ctf-run-tests@1.0.0 with: workflow_name: Run Core E2E Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -296,7 +296,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@6c81cac2e88ab503602121fe866d67830a27fc7d # ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7d412133c4083bef6ceab13d897ac16d9c184b97 # ctf-run-tests@0.2.0 with: workflow_name: Run CCIP E2E Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -337,7 +337,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@6c81cac2e88ab503602121fe866d67830a27fc7d # ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7d412133c4083bef6ceab13d897ac16d9c184b97 # ctf-run-tests@0.2.0 with: workflow_name: Run CCIP E2E Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -523,7 +523,7 @@ jobs: uses: smartcontractkit/chainlink-solana/.github/actions/projectserum_version@4b971869e26b79c7ce3fb7c98005cc2e3f350915 # stable action on Oct 12 2022 solana-test-image-exists: - environment: e2e + environment: integration permissions: checks: write pull-requests: write @@ -545,7 +545,7 @@ jobs: AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} solana-build-contracts: - environment: e2e + environment: integration permissions: checks: write pull-requests: write @@ -575,7 +575,7 @@ jobs: image-version: ${{ needs.get_projectserum_version.outputs.projectserum_version }} solana-build-test-image: - environment: e2e + environment: integration permissions: checks: write pull-requests: write @@ -620,7 +620,7 @@ jobs: solana-smoke-tests: if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }} - environment: e2e + environment: integration permissions: checks: write pull-requests: write diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index d204dc19fea..27a95348c4c 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -193,8 +193,8 @@ jobs: AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} dep_evm_sha: ${{ inputs.evm-ref }} - run-core-integration-tests-for-pr: - name: Run Core integration Tests For PR + run-ccip-integration-tests-for-pr: + name: Run CCIP integration Tests For PR permissions: actions: read checks: write @@ -203,13 +203,12 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@6c81cac2e88ab503602121fe866d67830a27fc7d #ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@9dcd7f8e7e4ee66de19d7077d955751f33899d0f #ctf-run-tests@0.2.0 with: - workflow_name: Run Core Integration Tests For PR + workflow_name: Run CCIP Integration Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} - chainlink_upgrade_version: ${{ github.sha }} test_path: .github/integration-tests.yml - test_trigger: PR Integration Core Tests + test_trigger: PR Integration CCIP Tests upload_cl_node_coverage_artifact: true upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ secrets: @@ -220,11 +219,10 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - run-core-integration-tests-for-merge-queue: - name: Run Core Integration Tests For Merge Queue + run-ccip-integration-tests-for-merge-queue: + name: Run CCIP Integration Tests For Merge Queue permissions: actions: read checks: write @@ -233,13 +231,12 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@6c81cac2e88ab503602121fe866d67830a27fc7d #ctf-run-tests@1.0.0 + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@9dcd7f8e7e4ee66de19d7077d955751f33899d0f #ctf-run-tests@1.0.0 with: - workflow_name: Run Core Integration Tests For Merge Queue + workflow_name: Run CCIP Integration Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} - chainlink_upgrade_version: ${{ github.sha }} test_path: .github/integration-tests.yml - test_trigger: Merge Queue integration Core Tests + test_trigger: Merge Queue integration CCIP Tests upload_cl_node_coverage_artifact: true upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ # Notify Test Tooling team in slack when merge queue tests fail @@ -254,14 +251,13 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} check-integration-test-results: if: always() name: Integration Tests runs-on: ubuntu-latest - needs: [lint-integration-tests,run-core-integration-tests-for-pr,run-core-integration-tests-for-merge-queue] + needs: [lint-integration-tests,run-ccip-integration-tests-for-pr,run-ccip-integration-tests-for-merge-queue] steps: - name: Fail the job if core tests in PR not successful if: always() && needs.run-core-integration-tests-for-pr.result == 'failure' @@ -278,7 +274,7 @@ jobs: cleanup: name: Clean up integration environment deployments if: always() - needs: [run-core-integration-tests-for-pr, run-core-integration-tests-for-merge-queue] + needs: [run-ccip-integration-tests-for-pr, run-ccip-integration-tests-for-merge-queue] runs-on: ubuntu-latest steps: - name: Checkout repo @@ -298,7 +294,7 @@ jobs: show-chainlink-node-coverage: name: Show Chainlink Node Go Coverage if: always() - needs: [run-core-integration-tests-for-pr, run-core-integration-tests-for-merge-queue] + needs: [run-ccip-integration-tests-for-pr, run-ccip-integration-tests-for-merge-queue] runs-on: ubuntu-latest steps: - name: Checkout the repo From 3b5cdb57c9984a4f028db563a4da54c4f49062f7 Mon Sep 17 00:00:00 2001 From: Balamurali Gopalswami Date: Tue, 26 Nov 2024 09:44:53 -0500 Subject: [PATCH 04/11] More cleanup --- .github/integration-tests.yml | 2 - .github/workflows/e2e-tests.yml | 8 +- .github/workflows/integration-tests.yml | 161 +++--------------------- 3 files changed, 18 insertions(+), 153 deletions(-) diff --git a/.github/integration-tests.yml b/.github/integration-tests.yml index 1a43914ac75..feb302e1dd9 100644 --- a/.github/integration-tests.yml +++ b/.github/integration-tests.yml @@ -18,6 +18,4 @@ runner-test-matrix: test_env_vars: E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 E2E_JD_VERSION: 0.6.0 - PG_INSTANCE: true - # END: CCIP tests diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index b2e9805c31a..dd3474ff212 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -210,7 +210,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7d412133c4083bef6ceab13d897ac16d9c184b97 #ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 #ctf-run-tests@0.2.0 with: workflow_name: Run Core E2E Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -251,7 +251,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7d412133c4083bef6ceab13d897ac16d9c184b97 #ctf-run-tests@1.0.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 #ctf-run-tests@1.0.0 with: workflow_name: Run Core E2E Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -296,7 +296,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7d412133c4083bef6ceab13d897ac16d9c184b97 # ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 # ctf-run-tests@0.2.0 with: workflow_name: Run CCIP E2E Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -337,7 +337,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7d412133c4083bef6ceab13d897ac16d9c184b97 # ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 # ctf-run-tests@0.2.0 with: workflow_name: Run CCIP E2E Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 27a95348c4c..410a9e7bfc6 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -1,5 +1,5 @@ name: Integration Tests -run-name: Integration Tests ${{ inputs.distinct_run_name && inputs.distinct_run_name || '' }} +run-name: Integration Tests on: merge_group: pull_request: @@ -12,65 +12,13 @@ on: description: 'The ref to checkout, defaults to the calling branch' required: false type: string - evm-ref: - description: 'The sha of the chainlink-evm commit to use if wanted' - required: false - type: string - distinct_run_name: - description: 'A unique identifier for this run, only use from other repos' - required: false - type: string # Only run 1 of this workflow at a time per PR concurrency: - group: ${{ github.ref }}-${{ github.repository }}-${{ github.event_name }}--integration-tests-${{ inputs.distinct_run_name }} + group: ${{ github.ref }}-${{ github.repository }}-${{ github.event_name }}--integration-tests cancel-in-progress: true -env: - # for run-test variables and environment - ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ inputs.evm-ref || github.sha }} - CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink - TEST_SUITE: smoke - TEST_ARGS: -test.timeout 12m - INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com - MOD_CACHE_VERSION: 2 - COLLECTION_ID: chainlink-integration-tests - jobs: - enforce-ctf-version: - name: Enforce CTF Version - runs-on: ubuntu-latest - # We don't directly merge dependabot PRs, so let's not waste the resources - if: github.actor != 'dependabot[bot]' - steps: - - run: echo "${{github.event_name}}" - - name: Checkout the repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref }} - - name: Check Merge Group Condition - id: condition-check - run: | - echo "Checking event condition..." - SHOULD_ENFORCE="false" - if [[ "$GITHUB_EVENT_NAME" == "merge_group" ]]; then - echo "We are in a merge_group event, now check if we are on the develop branch" - target_branch=$(cat $GITHUB_EVENT_PATH | jq -r .merge_group.base_ref) - if [[ "$target_branch" == "refs/heads/develop" ]]; then - echo "We are on the develop branch, we should enforce ctf version" - SHOULD_ENFORCE="true" - fi - fi - echo "should we enforce ctf version = $SHOULD_ENFORCE" - echo "should-enforce=$SHOULD_ENFORCE" >> $GITHUB_OUTPUT - - name: Enforce CTF Version - if: steps.condition-check.outputs.should-enforce == 'true' - uses: smartcontractkit/.github/actions/ctf-check-mod-version@21b0189c5fdca0318617d259634b1a91e6d80262 # ctf-check-mod-version@0.0.0 - with: - go-project-path: ./integration-tests - module-name: github.com/smartcontractkit/chainlink-testing-framework/lib - enforce-semantic-tag: "true" changes: environment: integration name: Check Paths That Require Tests To Run @@ -121,10 +69,6 @@ jobs: id: integration-tests path: ./integration-tests cache_id: integration-tests - - name: load - id: load - path: ./integration-tests/load - cache_id: load steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 @@ -150,49 +94,6 @@ jobs: args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml working-directory: ${{ matrix.project.path }} - build-chainlink: - environment: integration - permissions: - id-token: write - contents: read - strategy: - matrix: - image: - - name: "" - dockerfile: core/chainlink.Dockerfile - tag-suffix: "" - - name: (plugins) - dockerfile: plugins/chainlink.Dockerfile - tag-suffix: -plugins - name: Build Chainlink Image ${{ matrix.image.name }} - runs-on: ubuntu22.04-8cores-32GB - needs: [changes, enforce-ctf-version] - steps: - - name: Checkout the repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Setup Github Token - if: ${{ inputs.evm-ref }} - id: get-gh-token - uses: smartcontractkit/.github/actions/setup-github-token@ef78fa97bf3c77de6563db1175422703e9e6674f # setup-github-token@0.2.1 - with: - aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }} - aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }} - aws-region: ${{ secrets.AWS_REGION }} - set-git-config: "true" - - name: Build Chainlink Image - if: needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true' || github.event_name == 'workflow_dispatch' - uses: ./.github/actions/build-chainlink-image - with: - tag_suffix: ${{ matrix.image.tag-suffix }} - dockerfile: ${{ matrix.image.dockerfile }} - git_commit_sha: ${{ inputs.evm-ref || github.sha }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - dep_evm_sha: ${{ inputs.evm-ref }} - run-ccip-integration-tests-for-pr: name: Run CCIP integration Tests For PR permissions: @@ -201,24 +102,18 @@ jobs: pull-requests: write id-token: write contents: read - needs: [build-chainlink, changes] - if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@9dcd7f8e7e4ee66de19d7077d955751f33899d0f #ctf-run-tests@0.2.0 + needs: changes + if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 #ctf-run-tests@0.2.0 with: workflow_name: Run CCIP Integration Tests For PR - chainlink_version: ${{ inputs.evm-ref || github.sha }} test_path: .github/integration-tests.yml test_trigger: PR Integration CCIP Tests - upload_cl_node_coverage_artifact: true - upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} run-ccip-integration-tests-for-merge-queue: @@ -229,28 +124,21 @@ jobs: pull-requests: write id-token: write contents: read - needs: [build-chainlink, changes] - if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@9dcd7f8e7e4ee66de19d7077d955751f33899d0f #ctf-run-tests@1.0.0 + needs: changes + if: github.event_name == 'merge_group' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 #ctf-run-tests@1.0.0 with: workflow_name: Run CCIP Integration Tests For Merge Queue - chainlink_version: ${{ inputs.evm-ref || github.sha }} test_path: .github/integration-tests.yml test_trigger: Merge Queue integration CCIP Tests - upload_cl_node_coverage_artifact: true - upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ - # Notify Test Tooling team in slack when merge queue tests fail slack_notification_after_tests: on_failure slack_notification_after_tests_channel_id: "#ccip-testing" - slack_notification_after_tests_name: Core integration Tests In Merge Queue + slack_notification_after_tests_name: CCIP integration Tests In Merge Queue secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} check-integration-test-results: @@ -259,12 +147,12 @@ jobs: runs-on: ubuntu-latest needs: [lint-integration-tests,run-ccip-integration-tests-for-pr,run-ccip-integration-tests-for-merge-queue] steps: - - name: Fail the job if core tests in PR not successful - if: always() && needs.run-core-integration-tests-for-pr.result == 'failure' + - name: Fail the job if ccip tests in PR not successful + if: always() && needs.run-ccip-integration-tests-for-pr.result == 'failure' run: exit 1 - - name: Fail the job if core tests in merge queue not successful - if: always() && needs.run-core-integration-tests-for-merge-queue.result == 'failure' + - name: Fail the job if ccip tests in merge queue not successful + if: always() && needs.run-ccip-integration-tests-for-merge-queue.result == 'failure' run: exit 1 - name: Fail the job if lint not successful @@ -289,25 +177,4 @@ jobs: uses: ./.github/actions/delete-deployments with: environment: integration - ref: ${{ github.head_ref }} # See https://github.com/github/docs/issues/15319#issuecomment-1476705663 - - show-chainlink-node-coverage: - name: Show Chainlink Node Go Coverage - if: always() - needs: [run-ccip-integration-tests-for-pr, run-ccip-integration-tests-for-merge-queue] - runs-on: ubuntu-latest - steps: - - name: Checkout the repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Download All Artifacts - uses: actions/download-artifact@v4.1.8 - with: - path: cl_node_coverage_data - pattern: cl_node_coverage_data_* - merge-multiple: true - - name: Show Coverage - run: go run ./integration-tests/scripts/show_coverage.go "${{ github.workspace }}/cl_node_coverage_data/*/merged" - + ref: ${{ github.head_ref }} # See https://github.com/github/docs/issues/15319#issuecomment-1476705663 \ No newline at end of file From a0c91f31fdb32e452ebaf0675bdc488de2f4643c Mon Sep 17 00:00:00 2001 From: Balamurali Gopalswami Date: Tue, 26 Nov 2024 11:24:06 -0500 Subject: [PATCH 05/11] Update reference --- .github/workflows/e2e-tests.yml | 8 ++++---- .github/workflows/integration-tests.yml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index dd3474ff212..908e18160b8 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -210,7 +210,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 #ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7e31bd04943462f8dbef4d263bac92e54cafbd48 #ctf-run-tests@0.2.0 with: workflow_name: Run Core E2E Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -251,7 +251,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 #ctf-run-tests@1.0.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7e31bd04943462f8dbef4d263bac92e54cafbd48 #ctf-run-tests@1.0.0 with: workflow_name: Run Core E2E Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -296,7 +296,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 # ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7e31bd04943462f8dbef4d263bac92e54cafbd48 # ctf-run-tests@0.2.0 with: workflow_name: Run CCIP E2E Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -337,7 +337,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 # ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7e31bd04943462f8dbef4d263bac92e54cafbd48 # ctf-run-tests@0.2.0 with: workflow_name: Run CCIP E2E Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 410a9e7bfc6..a07a2795523 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -104,7 +104,7 @@ jobs: contents: read needs: changes if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 #ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@7e31bd04943462f8dbef4d263bac92e54cafbd48 #ctf-run-tests@0.2.0 with: workflow_name: Run CCIP Integration Tests For PR test_path: .github/integration-tests.yml @@ -126,7 +126,7 @@ jobs: contents: read needs: changes if: github.event_name == 'merge_group' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 #ctf-run-tests@1.0.0 + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@7e31bd04943462f8dbef4d263bac92e54cafbd48 #ctf-run-tests@1.0.0 with: workflow_name: Run CCIP Integration Tests For Merge Queue test_path: .github/integration-tests.yml From c5bac752f5e594486feac93c1f7fcac97089a5e4 Mon Sep 17 00:00:00 2001 From: Balamurali Gopalswami Date: Tue, 26 Nov 2024 13:33:42 -0500 Subject: [PATCH 06/11] Update reference --- .github/workflows/e2e-tests.yml | 8 ++++---- .github/workflows/integration-tests.yml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 908e18160b8..3149dbce8e2 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -210,7 +210,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7e31bd04943462f8dbef4d263bac92e54cafbd48 #ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 #ctf-run-tests@0.2.0 with: workflow_name: Run Core E2E Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -251,7 +251,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7e31bd04943462f8dbef4d263bac92e54cafbd48 #ctf-run-tests@1.0.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 #ctf-run-tests@1.0.0 with: workflow_name: Run Core E2E Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -296,7 +296,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'pull_request' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7e31bd04943462f8dbef4d263bac92e54cafbd48 # ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 # ctf-run-tests@0.2.0 with: workflow_name: Run CCIP E2E Tests For PR chainlink_version: ${{ inputs.evm-ref || github.sha }} @@ -337,7 +337,7 @@ jobs: contents: read needs: [build-chainlink, changes] if: github.event_name == 'merge_group' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@7e31bd04943462f8dbef4d263bac92e54cafbd48 # ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 # ctf-run-tests@0.2.0 with: workflow_name: Run CCIP E2E Tests For Merge Queue chainlink_version: ${{ inputs.evm-ref || github.sha }} diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index a07a2795523..8c777d185ce 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -104,7 +104,7 @@ jobs: contents: read needs: changes if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@7e31bd04943462f8dbef4d263bac92e54cafbd48 #ctf-run-tests@0.2.0 + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@0aa585d993202660f7a134d3798abdb08299341c with: workflow_name: Run CCIP Integration Tests For PR test_path: .github/integration-tests.yml @@ -126,7 +126,7 @@ jobs: contents: read needs: changes if: github.event_name == 'merge_group' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@7e31bd04943462f8dbef4d263bac92e54cafbd48 #ctf-run-tests@1.0.0 + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@0aa585d993202660f7a134d3798abdb08299341c with: workflow_name: Run CCIP Integration Tests For Merge Queue test_path: .github/integration-tests.yml From 6119c67cf4d770aa6cd76ca918f1184a8d4bd103 Mon Sep 17 00:00:00 2001 From: Balamurali Gopalswami Date: Tue, 26 Nov 2024 13:45:36 -0500 Subject: [PATCH 07/11] Update ref --- .github/workflows/integration-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 8c777d185ce..bea59f5c3c2 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -104,7 +104,7 @@ jobs: contents: read needs: changes if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@0aa585d993202660f7a134d3798abdb08299341c + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@17919d57a125537d8398161b32b33f4c03b3fde5 with: workflow_name: Run CCIP Integration Tests For PR test_path: .github/integration-tests.yml @@ -126,7 +126,7 @@ jobs: contents: read needs: changes if: github.event_name == 'merge_group' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@0aa585d993202660f7a134d3798abdb08299341c + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@17919d57a125537d8398161b32b33f4c03b3fde5 with: workflow_name: Run CCIP Integration Tests For Merge Queue test_path: .github/integration-tests.yml From e328d01e1b7e51255d82f1b12302cec56c527abb Mon Sep 17 00:00:00 2001 From: Balamurali Gopalswami Date: Tue, 26 Nov 2024 18:22:58 -0500 Subject: [PATCH 08/11] Reverting prior integration-tests.yml rename and additional cleanup --- .github/E2E_TESTS_ON_GITHUB_CI.md | 4 +- ...ts.yml => integration-in-memory-tests.yml} | 4 +- .github/workflows/e2e-tests.yml | 739 ------------------ .../workflows/integration-in-memory-tests.yml | 144 ++++ .github/workflows/integration-tests.yml | 623 ++++++++++++++- 5 files changed, 739 insertions(+), 775 deletions(-) rename .github/{integration-tests.yml => integration-in-memory-tests.yml} (73%) delete mode 100644 .github/workflows/e2e-tests.yml create mode 100644 .github/workflows/integration-in-memory-tests.yml diff --git a/.github/E2E_TESTS_ON_GITHUB_CI.md b/.github/E2E_TESTS_ON_GITHUB_CI.md index 628c7fd6b95..26d3c9daf92 100644 --- a/.github/E2E_TESTS_ON_GITHUB_CI.md +++ b/.github/E2E_TESTS_ON_GITHUB_CI.md @@ -22,7 +22,7 @@ These workflows are designed to run on every commit in a PR, nightly or before r Tests triggered on every commit in a PR to ensure changes do not introduce regressions. -**Workflow:** [e2e-tests.yml](https://github.com/smartcontractkit/chainlink/blob/develop/.github/workflows/e2e-tests.yml) +**Workflow:** [integration-tests.yml](https://github.com/smartcontractkit/chainlink/blob/develop/.github/workflows/integration-tests.yml) ### Nightly E2E Tests @@ -36,7 +36,7 @@ E2E tests triggered on a release tag. #### Integration (smoke) Tests -**Workflow:** [e2e-tests.yml](https://github.com/smartcontractkit/chainlink/blob/develop/.github/workflows/e2e-tests.yml) +**Workflow:** [integration-tests.yml](https://github.com/smartcontractkit/chainlink/blob/develop/.github/workflows/integration-tests.yml) #### Client Compatibility Tests diff --git a/.github/integration-tests.yml b/.github/integration-in-memory-tests.yml similarity index 73% rename from .github/integration-tests.yml rename to .github/integration-in-memory-tests.yml index feb302e1dd9..ec169aae1c5 100644 --- a/.github/integration-tests.yml +++ b/.github/integration-in-memory-tests.yml @@ -1,9 +1,9 @@ -# This file specifies the GitHub runner for each integration test and is utilized by all integration CI workflows. +# This file specifies the GitHub runner for each in-memory integration test and is utilized by .github/workflows/integration-in-memory-tests.yml CI workflow. # # Each entry in this file includes the following: # - The GitHub runner (runs_on field) that will execute tests. # - The tests that will be run by the runner. -# - The triggers (e.g., Run PR Integration Tests) that should trigger these tests. +# - The triggers (e.g., PR Integration CCIP Tests) that should trigger these tests. # runner-test-matrix: # START: CCIPv1.6 tests diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml deleted file mode 100644 index 3149dbce8e2..00000000000 --- a/.github/workflows/e2e-tests.yml +++ /dev/null @@ -1,739 +0,0 @@ -name: E2E Tests -run-name: E2E Tests ${{ inputs.distinct_run_name && inputs.distinct_run_name || '' }} -on: - merge_group: - pull_request: - push: - tags: - - "*" - workflow_dispatch: - inputs: - cl_ref: - description: 'The ref to checkout, defaults to the calling branch' - required: false - type: string - evm-ref: - description: 'The sha of the chainlink-evm commit to use if wanted' - required: false - type: string - run_solana: - description: 'Run solana tests' - required: false - type: string - default: 'false' - distinct_run_name: - description: 'A unique identifier for this run, only use from other repos' - required: false - type: string - -# Only run 1 of this workflow at a time per PR -concurrency: - group: ${{ github.ref }}-${{ github.repository }}-${{ github.event_name }}--e2e-tests-${{ inputs.distinct_run_name }} - cancel-in-progress: true - -env: - # for run-test variables and environment - ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ inputs.evm-ref || github.sha }} - CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink - TEST_SUITE: smoke - TEST_ARGS: -test.timeout 12m - INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com - MOD_CACHE_VERSION: 2 - COLLECTION_ID: chainlink-e2e-tests - -jobs: - enforce-ctf-version: - name: Enforce CTF Version - runs-on: ubuntu-latest - # We don't directly merge dependabot PRs, so let's not waste the resources - if: github.actor != 'dependabot[bot]' - steps: - - run: echo "${{github.event_name}}" - - name: Checkout the repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref }} - - name: Check Merge Group Condition - id: condition-check - run: | - echo "Checking event condition..." - SHOULD_ENFORCE="false" - if [[ "$GITHUB_EVENT_NAME" == "merge_group" ]]; then - echo "We are in a merge_group event, now check if we are on the develop branch" - target_branch=$(cat $GITHUB_EVENT_PATH | jq -r .merge_group.base_ref) - if [[ "$target_branch" == "refs/heads/develop" ]]; then - echo "We are on the develop branch, we should enforce ctf version" - SHOULD_ENFORCE="true" - fi - fi - echo "should we enforce ctf version = $SHOULD_ENFORCE" - echo "should-enforce=$SHOULD_ENFORCE" >> $GITHUB_OUTPUT - - name: Enforce CTF Version - if: steps.condition-check.outputs.should-enforce == 'true' - uses: smartcontractkit/.github/actions/ctf-check-mod-version@21b0189c5fdca0318617d259634b1a91e6d80262 # ctf-check-mod-version@0.0.0 - with: - go-project-path: ./integration-tests - module-name: github.com/smartcontractkit/chainlink-testing-framework/lib - enforce-semantic-tag: "true" - changes: - environment: integration - name: Check Paths That Require Tests To Run - runs-on: ubuntu-latest - # We don't directly merge dependabot PRs, so let's not waste the resources - if: github.actor != 'dependabot[bot]' - steps: - - name: Checkout the repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref }} - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - with: - filters: | - github_ci_changes: - - '.github/workflows/e2e-tests.yml' - - '.github/workflows/run-e2e-tests-reusable-workflow.yml' - - '.github/e2e-tests.yml' - core_changes: - - '**/*.go' - - '**/*go.sum' - - '**/*go.mod' - - '**/*Dockerfile' - - 'core/**/migrations/*.sql' - - 'core/**/config/**/*.toml' - - 'integration-tests/**/*.toml' - ccip_changes: - - '**/*ccip*' - - '**/*ccip*/**' - - name: Ignore Filter On Workflow Dispatch - if: ${{ github.event_name == 'workflow_dispatch' }} - id: ignore-filter - run: echo "changes=true" >> $GITHUB_OUTPUT - outputs: - github_ci_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.github_ci_changes }} - core_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.core_changes }} - ccip_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.ccip_changes }} - - lint-e2e-tests: - name: Lint ${{ matrix.project.name }} - runs-on: ubuntu-24.04-8cores-32GB-ARM - # We don't directly merge dependabot PRs, so let's not waste the resources - if: github.actor != 'dependabot[bot]' - strategy: - matrix: - project: - - name: e2e-tests - id: e2e-tests - path: ./integration-tests - cache_id: e2e-tests - - name: load - id: load - path: ./integration-tests/load - cache_id: load - steps: - - name: Checkout the repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref }} - - name: Setup Go - uses: smartcontractkit/.github/actions/ctf-setup-go@b0d756c57fcdbcff187e74166562a029fdd5d1b9 # ctf-setup-go@0.0.0 - with: - test_download_vendor_packages_command: cd ${{ matrix.project.path }} && go mod download - go_mod_path: ${{ matrix.project.path }}/go.mod - cache_key_id: ${{ matrix.project.cache_id }} - cache_restore_only: "true" - - name: Lint Go - uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0 - with: - version: v1.62.0 - # We already cache these directories in setup-go - skip-pkg-cache: true - skip-build-cache: true - # only-new-issues is only applicable to PRs, otherwise it is always set to false - only-new-issues: false # disabled for PRs due to unreliability - args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml - working-directory: ${{ matrix.project.path }} - - build-chainlink: - environment: integration - permissions: - id-token: write - contents: read - strategy: - matrix: - image: - - name: "" - dockerfile: core/chainlink.Dockerfile - tag-suffix: "" - - name: (plugins) - dockerfile: plugins/chainlink.Dockerfile - tag-suffix: -plugins - name: Build Chainlink Image ${{ matrix.image.name }} - runs-on: ubuntu22.04-8cores-32GB - needs: [changes, enforce-ctf-version] - steps: - - name: Checkout the repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Setup Github Token - if: ${{ inputs.evm-ref }} - id: get-gh-token - uses: smartcontractkit/.github/actions/setup-github-token@ef78fa97bf3c77de6563db1175422703e9e6674f # setup-github-token@0.2.1 - with: - aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }} - aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }} - aws-region: ${{ secrets.AWS_REGION }} - set-git-config: "true" - - name: Build Chainlink Image - if: needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true' || github.event_name == 'workflow_dispatch' - uses: ./.github/actions/build-chainlink-image - with: - tag_suffix: ${{ matrix.image.tag-suffix }} - dockerfile: ${{ matrix.image.dockerfile }} - git_commit_sha: ${{ inputs.evm-ref || github.sha }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - dep_evm_sha: ${{ inputs.evm-ref }} - - run-core-e2e-tests-for-pr: - name: Run Core E2E Tests For PR - permissions: - actions: read - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, changes] - if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 #ctf-run-tests@0.2.0 - with: - workflow_name: Run Core E2E Tests For PR - chainlink_version: ${{ inputs.evm-ref || github.sha }} - chainlink_upgrade_version: ${{ github.sha }} - test_path: .github/e2e-tests.yml - test_trigger: PR E2E Core Tests - upload_cl_node_coverage_artifact: true - upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ - enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} - secrets: - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} - QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} - QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} - GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} - LOKI_URL: ${{ secrets.LOKI_URL }} - LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - - run-core-e2e-tests-for-merge-queue: - name: Run Core E2E Tests For Merge Queue - permissions: - actions: read - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, changes] - if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 #ctf-run-tests@1.0.0 - with: - workflow_name: Run Core E2E Tests For Merge Queue - chainlink_version: ${{ inputs.evm-ref || github.sha }} - chainlink_upgrade_version: ${{ github.sha }} - test_path: .github/e2e-tests.yml - test_trigger: Merge Queue E2E Core Tests - upload_cl_node_coverage_artifact: true - upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ - enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} - # Notify Test Tooling team in slack when merge queue tests fail - slack_notification_after_tests: on_failure - slack_notification_after_tests_channel_id: "#team-test-tooling-internal" - slack_notification_after_tests_name: Core E2E Tests In Merge Queue - secrets: - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} - QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} - QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} - GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} - LOKI_URL: ${{ secrets.LOKI_URL }} - LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - - run-ccip-e2e-tests-for-pr: - name: Run CCIP E2E Tests For PR - permissions: - actions: read - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, changes] - if: github.event_name == 'pull_request' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 # ctf-run-tests@0.2.0 - with: - workflow_name: Run CCIP E2E Tests For PR - chainlink_version: ${{ inputs.evm-ref || github.sha }} - chainlink_upgrade_version: ${{ github.sha }} - test_path: .github/e2e-tests.yml - test_trigger: PR E2E CCIP Tests - upload_cl_node_coverage_artifact: true - upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ - enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} - secrets: - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} - QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} - QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} - GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} - LOKI_URL: ${{ secrets.LOKI_URL }} - LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - - run-ccip-e2e-tests-for-merge-queue: - name: Run CCIP E2E Tests For Merge Queue - permissions: - actions: read - checks: write - pull-requests: write - id-token: write - contents: read - needs: [build-chainlink, changes] - if: github.event_name == 'merge_group' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 # ctf-run-tests@0.2.0 - with: - workflow_name: Run CCIP E2E Tests For Merge Queue - chainlink_version: ${{ inputs.evm-ref || github.sha }} - chainlink_upgrade_version: ${{ github.sha }} - test_path: .github/e2e-tests.yml - test_trigger: Merge Queue E2E CCIP Tests - upload_cl_node_coverage_artifact: true - upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ - enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} - secrets: - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} - QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} - QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} - GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} - LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} - LOKI_URL: ${{ secrets.LOKI_URL }} - LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} - AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} - SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - - check-e2e-test-results: - if: always() - name: ETH Smoke Tests - runs-on: ubuntu-latest - needs: [lint-e2e-tests, run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] - steps: - - name: Check Core test results - id: check_core_results - run: | - results='${{ needs.run-core-e2e-tests-for-pr.outputs.test_results }}' - echo "Core test results:" - echo "$results" | jq . - - node_migration_tests_failed=$(echo $results | jq '[.[] | select(.id == "integration-tests/migration/upgrade_version_test.go:*" ) | select(.result != "success")] | length > 0') - echo "node_migration_tests_failed=$node_migration_tests_failed" >> $GITHUB_OUTPUT - - - name: Check CCIP test results - id: check_ccip_results - run: | - if [[ '${{ needs.run-ccip-e2e-tests-for-pr.result }}' != 'skipped' ]]; then - results='${{ needs.run-ccip-e2e-tests-for-pr.outputs.test_results }}' - echo "CCIP test results:" - echo "$results" | jq . - else - echo "CCIP tests were skipped." - fi - - - name: Send slack notification for failed migration tests - if: steps.check_core_results.outputs.node_migration_tests_failed == 'true' && github.event_name != 'workflow_dispatch' - uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - env: - SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - with: - channel-id: "#team-test-tooling-internal" - slack-message: ":x: :mild-panic-intensifies: Node Migration Tests Failed: \n${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}\n${{ format('Notifying ', secrets.GUARDIAN_SLACK_NOTIFICATION_HANDLE) }}" - - - name: Fail the job if core tests in PR not successful - if: always() && needs.run-core-e2e-tests-for-pr.result == 'failure' - run: exit 1 - - - name: Fail the job if core tests in merge queue not successful - if: always() && needs.run-core-e2e-tests-for-merge-queue.result == 'failure' - run: exit 1 - - - name: Fail the job if lint not successful - if: always() && needs.lint-e2e-tests.result == 'failure' - run: exit 1 - - cleanup: - name: Clean up e2e environment deployments - if: always() - needs: [run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] - runs-on: ubuntu-latest - steps: - - name: Checkout repo - if: ${{ github.event_name == 'pull_request' }} - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref }} - - - name: 🧼 Clean up Environment - if: ${{ github.event_name == 'pull_request' }} - uses: ./.github/actions/delete-deployments - with: - environment: e2e - ref: ${{ github.head_ref }} # See https://github.com/github/docs/issues/15319#issuecomment-1476705663 - - show-chainlink-node-coverage: - name: Show Chainlink Node Go Coverage - if: always() - needs: [run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] - runs-on: ubuntu-latest - steps: - - name: Checkout the repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Download All Artifacts - uses: actions/download-artifact@v4.1.8 - with: - path: cl_node_coverage_data - pattern: cl_node_coverage_data_* - merge-multiple: true - - name: Show Coverage - run: go run ./integration-tests/scripts/show_coverage.go "${{ github.workspace }}/cl_node_coverage_data/*/merged" - - ## Solana Section - get_solana_sha: - # We don't directly merge dependabot PRs, so let's not waste the resources - if: ${{ github.actor != 'dependabot[bot]' && inputs.run_solana != 'false' }} - name: Get Solana Sha From Go Mod - environment: e2e - runs-on: ubuntu-latest - outputs: - sha: ${{ steps.getsha.outputs.sha }} - steps: - - name: Checkout the repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink - ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Setup Go - uses: ./.github/actions/setup-go - with: - only-modules: "true" - - name: Get the sha from go mod - id: getshortsha - run: | - sol_ver=$(go list -m -json github.com/smartcontractkit/chainlink-solana | jq -r .Version) - if [ -z "${sol_ver}" ]; then - echo "Error: could not get the solana version from the go.mod file, look above for error(s)" - exit 1 - fi - short_sha="${sol_ver##*-}" - echo "short sha is: ${short_sha}" - echo "short_sha=${short_sha}" >> "$GITHUB_OUTPUT" - - name: Checkout solana - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink-solana - ref: develop - fetch-depth: 0 - path: solanapath - - name: Get long sha - id: getsha - run: | - cd solanapath - full_sha=$(git rev-parse ${{steps.getshortsha.outputs.short_sha}}^{}) # additional suffix allows handling tagged versions as well - if [ -z "${full_sha}" ]; then - echo "Error: could not get the full sha from the short sha using git, look above for error(s)" - exit 1 - fi - echo "sha is: ${full_sha}" - echo "sha=${full_sha}" >> "$GITHUB_OUTPUT" - - get_projectserum_version: - name: Get ProjectSerum Version - environment: e2e - runs-on: ubuntu-latest - needs: [get_solana_sha] - outputs: - projectserum_version: ${{ steps.psversion.outputs.projectserum_version }} - steps: - - name: Checkout the solana repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink-solana - ref: ${{ needs.get_solana_sha.outputs.sha }} - - name: Get ProjectSerum Version - id: psversion - uses: smartcontractkit/chainlink-solana/.github/actions/projectserum_version@4b971869e26b79c7ce3fb7c98005cc2e3f350915 # stable action on Oct 12 2022 - - solana-test-image-exists: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: Check If Solana Test Image Exists - runs-on: ubuntu-latest - needs: [get_solana_sha] - outputs: - exists: ${{ steps.check-image.outputs.exists }} - steps: - - name: Check if image exists - id: check-image - uses: smartcontractkit/chainlink-github-actions/docker/image-exists@0ce1e67b254a4f041e03cc6f0e3afc987b47c7bd # v2.3.30 - with: - repository: chainlink-solana-tests - tag: ${{ needs.get_solana_sha.outputs.sha }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - - solana-build-contracts: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: Solana Build Artifacts - runs-on: ubuntu22.04-8cores-32GB - needs: - [ - changes, - get_projectserum_version, - solana-test-image-exists, - get_solana_sha, - ] - steps: - - name: Checkout the solana repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink-solana - ref: ${{ needs.get_solana_sha.outputs.sha }} - - name: Build contracts - if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' - uses: smartcontractkit/chainlink-solana/.github/actions/build_contract_artifacts@46b1311a5a83f33d08ffa8e1e0ab04f9ad51665d # node20 update on may 10, 2024 - with: - ref: ${{ needs.get_solana_sha.outputs.sha }} - image: backpackapp/build - image-version: ${{ needs.get_projectserum_version.outputs.projectserum_version }} - - solana-build-test-image: - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: Solana Build Test Image - runs-on: ubuntu22.04-8cores-32GB - needs: - [ - solana-build-contracts, - solana-test-image-exists, - changes, - get_solana_sha, - ] - env: - CONTRACT_ARTIFACTS_PATH: contracts/target/deploy - steps: - - name: Checkout the repo - if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink-solana - ref: ${{ needs.get_solana_sha.outputs.sha }} - - name: Download Artifacts - if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' - uses: actions/download-artifact@v4.1.8 - with: - name: artifacts - path: ${{ env.CONTRACT_ARTIFACTS_PATH }} - - name: Build Test Image - if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' - uses: smartcontractkit/.github/actions/ctf-build-test-image@a5e4f4c8fbb8e15ab2ad131552eca6ac83c4f4b3 # ctf-build-test-image@0.1.0 - with: - repository: chainlink-solana-tests - tag: ${{ needs.get_solana_sha.outputs.sha }} - suites: smoke - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - - run: echo "this exists so we don't have to run anything else if the build is skipped" - if: needs.changes.outputs.core_changes == 'false' || needs.solana-test-image-exists.outputs.exists == 'true' - - solana-smoke-tests: - if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }} - environment: integration - permissions: - checks: write - pull-requests: write - id-token: write - contents: read - name: Solana Smoke Tests - runs-on: ubuntu22.04-8cores-32GB - needs: - [ - build-chainlink, - solana-build-contracts, - solana-build-test-image, - changes, - get_solana_sha, - ] - env: - CHAINLINK_COMMIT_SHA: ${{ inputs.evm-ref || github.sha }} - CHAINLINK_ENV_USER: ${{ github.actor }} - TEST_LOG_LEVEL: debug - CONTRACT_ARTIFACTS_PATH: contracts/target/deploy - steps: - - name: Checkout the repo - uses: actions/checkout@v4.2.1 - with: - repository: smartcontractkit/chainlink-solana - ref: ${{ needs.get_solana_sha.outputs.sha }} - - name: Run Setup - if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' - uses: smartcontractkit/.github/actions/ctf-setup-run-tests-environment@49cb1613e96c9ce17f7290e4dabd38f43aa9bd4d # ctf-setup-run-tests-environment@0.0.0 - with: - go_mod_path: ./integration-tests/go.mod - cache_restore_only: true - cache_key_id: core-solana-e2e-${{ env.MOD_CACHE_VERSION }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} - dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Pull Artifacts - if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' - run: | - IMAGE_NAME=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }} - # Pull the Docker image - docker pull "$IMAGE_NAME" - - # Create a container without starting it - CONTAINER_ID=$(docker create "$IMAGE_NAME") - - # Copy the artifacts from the container - mkdir -p ./${{env.CONTRACT_ARTIFACTS_PATH}}/ - docker cp "$CONTAINER_ID:/go/testdir/${{env.CONTRACT_ARTIFACTS_PATH}}/" "./${{env.CONTRACT_ARTIFACTS_PATH}}/../" - - # Remove the created container - docker rm "$CONTAINER_ID" - - name: Install Solana CLI # required for ensuring the local test validator is configured correctly - run: ./scripts/install-solana-ci.sh - - - name: Install gauntlet - run: | - yarn --cwd ./gauntlet install --frozen-lockfile - yarn --cwd ./gauntlet build - yarn --cwd ./gauntlet gauntlet - - name: Generate config overrides - run: | # https://github.com/smartcontractkit/chainlink-testing-framework/lib/blob/main/config/README.md - cat << EOF > config.toml - [ChainlinkImage] - version="${{ inputs.evm-ref || github.sha }}" - [Common] - user="${{ github.actor }}" - internal_docker_repo = "${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com" - EOF - # shellcheck disable=SC2002 - BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) - # shellcheck disable=SC2086 - echo ::add-mask::$BASE64_CONFIG_OVERRIDE - # shellcheck disable=SC2086 - echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - - name: Run Tests - if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' - uses: smartcontractkit/.github/actions/ctf-run-tests@b8731364b119e88983e94b0c4da87fc27ddb41b8 # ctf-run-tests@0.0.0 - with: - test_command_to_run: export ENV_JOB_IMAGE=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }} && make test_smoke - test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }} - cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ inputs.evm-ref || github.sha }} - publish_check_name: Solana Smoke Test Results - go_mod_path: ./integration-tests/go.mod - cache_key_id: core-solana-e2e-${{ env.MOD_CACHE_VERSION }} - token: ${{ secrets.GITHUB_TOKEN }} - aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - artifacts_name: solana-test-artifacts - artifacts_location: | - ./integration-tests/smoke/logs - ./integration-tests/smoke/db_dumps - ./integration-tests/smoke/seth_artifacts - /tmp/gotest.log - QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} - QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - QA_KUBECONFIG: "" - run_setup: false - go_coverage_src_dir: /var/tmp/go-coverage - go_coverage_dest_dir: ${{ github.workspace }}/.covdata - env: - E2E_TEST_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} - E2E_TEST_SOLANA_SECRET: thisisatestingonlysecret - - - name: Upload Coverage Data - uses: actions/upload-artifact@v4.4.3 - timeout-minutes: 2 - continue-on-error: true - with: - name: cl_node_coverage_data_solana_tests - path: .covdata - retention-days: 1 - diff --git a/.github/workflows/integration-in-memory-tests.yml b/.github/workflows/integration-in-memory-tests.yml new file mode 100644 index 00000000000..d9c7d3af941 --- /dev/null +++ b/.github/workflows/integration-in-memory-tests.yml @@ -0,0 +1,144 @@ +# +# Workflow to run in-memory integration tests +# Test matrix is defined in .github/integration-in-memory-tests.yml +# +name: Integration Tests +run-name: Integration Tests +on: + merge_group: + pull_request: + push: + tags: + - "*" + workflow_dispatch: + inputs: + cl_ref: + description: 'The ref to checkout, defaults to the calling branch' + required: false + type: string + +# Only run 1 of this workflow at a time per PR +concurrency: + group: ${{ github.ref }}-${{ github.repository }}-${{ github.event_name }}--integration-tests + cancel-in-progress: true + +jobs: + changes: + environment: integration + name: Check Paths That Require Tests To Run + runs-on: ubuntu-latest + # We don't directly merge dependabot PRs, so let's not waste the resources + if: github.actor != 'dependabot[bot]' + steps: + - name: Checkout the repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref }} + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + id: changes + with: + filters: | + github_ci_changes: + - '.github/workflows/integration-tests.yml' + - '.github/integration-tests.yml' + core_changes: + - '**/*.go' + - '**/*go.sum' + - '**/*go.mod' + - '**/*Dockerfile' + - 'core/**/migrations/*.sql' + - 'core/**/config/**/*.toml' + - 'integration-tests/**/*.toml' + ccip_changes: + - '**/*ccip*' + - '**/*ccip*/**' + - name: Ignore Filter On Workflow Dispatch + if: ${{ github.event_name == 'workflow_dispatch' }} + id: ignore-filter + run: echo "changes=true" >> $GITHUB_OUTPUT + outputs: + github_ci_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.github_ci_changes }} + core_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.core_changes }} + ccip_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.ccip_changes }} + + run-ccip-integration-tests-for-pr: + name: Run CCIP integration Tests For PR + permissions: + actions: read + checks: write + pull-requests: write + id-token: write + contents: read + needs: changes + if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@17919d57a125537d8398161b32b33f4c03b3fde5 + with: + workflow_name: Run CCIP Integration Tests For PR + test_path: .github/integration-in-memory-tests.yml + test_trigger: PR Integration CCIP Tests + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + + run-ccip-integration-tests-for-merge-queue: + name: Run CCIP Integration Tests For Merge Queue + permissions: + actions: read + checks: write + pull-requests: write + id-token: write + contents: read + needs: changes + if: github.event_name == 'merge_group' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@17919d57a125537d8398161b32b33f4c03b3fde5 + with: + workflow_name: Run CCIP Integration Tests For Merge Queue + test_path: .github/integration-in-memory-tests.yml + test_trigger: Merge Queue integration CCIP Tests + slack_notification_after_tests: on_failure + slack_notification_after_tests_channel_id: "#ccip-testing" + slack_notification_after_tests_name: CCIP integration Tests In Merge Queue + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + + check-integration-test-results: + if: always() + name: Integration Tests + runs-on: ubuntu-latest + needs: [run-ccip-integration-tests-for-pr,run-ccip-integration-tests-for-merge-queue] + steps: + - name: Fail the job if ccip tests in PR not successful + if: always() && needs.run-ccip-integration-tests-for-pr.result == 'failure' + run: exit 1 + + - name: Fail the job if ccip tests in merge queue not successful + if: always() && needs.run-ccip-integration-tests-for-merge-queue.result == 'failure' + run: exit 1 + + cleanup: + name: Clean up integration environment deployments + if: always() + needs: [run-ccip-integration-tests-for-pr, run-ccip-integration-tests-for-merge-queue] + runs-on: ubuntu-latest + steps: + - name: Checkout repo + if: ${{ github.event_name == 'pull_request' }} + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref }} + + - name: 🧼 Clean up Environment + if: ${{ github.event_name == 'pull_request' }} + uses: ./.github/actions/delete-deployments + with: + environment: integration + ref: ${{ github.head_ref }} # See https://github.com/github/docs/issues/15319#issuecomment-1476705663 \ No newline at end of file diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index bea59f5c3c2..ea0016014a7 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -1,5 +1,5 @@ name: Integration Tests -run-name: Integration Tests +run-name: Integration Tests ${{ inputs.distinct_run_name && inputs.distinct_run_name || '' }} on: merge_group: pull_request: @@ -12,13 +12,70 @@ on: description: 'The ref to checkout, defaults to the calling branch' required: false type: string + evm-ref: + description: 'The sha of the chainlink-evm commit to use if wanted' + required: false + type: string + run_solana: + description: 'Run solana tests' + required: false + type: string + default: 'false' + distinct_run_name: + description: 'A unique identifier for this run, only use from other repos' + required: false + type: string # Only run 1 of this workflow at a time per PR concurrency: - group: ${{ github.ref }}-${{ github.repository }}-${{ github.event_name }}--integration-tests + group: ${{ github.ref }}-${{ github.repository }}-${{ github.event_name }}--e2e-tests-${{ inputs.distinct_run_name }} cancel-in-progress: true +env: + # for run-test variables and environment + ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ inputs.evm-ref || github.sha }} + CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink + TEST_SUITE: smoke + TEST_ARGS: -test.timeout 12m + INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com + MOD_CACHE_VERSION: 2 + COLLECTION_ID: chainlink-e2e-tests + jobs: + enforce-ctf-version: + name: Enforce CTF Version + runs-on: ubuntu-latest + # We don't directly merge dependabot PRs, so let's not waste the resources + if: github.actor != 'dependabot[bot]' + steps: + - run: echo "${{github.event_name}}" + - name: Checkout the repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref }} + - name: Check Merge Group Condition + id: condition-check + run: | + echo "Checking event condition..." + SHOULD_ENFORCE="false" + if [[ "$GITHUB_EVENT_NAME" == "merge_group" ]]; then + echo "We are in a merge_group event, now check if we are on the develop branch" + target_branch=$(cat $GITHUB_EVENT_PATH | jq -r .merge_group.base_ref) + if [[ "$target_branch" == "refs/heads/develop" ]]; then + echo "We are on the develop branch, we should enforce ctf version" + SHOULD_ENFORCE="true" + fi + fi + echo "should we enforce ctf version = $SHOULD_ENFORCE" + echo "should-enforce=$SHOULD_ENFORCE" >> $GITHUB_OUTPUT + - name: Enforce CTF Version + if: steps.condition-check.outputs.should-enforce == 'true' + uses: smartcontractkit/.github/actions/ctf-check-mod-version@21b0189c5fdca0318617d259634b1a91e6d80262 # ctf-check-mod-version@0.0.0 + with: + go-project-path: ./integration-tests + module-name: github.com/smartcontractkit/chainlink-testing-framework/lib + enforce-semantic-tag: "true" changes: environment: integration name: Check Paths That Require Tests To Run @@ -37,7 +94,8 @@ jobs: filters: | github_ci_changes: - '.github/workflows/integration-tests.yml' - - '.github/integration-tests.yml' + - '.github/workflows/run-e2e-tests-reusable-workflow.yml' + - '.github/e2e-tests.yml' core_changes: - '**/*.go' - '**/*go.sum' @@ -57,6 +115,7 @@ jobs: github_ci_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.github_ci_changes }} core_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.core_changes }} ccip_changes: ${{ steps.ignore-filter.outputs.changes || steps.changes.outputs.ccip_changes }} + lint-integration-tests: name: Lint ${{ matrix.project.name }} runs-on: ubuntu-24.04-8cores-32GB-ARM @@ -66,9 +125,13 @@ jobs: matrix: project: - name: integration-tests - id: integration-tests + id: e2e-tests path: ./integration-tests - cache_id: integration-tests + cache_id: e2e-tests + - name: load + id: load + path: ./integration-tests/load + cache_id: load steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 @@ -94,65 +157,259 @@ jobs: args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml working-directory: ${{ matrix.project.path }} - run-ccip-integration-tests-for-pr: - name: Run CCIP integration Tests For PR + build-chainlink: + environment: integration + permissions: + id-token: write + contents: read + strategy: + matrix: + image: + - name: "" + dockerfile: core/chainlink.Dockerfile + tag-suffix: "" + - name: (plugins) + dockerfile: plugins/chainlink.Dockerfile + tag-suffix: -plugins + name: Build Chainlink Image ${{ matrix.image.name }} + runs-on: ubuntu22.04-8cores-32GB + needs: [changes, enforce-ctf-version] + steps: + - name: Checkout the repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + - name: Setup Github Token + if: ${{ inputs.evm-ref }} + id: get-gh-token + uses: smartcontractkit/.github/actions/setup-github-token@ef78fa97bf3c77de6563db1175422703e9e6674f # setup-github-token@0.2.1 + with: + aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }} + aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }} + aws-region: ${{ secrets.AWS_REGION }} + set-git-config: "true" + - name: Build Chainlink Image + if: needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true' || github.event_name == 'workflow_dispatch' + uses: ./.github/actions/build-chainlink-image + with: + tag_suffix: ${{ matrix.image.tag-suffix }} + dockerfile: ${{ matrix.image.dockerfile }} + git_commit_sha: ${{ inputs.evm-ref || github.sha }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + dep_evm_sha: ${{ inputs.evm-ref }} + + run-core-e2e-tests-for-pr: + name: Run Core E2E Tests For PR permissions: actions: read checks: write pull-requests: write id-token: write contents: read - needs: changes - if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@17919d57a125537d8398161b32b33f4c03b3fde5 + needs: [build-chainlink, changes] + if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 #ctf-run-tests@0.2.0 with: - workflow_name: Run CCIP Integration Tests For PR - test_path: .github/integration-tests.yml - test_trigger: PR Integration CCIP Tests + workflow_name: Run Core E2E Tests For PR + chainlink_version: ${{ inputs.evm-ref || github.sha }} + chainlink_upgrade_version: ${{ github.sha }} + test_path: .github/e2e-tests.yml + test_trigger: PR E2E Core Tests + upload_cl_node_coverage_artifact: true + upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ + enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: ${{ secrets.LOKI_URL }} + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - run-ccip-integration-tests-for-merge-queue: - name: Run CCIP Integration Tests For Merge Queue + run-core-e2e-tests-for-merge-queue: + name: Run Core E2E Tests For Merge Queue permissions: actions: read checks: write pull-requests: write id-token: write contents: read - needs: changes - if: github.event_name == 'merge_group' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@17919d57a125537d8398161b32b33f4c03b3fde5 + needs: [build-chainlink, changes] + if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 #ctf-run-tests@1.0.0 with: - workflow_name: Run CCIP Integration Tests For Merge Queue - test_path: .github/integration-tests.yml - test_trigger: Merge Queue integration CCIP Tests + workflow_name: Run Core E2E Tests For Merge Queue + chainlink_version: ${{ inputs.evm-ref || github.sha }} + chainlink_upgrade_version: ${{ github.sha }} + test_path: .github/e2e-tests.yml + test_trigger: Merge Queue E2E Core Tests + upload_cl_node_coverage_artifact: true + upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ + enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} + # Notify Test Tooling team in slack when merge queue tests fail slack_notification_after_tests: on_failure - slack_notification_after_tests_channel_id: "#ccip-testing" - slack_notification_after_tests_name: CCIP integration Tests In Merge Queue + slack_notification_after_tests_channel_id: "#team-test-tooling-internal" + slack_notification_after_tests_name: Core E2E Tests In Merge Queue + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: ${{ secrets.LOKI_URL }} + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + + run-ccip-e2e-tests-for-pr: + name: Run CCIP E2E Tests For PR + permissions: + actions: read + checks: write + pull-requests: write + id-token: write + contents: read + needs: [build-chainlink, changes] + if: github.event_name == 'pull_request' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@5412507526722a7b1c5d719fa686eed5a1bc4035 # ctf-run-tests@0.2.0 + with: + workflow_name: Run CCIP E2E Tests For PR + chainlink_version: ${{ inputs.evm-ref || github.sha }} + chainlink_upgrade_version: ${{ github.sha }} + test_path: .github/e2e-tests.yml + test_trigger: PR E2E CCIP Tests + upload_cl_node_coverage_artifact: true + upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ + enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} secrets: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: ${{ secrets.LOKI_URL }} + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} - check-integration-test-results: + run-ccip-e2e-tests-for-merge-queue: + name: Run CCIP E2E Tests For Merge Queue + permissions: + actions: read + checks: write + pull-requests: write + id-token: write + contents: read + needs: [build-chainlink, changes] + if: github.event_name == 'merge_group' && (needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') + uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@5412507526722a7b1c5d719fa686eed5a1bc4035 # ctf-run-tests@0.2.0 + with: + workflow_name: Run CCIP E2E Tests For Merge Queue + chainlink_version: ${{ inputs.evm-ref || github.sha }} + chainlink_upgrade_version: ${{ github.sha }} + test_path: .github/e2e-tests.yml + test_trigger: Merge Queue E2E CCIP Tests + upload_cl_node_coverage_artifact: true + upload_cl_node_coverage_artifact_prefix: cl_node_coverage_data_ + enable_otel_traces_for_ocr2_plugins: ${{ contains(join(github.event.pull_request.labels.*.name, ' '), 'enable tracing') }} + secrets: + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + PROD_AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_ID_PROD }} + QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }} + GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }} + LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }} + LOKI_URL: ${{ secrets.LOKI_URL }} + LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }} + AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }} + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + + check-e2e-test-results: if: always() - name: Integration Tests + name: ETH Smoke Tests runs-on: ubuntu-latest - needs: [lint-integration-tests,run-ccip-integration-tests-for-pr,run-ccip-integration-tests-for-merge-queue] + needs: [lint-integration-tests, run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] steps: - - name: Fail the job if ccip tests in PR not successful - if: always() && needs.run-ccip-integration-tests-for-pr.result == 'failure' + - name: Check Core test results + id: check_core_results + run: | + results='${{ needs.run-core-e2e-tests-for-pr.outputs.test_results }}' + echo "Core test results:" + echo "$results" | jq . + + node_migration_tests_failed=$(echo $results | jq '[.[] | select(.id == "integration-tests/migration/upgrade_version_test.go:*" ) | select(.result != "success")] | length > 0') + echo "node_migration_tests_failed=$node_migration_tests_failed" >> $GITHUB_OUTPUT + + - name: Check CCIP test results + id: check_ccip_results + run: | + if [[ '${{ needs.run-ccip-e2e-tests-for-pr.result }}' != 'skipped' ]]; then + results='${{ needs.run-ccip-e2e-tests-for-pr.outputs.test_results }}' + echo "CCIP test results:" + echo "$results" | jq . + else + echo "CCIP tests were skipped." + fi + + - name: Send slack notification for failed migration tests + if: steps.check_core_results.outputs.node_migration_tests_failed == 'true' && github.event_name != 'workflow_dispatch' + uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 + env: + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + with: + channel-id: "#team-test-tooling-internal" + slack-message: ":x: :mild-panic-intensifies: Node Migration Tests Failed: \n${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}\n${{ format('Notifying ', secrets.GUARDIAN_SLACK_NOTIFICATION_HANDLE) }}" + + - name: Fail the job if core tests in PR not successful + if: always() && needs.run-core-e2e-tests-for-pr.result == 'failure' run: exit 1 - - name: Fail the job if ccip tests in merge queue not successful - if: always() && needs.run-ccip-integration-tests-for-merge-queue.result == 'failure' + - name: Fail the job if core tests in merge queue not successful + if: always() && needs.run-core-e2e-tests-for-merge-queue.result == 'failure' run: exit 1 - name: Fail the job if lint not successful @@ -162,7 +419,7 @@ jobs: cleanup: name: Clean up integration environment deployments if: always() - needs: [run-ccip-integration-tests-for-pr, run-ccip-integration-tests-for-merge-queue] + needs: [run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] runs-on: ubuntu-latest steps: - name: Checkout repo @@ -177,4 +434,306 @@ jobs: uses: ./.github/actions/delete-deployments with: environment: integration - ref: ${{ github.head_ref }} # See https://github.com/github/docs/issues/15319#issuecomment-1476705663 \ No newline at end of file + ref: ${{ github.head_ref }} # See https://github.com/github/docs/issues/15319#issuecomment-1476705663 + + show-chainlink-node-coverage: + name: Show Chainlink Node Go Coverage + if: always() + needs: [run-core-e2e-tests-for-pr, run-ccip-e2e-tests-for-pr, run-core-e2e-tests-for-merge-queue, run-ccip-e2e-tests-for-merge-queue] + runs-on: ubuntu-latest + steps: + - name: Checkout the repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + - name: Download All Artifacts + uses: actions/download-artifact@v4.1.8 + with: + path: cl_node_coverage_data + pattern: cl_node_coverage_data_* + merge-multiple: true + - name: Show Coverage + run: go run ./integration-tests/scripts/show_coverage.go "${{ github.workspace }}/cl_node_coverage_data/*/merged" + + ## Solana Section + get_solana_sha: + # We don't directly merge dependabot PRs, so let's not waste the resources + if: ${{ github.actor != 'dependabot[bot]' && inputs.run_solana != 'false' }} + name: Get Solana Sha From Go Mod + environment: Integration + runs-on: ubuntu-latest + outputs: + sha: ${{ steps.getsha.outputs.sha }} + steps: + - name: Checkout the repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink + ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + - name: Setup Go + uses: ./.github/actions/setup-go + with: + only-modules: "true" + - name: Get the sha from go mod + id: getshortsha + run: | + sol_ver=$(go list -m -json github.com/smartcontractkit/chainlink-solana | jq -r .Version) + if [ -z "${sol_ver}" ]; then + echo "Error: could not get the solana version from the go.mod file, look above for error(s)" + exit 1 + fi + short_sha="${sol_ver##*-}" + echo "short sha is: ${short_sha}" + echo "short_sha=${short_sha}" >> "$GITHUB_OUTPUT" + - name: Checkout solana + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink-solana + ref: develop + fetch-depth: 0 + path: solanapath + - name: Get long sha + id: getsha + run: | + cd solanapath + full_sha=$(git rev-parse ${{steps.getshortsha.outputs.short_sha}}^{}) # additional suffix allows handling tagged versions as well + if [ -z "${full_sha}" ]; then + echo "Error: could not get the full sha from the short sha using git, look above for error(s)" + exit 1 + fi + echo "sha is: ${full_sha}" + echo "sha=${full_sha}" >> "$GITHUB_OUTPUT" + + get_projectserum_version: + name: Get ProjectSerum Version + environment: integration + runs-on: ubuntu-latest + needs: [get_solana_sha] + outputs: + projectserum_version: ${{ steps.psversion.outputs.projectserum_version }} + steps: + - name: Checkout the solana repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink-solana + ref: ${{ needs.get_solana_sha.outputs.sha }} + - name: Get ProjectSerum Version + id: psversion + uses: smartcontractkit/chainlink-solana/.github/actions/projectserum_version@4b971869e26b79c7ce3fb7c98005cc2e3f350915 # stable action on Oct 12 2022 + + solana-test-image-exists: + environment: integration + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + name: Check If Solana Test Image Exists + runs-on: ubuntu-latest + needs: [get_solana_sha] + outputs: + exists: ${{ steps.check-image.outputs.exists }} + steps: + - name: Check if image exists + id: check-image + uses: smartcontractkit/chainlink-github-actions/docker/image-exists@0ce1e67b254a4f041e03cc6f0e3afc987b47c7bd # v2.3.30 + with: + repository: chainlink-solana-tests + tag: ${{ needs.get_solana_sha.outputs.sha }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + + solana-build-contracts: + environment: integration + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + name: Solana Build Artifacts + runs-on: ubuntu22.04-8cores-32GB + needs: + [ + changes, + get_projectserum_version, + solana-test-image-exists, + get_solana_sha, + ] + steps: + - name: Checkout the solana repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink-solana + ref: ${{ needs.get_solana_sha.outputs.sha }} + - name: Build contracts + if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' + uses: smartcontractkit/chainlink-solana/.github/actions/build_contract_artifacts@46b1311a5a83f33d08ffa8e1e0ab04f9ad51665d # node20 update on may 10, 2024 + with: + ref: ${{ needs.get_solana_sha.outputs.sha }} + image: backpackapp/build + image-version: ${{ needs.get_projectserum_version.outputs.projectserum_version }} + + solana-build-test-image: + environment: integration + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + name: Solana Build Test Image + runs-on: ubuntu22.04-8cores-32GB + needs: + [ + solana-build-contracts, + solana-test-image-exists, + changes, + get_solana_sha, + ] + env: + CONTRACT_ARTIFACTS_PATH: contracts/target/deploy + steps: + - name: Checkout the repo + if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink-solana + ref: ${{ needs.get_solana_sha.outputs.sha }} + - name: Download Artifacts + if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' + uses: actions/download-artifact@v4.1.8 + with: + name: artifacts + path: ${{ env.CONTRACT_ARTIFACTS_PATH }} + - name: Build Test Image + if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' + uses: smartcontractkit/.github/actions/ctf-build-test-image@a5e4f4c8fbb8e15ab2ad131552eca6ac83c4f4b3 # ctf-build-test-image@0.1.0 + with: + repository: chainlink-solana-tests + tag: ${{ needs.get_solana_sha.outputs.sha }} + suites: smoke + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + - run: echo "this exists so we don't have to run anything else if the build is skipped" + if: needs.changes.outputs.core_changes == 'false' || needs.solana-test-image-exists.outputs.exists == 'true' + + solana-smoke-tests: + if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }} + environment: integration + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + name: Solana Smoke Tests + runs-on: ubuntu22.04-8cores-32GB + needs: + [ + build-chainlink, + solana-build-contracts, + solana-build-test-image, + changes, + get_solana_sha, + ] + env: + CHAINLINK_COMMIT_SHA: ${{ inputs.evm-ref || github.sha }} + CHAINLINK_ENV_USER: ${{ github.actor }} + TEST_LOG_LEVEL: debug + CONTRACT_ARTIFACTS_PATH: contracts/target/deploy + steps: + - name: Checkout the repo + uses: actions/checkout@v4.2.1 + with: + repository: smartcontractkit/chainlink-solana + ref: ${{ needs.get_solana_sha.outputs.sha }} + - name: Run Setup + if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' + uses: smartcontractkit/.github/actions/ctf-setup-run-tests-environment@49cb1613e96c9ce17f7290e4dabd38f43aa9bd4d # ctf-setup-run-tests-environment@0.0.0 + with: + go_mod_path: ./integration-tests/go.mod + cache_restore_only: true + cache_key_id: core-solana-e2e-${{ env.MOD_CACHE_VERSION }} + aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }} + dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} + - name: Pull Artifacts + if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' + run: | + IMAGE_NAME=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }} + # Pull the Docker image + docker pull "$IMAGE_NAME" + + # Create a container without starting it + CONTAINER_ID=$(docker create "$IMAGE_NAME") + + # Copy the artifacts from the container + mkdir -p ./${{env.CONTRACT_ARTIFACTS_PATH}}/ + docker cp "$CONTAINER_ID:/go/testdir/${{env.CONTRACT_ARTIFACTS_PATH}}/" "./${{env.CONTRACT_ARTIFACTS_PATH}}/../" + + # Remove the created container + docker rm "$CONTAINER_ID" + - name: Install Solana CLI # required for ensuring the local test validator is configured correctly + run: ./scripts/install-solana-ci.sh + + - name: Install gauntlet + run: | + yarn --cwd ./gauntlet install --frozen-lockfile + yarn --cwd ./gauntlet build + yarn --cwd ./gauntlet gauntlet + - name: Generate config overrides + run: | # https://github.com/smartcontractkit/chainlink-testing-framework/lib/blob/main/config/README.md + cat << EOF > config.toml + [ChainlinkImage] + version="${{ inputs.evm-ref || github.sha }}" + [Common] + user="${{ github.actor }}" + internal_docker_repo = "${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com" + EOF + # shellcheck disable=SC2002 + BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) + # shellcheck disable=SC2086 + echo ::add-mask::$BASE64_CONFIG_OVERRIDE + # shellcheck disable=SC2086 + echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV + - name: Run Tests + if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch' + uses: smartcontractkit/.github/actions/ctf-run-tests@b8731364b119e88983e94b0c4da87fc27ddb41b8 # ctf-run-tests@0.0.0 + with: + test_command_to_run: export ENV_JOB_IMAGE=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }} && make test_smoke + test_config_override_base64: ${{ env.BASE64_CONFIG_OVERRIDE }} + cl_repo: ${{ env.CHAINLINK_IMAGE }} + cl_image_tag: ${{ inputs.evm-ref || github.sha }} + publish_check_name: Solana Smoke Test Results + go_mod_path: ./integration-tests/go.mod + cache_key_id: core-solana-e2e-${{ env.MOD_CACHE_VERSION }} + token: ${{ secrets.GITHUB_TOKEN }} + aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + artifacts_name: solana-test-artifacts + artifacts_location: | + ./integration-tests/smoke/logs + ./integration-tests/smoke/db_dumps + ./integration-tests/smoke/seth_artifacts + /tmp/gotest.log + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_KUBECONFIG: "" + run_setup: false + go_coverage_src_dir: /var/tmp/go-coverage + go_coverage_dest_dir: ${{ github.workspace }}/.covdata + env: + E2E_TEST_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }} + E2E_TEST_SOLANA_SECRET: thisisatestingonlysecret + + - name: Upload Coverage Data + uses: actions/upload-artifact@v4.4.3 + timeout-minutes: 2 + continue-on-error: true + with: + name: cl_node_coverage_data_solana_tests + path: .covdata + retention-days: 1 + From 2fdc549a111169713a386bd1cbbd59a4eded93e1 Mon Sep 17 00:00:00 2001 From: Balamurali Gopalswami Date: Tue, 26 Nov 2024 18:25:59 -0500 Subject: [PATCH 09/11] Update reference --- .github/workflows/integration-in-memory-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-in-memory-tests.yml b/.github/workflows/integration-in-memory-tests.yml index d9c7d3af941..5094cb85bb4 100644 --- a/.github/workflows/integration-in-memory-tests.yml +++ b/.github/workflows/integration-in-memory-tests.yml @@ -72,7 +72,7 @@ jobs: contents: read needs: changes if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@17919d57a125537d8398161b32b33f4c03b3fde5 + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@57112554b9e5cfae79e795a8b1c36acf7e9dead7 with: workflow_name: Run CCIP Integration Tests For PR test_path: .github/integration-in-memory-tests.yml @@ -94,7 +94,7 @@ jobs: contents: read needs: changes if: github.event_name == 'merge_group' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') - uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@17919d57a125537d8398161b32b33f4c03b3fde5 + uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@57112554b9e5cfae79e795a8b1c36acf7e9dead7 with: workflow_name: Run CCIP Integration Tests For Merge Queue test_path: .github/integration-in-memory-tests.yml From eac99895f173feb5ba3fa2671390c7e3692dc744 Mon Sep 17 00:00:00 2001 From: Balamurali Gopalswami Date: Wed, 27 Nov 2024 09:30:54 -0500 Subject: [PATCH 10/11] Review comments --- .github/integration-in-memory-tests.yml | 3 --- .github/workflows/integration-in-memory-tests.yml | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/integration-in-memory-tests.yml b/.github/integration-in-memory-tests.yml index ec169aae1c5..f97f3332eb7 100644 --- a/.github/integration-in-memory-tests.yml +++ b/.github/integration-in-memory-tests.yml @@ -15,7 +15,4 @@ runner-test-matrix: triggers: - PR Integration CCIP Tests test_cmd: cd integration-tests/smoke/ccip && go test ccip_messaging_test.go -timeout 12m -test.parallel=2 -count=1 -json - test_env_vars: - E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2 - E2E_JD_VERSION: 0.6.0 # END: CCIP tests diff --git a/.github/workflows/integration-in-memory-tests.yml b/.github/workflows/integration-in-memory-tests.yml index 5094cb85bb4..b5cac20ade5 100644 --- a/.github/workflows/integration-in-memory-tests.yml +++ b/.github/workflows/integration-in-memory-tests.yml @@ -41,7 +41,8 @@ jobs: filters: | github_ci_changes: - '.github/workflows/integration-tests.yml' - - '.github/integration-tests.yml' + - '.github/workflows/integration-in-memory-tests.yml' + - '.github/integration-in-memory-tests.yml' core_changes: - '**/*.go' - '**/*go.sum' @@ -98,7 +99,7 @@ jobs: with: workflow_name: Run CCIP Integration Tests For Merge Queue test_path: .github/integration-in-memory-tests.yml - test_trigger: Merge Queue integration CCIP Tests + test_trigger: Merge Queue Integration CCIP Tests slack_notification_after_tests: on_failure slack_notification_after_tests_channel_id: "#ccip-testing" slack_notification_after_tests_name: CCIP integration Tests In Merge Queue From 0b47add4db15194b01207536d46160bdfcc42d52 Mon Sep 17 00:00:00 2001 From: Balamurali Gopalswami Date: Wed, 27 Nov 2024 11:29:53 -0500 Subject: [PATCH 11/11] Rename per review comment --- .github/workflows/integration-in-memory-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-in-memory-tests.yml b/.github/workflows/integration-in-memory-tests.yml index b5cac20ade5..8d777b41ea1 100644 --- a/.github/workflows/integration-in-memory-tests.yml +++ b/.github/workflows/integration-in-memory-tests.yml @@ -2,8 +2,8 @@ # Workflow to run in-memory integration tests # Test matrix is defined in .github/integration-in-memory-tests.yml # -name: Integration Tests -run-name: Integration Tests +name: Integration In-Memory Tests +run-name: Integration In-Memory Tests on: merge_group: pull_request: