Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding CTF v2 approach to run the anvil chains #15751

Draft
wants to merge 24 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 133 additions & 10 deletions .github/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ runner-test-matrix:
runs_on: ubuntu-latest
triggers:
- PR E2E Core Tests
- Nightly E2E Tests
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test ccip_token_price_updates_test.go -timeout 18m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
Expand All @@ -957,7 +957,7 @@ runner-test-matrix:
runs_on: ubuntu-latest
triggers:
- PR E2E Core Tests
- Nightly E2E Tests
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test ccip_gas_price_updates_test.go -timeout 18m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
Expand All @@ -971,7 +971,7 @@ runner-test-matrix:
runs_on: ubuntu20.04-8cores-32GB
triggers:
- PR E2E Core Tests
- Nightly E2E Tests
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test -test.run ^TestRMN_TwoMessagesOnTwoLanesIncludingBatching$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
Expand All @@ -987,7 +987,7 @@ runner-test-matrix:
runs_on: ubuntu20.04-8cores-32GB
triggers:
- PR E2E Core Tests
- Nightly E2E Tests
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test -test.run ^TestRMN_MultipleMessagesOnOneLaneNoWaitForExec$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
Expand All @@ -1003,7 +1003,7 @@ runner-test-matrix:
runs_on: ubuntu20.04-8cores-32GB
triggers:
- PR E2E Core Tests
- Nightly E2E Tests
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test -test.run ^TestRMN_NotEnoughObservers$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
Expand All @@ -1019,7 +1019,7 @@ runner-test-matrix:
runs_on: ubuntu20.04-8cores-32GB
triggers:
- PR E2E Core Tests
- Nightly E2E Tests
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test -test.run ^TestRMN_DifferentSigners$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
Expand All @@ -1035,7 +1035,7 @@ runner-test-matrix:
runs_on: ubuntu20.04-8cores-32GB
triggers:
- PR E2E Core Tests
- Nightly E2E Tests
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test -test.run ^TestRMN_NotEnoughSigners$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
Expand All @@ -1051,7 +1051,7 @@ runner-test-matrix:
runs_on: ubuntu20.04-8cores-32GB
triggers:
- PR E2E Core Tests
- Nightly E2E Tests
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test -test.run ^TestRMN_DifferentRmnNodesForDifferentChains$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
Expand All @@ -1067,7 +1067,7 @@ runner-test-matrix:
runs_on: ubuntu20.04-8cores-32GB
triggers:
- PR E2E Core Tests
- Nightly E2E Tests
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test -test.run ^TestRMN_TwoMessagesOneSourceChainCursed$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
Expand All @@ -1083,7 +1083,7 @@ runner-test-matrix:
runs_on: ubuntu20.04-8cores-32GB
triggers:
- PR E2E Core Tests
- Nightly E2E Tests
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test -test.run ^TestRMN_GlobalCurseTwoMessagesOnTwoLanes$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
Expand All @@ -1095,6 +1095,129 @@ runner-test-matrix:

# END: CCIPv1.6 tests

# START: CCIPv1.6 tests Nightly tests
- id: smoke/ccip/ccip_migration_to_v_1_6_test.go:*
path: integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test ccip_migration_to_v_1_6_test.go -timeout 12m -test.parallel=1 -count=1 -json
test_env_vars:
E2E_JD_VERSION: 0.6.0
CCIP_V16_TEST_ENV: anvil-docker
CTF_CONFIGS: ../../testconfig/ccip/ccip-default-ctfv2.toml

- id: smoke/ccip/ccip_fees_test.go:*
path: integration-tests/smoke/ccip/ccip_fees_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test ccip_fees_test.go -timeout 12m -test.parallel=2 -count=1 -json
test_env_vars:
E2E_JD_VERSION: 0.6.0
CCIP_V16_TEST_ENV: anvil-docker
CTF_CONFIGS: ../../testconfig/ccip/ccip-default-ctfv2.toml

- 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:
- Nightly E2E 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_JD_VERSION: 0.6.0
CCIP_V16_TEST_ENV: anvil-docker
CTF_CONFIGS: ../../testconfig/ccip/ccip-default-ctfv2.toml

