Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
b-gopalswami committed Nov 26, 2024
1 parent 80dffc4 commit 3b5cdb5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 153 deletions.
2 changes: 0 additions & 2 deletions .github/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 #[email protected]
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 #[email protected]
with:
workflow_name: Run Core E2E Tests For PR
chainlink_version: ${{ inputs.evm-ref || github.sha }}
Expand Down Expand Up @@ -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 #[email protected]
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 #[email protected]
with:
workflow_name: Run Core E2E Tests For Merge Queue
chainlink_version: ${{ inputs.evm-ref || github.sha }}
Expand Down Expand Up @@ -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 # [email protected]
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 # [email protected]
with:
workflow_name: Run CCIP E2E Tests For PR
chainlink_version: ${{ inputs.evm-ref || github.sha }}
Expand Down Expand Up @@ -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 # [email protected]
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@c41d97a7fab91ed6264f222d529cfb76c7f1b140 # [email protected]
with:
workflow_name: Run CCIP E2E Tests For Merge Queue
chainlink_version: ${{ inputs.evm-ref || github.sha }}
Expand Down
161 changes: 14 additions & 147 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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/[email protected]
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 # [email protected]
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
Expand Down Expand Up @@ -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/[email protected]
Expand All @@ -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/[email protected]
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 # [email protected]
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:
Expand All @@ -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 #[email protected]
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 #[email protected]
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:
Expand All @@ -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 #[email protected]
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 #[email protected]
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:
Expand All @@ -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
Expand All @@ -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/[email protected]
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/[email protected]
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

0 comments on commit 3b5cdb5

Please sign in to comment.