- id: smoke/ccip/ccip_message_limitations_test.go:*
path: integration-tests/smoke/ccip/ccip_message_limitations_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test -run "Test_CCIPMessageLimitations" -timeout 12m -test.parallel=2 -count=1 -json
test_env_vars:
E2E_JD_VERSION: 0.6.0
CCIP_V16_TEST_ENV: anvil-docker
CTF_CONFIGS: ../../testconfig/ccip/ccip-default-ctfv2.toml

- id: smoke/ccip/ccip_fee_boosting_test.go:*
path: integration-tests/smoke/ccip/ccip_fee_boosting_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test ccip_fee_boosting_test.go -timeout 12m -test.parallel=2 -count=1 -json
test_env_vars:
E2E_JD_VERSION: 0.6.0
CCIP_V16_TEST_ENV: anvil-docker
CTF_CONFIGS: ../../testconfig/ccip/ccip-default-ctfv2.toml

- id: smoke/ccip/ccip_batching_test.go:*
path: integration-tests/smoke/ccip/ccip_batching_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test ccip_batching_test.go -timeout 12m -test.parallel=2 -count=1 -json
test_env_vars:
E2E_JD_VERSION: 0.6.0
CCIP_V16_TEST_ENV: anvil-docker
CTF_CONFIGS: ../../testconfig/ccip/ccip-default-ctfv2.toml

- id: contracts/ccipreader_test.go:*
path: integration-tests/contracts/ccipreader_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/contracts && go test ccipreader_test.go -timeout 5m -test.parallel=1 -count=1 -json
test_env_vars:
E2E_JD_VERSION: 0.6.0
CCIP_V16_TEST_ENV: anvil-docker
CTF_CONFIGS: ../../testconfig/ccip/ccip-default-ctfv2.toml

- id: smoke/ccip/ccip_usdc_test.go:*
path: integration-tests/smoke/ccip/ccip_usdc_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test ccip_usdc_test.go -timeout 18m -test.parallel=1 -count=1 -json
test_env_vars:
E2E_JD_VERSION: 0.6.0
CCIP_V16_TEST_ENV: anvil-docker
CTF_CONFIGS: ../../testconfig/ccip/ccip-default-ctfv2.toml

- id: smoke/ccip/ccip_ooo_execution_test.go:*
path: integration-tests/smoke/ccip/ccip_ooo_execution_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/ && go test smoke/ccip/ccip_ooo_execution_test.go -timeout 16m -test.parallel=1 -count=1 -json
test_env_vars:
E2E_JD_VERSION: 0.6.0
CCIP_V16_TEST_ENV: anvil-docker
CTF_CONFIGS: ../../testconfig/ccip/ccip-default-ctfv2.toml

- id: smoke/ccip/ccip_token_transfer_test.go:*
path: integration-tests/smoke/ccip/ccip_token_transfer_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- Nightly E2E CCIP Tests
test_cmd: cd integration-tests/ && go test smoke/ccip/ccip_token_transfer_test.go -timeout 16m -test.parallel=1 -count=1 -json
test_env_vars:
E2E_JD_VERSION: 0.6.0
CCIP_V16_TEST_ENV: anvil-docker
CTF_CONFIGS: ../../testconfig/ccip/ccip-default-ctfv2.toml

# END: CCIP tests

# START: CCIP tests

- id: ccip-smoke
Expand Down
118 changes: 118 additions & 0 deletions .github/workflows/ccip-nightly-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Run Nightly E2E Tests

on:
push:
branches:
- '**'
schedule:
# Run every night at midnight UTC (0:00 AM)
- cron: '0 0 * * *'
workflow_dispatch:
# Useful when running the workflow manually
inputs:
chainlink_version:
description: 'Enter Chainlink version to use for the tests. Example: "v2.10.0" or sha'
required: true
type: string
default: develop
slack_notification_after_tests:
description: 'Notify on Slack after tests'
required: false
type: string

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-nightly-tests

jobs:
nightly-test:
environment: integration
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
test:
- name: ccip_token_transfer_test
id: smoke/ccip/ccip_token_transfer_test.go:*
test_cmd: cd integration-tests/smoke/ccip && go test ccip_token_transfer_test.go -timeout 16m -test.parallel=1 -count=1 -json
config: ../../testconfig/ccip/ccip-default-ctfv2.toml
name: ${{ matrix.test.name }}
steps:
- name: Checkout the repo
uses: actions/[email protected]
with:
persist-credentials: false
repository: smartcontractkit/chainlink
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: ${{ secrets.PUBLIC_AWS_ECR_ROLE }}
aws-region: us-east-1
- name: Authenticate to ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
with:
registry-type: public
- name: Setup Github Token
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
uses: ./.github/actions/build-chainlink-image
with:
tag_suffix: ""
dockerfile: core/chainlink.Dockerfile
git_commit_sha: ${{ github.sha }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
- name: Set up Go
uses: actions/setup-go@v4

Check warning on line 86 in .github/workflows/ccip-nightly-tests.yml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. Action is using node16 (node-version / warning)
with:
go-version: 1.22.8
- name: Cache Go modules
uses: actions/cache@v3

Check warning on line 90 in .github/workflows/ccip-nightly-tests.yml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. Action is using node16 (node-version / warning)
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: go-modules-${{ hashFiles('integration-tests/go.sum') }}-${{ runner.os }}-ccip-nightly-tests
restore-keys: |
go-modules-${{ runner.os }}-ccip-nightly-tests
go-modules-${{ runner.os }}
- name: Install dependencies
run: go mod download
- name: Run integration tests
env:
CTF_CONFIGS: ${{ matrix.test.config }}
CTF_JD_IMAGE: ${{ secrets.CTF_JD_IMAGE }}
CTF_CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION}}.amazonaws.com/chainlink:${{ github.sha }}
LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }}
LOKI_URL: ${{ secrets.LOKI_URL }}
LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }}
CCIP_V16_TEST_ENV: anvil-docker
run: ${{ matrix.test.test_cmd}}
# go test -timeout ${{ matrix.test.timeout }} -v -count ${{ matrix.test.count }} -run ${{ matrix.test.name }} -parallel ${{ matrix.test.parallel }}
- name: Upload Logs
if: always()
uses: actions/upload-artifact@v3

Check warning on line 114 in .github/workflows/ccip-nightly-tests.yml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. Action is using node16 (node-version / warning)
with:
name: container-logs-${{ matrix.test.name }}
path: framework/examples/myproject/logs
retention-days: 1
5 changes: 4 additions & 1 deletion deployment/ccip/changeset/testhelpers/test_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type EnvType string
const (
Memory EnvType = "in-memory"
Docker EnvType = "docker"
AnvilDocker EnvType = "anvil-docker"
ENVTESTTYPE = "CCIP_V16_TEST_ENV"
)

Expand Down Expand Up @@ -83,8 +84,10 @@ func (tc *TestConfigs) MustSetEnvTypeOrDefault(t *testing.T) {
tc.Type = Memory
} else if envType == string(Docker) {
tc.Type = Docker
} else if envType == string(AnvilDocker) {
tc.Type = AnvilDocker
} else {
t.Fatalf("env var CCIP_V16_TEST_ENV must be either %s or %s, defaults to %s if unset, got: %s", Memory, Docker, Memory, envType)
t.Fatalf("env var CCIP_V16_TEST_ENV must be either %s, %s or %s, defaults to %s if unset, got: %s", Memory, Docker, AnvilDocker, Memory, envType)
}
}

Expand Down
1 change: 1 addition & 0 deletions deployment/environment/devenv/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func NewChains(logger logger.Logger, configs []ChainConfig) (map[uint64]deployme
}
return blockNumber, nil
},
Users: chainCfg.Users,
}
}
return chains, nil
Expand Down
1 change: 1 addition & 0 deletions go.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ flowchart LR
chainlink/deployment --> chainlink-testing-framework/lib
chainlink/deployment --> chainlink/v2
click chainlink/deployment href "https://github.com/smartcontractkit/chainlink"
chainlink/integration-tests --> chainlink-testing-framework/framework
chainlink/integration-tests --> chainlink-testing-framework/havoc
chainlink/integration-tests --> chainlink/deployment
click chainlink/integration-tests href "https://github.com/smartcontractkit/chainlink"
Expand Down
Loading
Loading