Skip to content

Commit

Permalink
Add integration-tests/migration/upgrade_version_test.go:*
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcl committed Jul 16, 2024
1 parent 0178385 commit 4b1f049
Show file tree
Hide file tree
Showing 3 changed files with 205 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ runs:
uses: actions/checkout@v3
with:
repository: 'smartcontractkit/chainlink-testing-framework'
ref: 35aa2ea0837aee32466f735a8d2220fb413413c6
ref: e7d83b97f9c1aa6c94c133f0b21d578fd0075560
path: 'chainlink-testing-framework'

- name: Create default E2E test config override
Expand Down
188 changes: 162 additions & 26 deletions .github/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ runner-test-matrix:

# START: OCR tests

# Example of 1 runner for all tests in integration-tests/smoke/ocr_test.go
- id: integration-tests/smoke/ocr_test.go:*
path: integration-tests/smoke/ocr_test.go
test_env_type: docker
runs-on: ubuntu-latest
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/ && go test smoke/ocr_test.go -timeout 30m -count=1 -json
pyroscope-env: ci-smoke-ocr-evm-simulated-nightly

# Example of 2 separate runners for the same test file but different tests. Can be used if tests if are too heavy to run on the same runner
- id: integration-tests/smoke/ocr2_test.go:^TestOCRv2Request$
path: integration-tests/smoke/ocr2_test.go
Expand Down Expand Up @@ -165,11 +154,11 @@ runner-test-matrix:
workflows:
- Run Automation Product Nightly E2E Tests
test-cmd: cd integration-tests/smoke && go test -test.run ^TestAutomationNodeUpgrade/registry_2_0 -test.parallel=1 -timeout 60m -count=1 -json
default-test_inputs:
chainlinkImage: public.ecr.aws/chainlink/chainlink
chainlinkVersion: latest
chainlinkUpgradeImage: '{{ env.QA_CHAINLINK_IMAGE }}'
chainlinkUpgradeVersion: develop
test_inputs:
chainlink_image: public.ecr.aws/chainlink/chainlink
chainlink_version: latest
chainlink_upgrade_image: '{{ env.QA_CHAINLINK_IMAGE }}'
chainlink_upgrade_version: develop
pyroscope-env: ci-smoke-automation-upgrade-tests

- id: integration-tests/smoke/automation_upgrade_test.go:^TestAutomationNodeUpgrade/registry_2_1
Expand All @@ -179,11 +168,11 @@ runner-test-matrix:
workflows:
- Run Automation Product Nightly E2E Tests
test-cmd: cd integration-tests/smoke && go test -test.run ^TestAutomationNodeUpgrade/registry_2_1 -test.parallel=5 -timeout 60m -count=1 -json
default-test_inputs:
chainlinkImage: public.ecr.aws/chainlink/chainlink
chainlinkVersion: latest
chainlinkUpgradeImage: '{{ env.QA_CHAINLINK_IMAGE }}'
chainlinkUpgradeVersion: develop
test_inputs:
chainlink_image: public.ecr.aws/chainlink/chainlink
chainlink_version: latest
chainlink_upgrade_image: '{{ env.QA_CHAINLINK_IMAGE }}'
chainlink_upgrade_version: develop
pyroscope-env: ci-smoke-automation-upgrade-tests

- id: integration-tests/smoke/automation_upgrade_test.go:^TestAutomationNodeUpgrade/registry_2_2
Expand All @@ -193,11 +182,11 @@ runner-test-matrix:
workflows:
- Run Automation Product Nightly E2E Tests
test-cmd: cd integration-tests/smoke && go test -test.run ^TestAutomationNodeUpgrade/registry_2_2 -test.parallel=5 -timeout 60m -count=1 -json
default-test_inputs:
chainlinkImage: public.ecr.aws/chainlink/chainlink
chainlinkVersion: latest
chainlinkUpgradeImage: '{{ env.QA_CHAINLINK_IMAGE }}'
chainlinkUpgradeVersion: develop
test_inputs:
chainlink_image: public.ecr.aws/chainlink/chainlink
chainlink_version: latest
chainlink_upgrade_image: '{{ env.QA_CHAINLINK_IMAGE }}'
chainlink_upgrade_version: develop
pyroscope-env: ci-smoke-automation-upgrade-tests

- id: integration-tests/reorg/automation_reorg_test.go
Expand Down Expand Up @@ -307,3 +296,150 @@ runner-test-matrix:
- On Demand VRFV2Plus Smoke Test (Ethereum clients)

# END: VRF tests

- id: integration-tests/smoke/runlog_test.go:*
path: integration-tests/smoke/runlog_test.go
test_env_type: docker
runs-on: ubuntu-latest
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/ && go test smoke/runlog_test.go -timeout 30m -count=1 -json
pyroscope-env: ci-smoke-runlog-evm-simulated

- id: integration-tests/smoke/cron_test.go:*
path: integration-tests/smoke/cron_test.go
test_env_type: docker
runs-on: ubuntu-latest
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/ && go test smoke/cron_test.go -timeout 30m -count=1 -json
pyroscope-env: ci-smoke-cron-evm-simulated

- id: integration-tests/smoke/flux_test.go:*
path: integration-tests/smoke/flux_test.go
test_env_type: docker
runs-on: ubuntu-latest
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/ && go test smoke/flux_test.go -timeout 30m -count=1 -json
pyroscope-env: ci-smoke-flux-evm-simulated

# Example of 1 runner for all tests in integration-tests/smoke/ocr_test.go
- id: integration-tests/smoke/ocr_test.go:*
path: integration-tests/smoke/ocr_test.go
test_env_type: docker
runs-on: ubuntu-latest
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/ && go test smoke/ocr_test.go -timeout 30m -count=1 -test.parallel=2 -json
pyroscope-env: ci-smoke-ocr-evm-simulated

- id: integration-tests/smoke/reorg_above_finality.go:*
path: integration-tests/smoke/reorg_above_finality.go
test_env_type: docker
runs-on: ubuntu-latest
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/ && go test smoke/reorg_above_finality.go -timeout 30m -count=1 -json
pyroscope-env: ci-smoke-reorg-above-finality-evm-simulated

- id: integration-tests/smoke/ocr2_test.go:*
path: integration-tests/smoke/ocr2_test.go
test_env_type: docker
runs-on: ubuntu22.04-16cores-64GB
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/ && go test smoke/ocr2_test.go -timeout 30m -count=1 -test.parallel=6 -json
pyroscope-env: ci-smoke-ocr2-evm-simulated

- id: integration-tests/smoke/ocr2_test.go:*-plugins
path: integration-tests/smoke/ocr2_test.go
test_env_type: docker
runs-on: ubuntu22.04-16cores-64GB
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/ && go test smoke/ocr2_test.go -timeout 30m -count=1 -test.parallel=6 -json
pyroscope-env: ci-smoke-ocr2-plugins-evm-simulated
test_inputs:
chainlink_version: '{{ env.GITHUB_SHA_PLUGINS }}' # This is the chainlink version that has the plugins

- id: integration-tests/smoke/vrf_test.go:*
path: integration-tests/smoke/vrf_test.go
test_env_type: docker
runs-on: ubuntu-latest
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/ && go test smoke/vrf_test.go -timeout 30m -count=1 -test.parallel=2 -json
pyroscope-env: ci-smoke-vrf-evm-simulated

- id: integration-tests/smoke/vrfv2_test.go:*
path: integration-tests/smoke/vrfv2_test.go
test_env_type: docker
runs-on: ubuntu-latest
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/ && go test smoke/vrfv2_test.go -timeout 30m -count=1 -test.parallel=6 -json
pyroscope-env: ci-smoke-vrf2-evm-simulated

- id: integration-tests/smoke/vrfv2plus_test.go:*
path: integration-tests/smoke/vrfv2plus_test.go
test_env_type: docker
runs-on: ubuntu-latest
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/ && go test smoke/vrfv2plus_test.go -timeout 30m -count=1 -test.parallel=9 -json
pyroscope-env: ci-smoke-vrf2plus-evm-simulated

- id: integration-tests/smoke/forwarder_ocr_test.go:*
path: integration-tests/smoke/forwarder_ocr_test.go
test_env_type: docker
runs-on: ubuntu-latest
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/ && go test smoke/forwarder_ocr_test.go -timeout 30m -count=1 -test.parallel=2 -json
pyroscope-env: ci-smoke-forwarder-ocr-evm-simulated

- id: integration-tests/smoke/forwarders_ocr2.go:*
path: integration-tests/smoke/forwarders_ocr2.go
test_env_type: docker
runs-on: ubuntu-latest
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/ && go test smoke/forwarders_ocr2.go -timeout 30m -count=1 -test.parallel=2 -json
pyroscope-env: ci-smoke-forwarder-ocr-evm-simulated

- id: integration-tests/smoke/forwarders_ocr2.go:*
path: integration-tests/smoke/forwarders_ocr2.go
test_env_type: docker
runs-on: ubuntu-latest
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/ && go test smoke/forwarders_ocr2.go -timeout 30m -count=1 -test.parallel=2 -json
pyroscope-env: ci-smoke-forwarder-ocr-evm-simulated

- id: integration-tests/migration/upgrade_version_test.go:*
path: integration-tests/migration/upgrade_version_test.go
test_env_type: docker
runs-on: ubuntu-latest
workflows:
- Run PR E2E Tests
- Run Nightly E2E Tests
test-cmd: cd integration-tests/migration && go test upgrade_version_test.go -timeout 30m -count=1 -test.parallel=2 -json
test_inputs:
chainlink_image: public.ecr.aws/chainlink/chainlink
chainlink_version: '{{ env.LATEST_CHAINLINK_RELEASE_VERSION }}'
chainlink_upgrade_image: '{{ env.QA_CHAINLINK_IMAGE }}'
chainlink_upgrade_version: develop
66 changes: 42 additions & 24 deletions .github/workflows/run-e2e-tests-reusable-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ on:
env:
CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
QA_CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
GITHUB_SHA_PLUGINS: ${{ github.sha }}-plugins
CHAINLINK_ENV_USER: ${{ github.actor }}
CHAINLINK_COMMIT_SHA: ${{ inputs.evm-ref || github.sha }}
SELECTED_NETWORKS: SIMULATED
MOD_CACHE_VERSION: 1
TEST_LOG_LEVEL: debug

jobs:
validate-inputs:
Expand Down Expand Up @@ -125,7 +130,7 @@ jobs:
uses: actions/checkout@v3
with:
repository: 'smartcontractkit/chainlink-testing-framework'
ref: 35aa2ea0837aee32466f735a8d2220fb413413c6
ref: e7d83b97f9c1aa6c94c133f0b21d578fd0075560
path: 'chainlink-testing-framework'
- name: Setup Go
uses: ./.github/actions/setup-go
Expand All @@ -135,10 +140,30 @@ jobs:
echo "::error::Some E2E test configurations have to be added to .github/e2e-tests.yml. This file defines Github CI configuration for each E2E test or set of E2E tests." && exit 1
fi
get_latest_chainlink_release_version:
name: Get latest Chainlink release version
runs-on: ubuntu-latest
environment: integration
outputs:
latest_chainlink_release_version: ${{ steps.get_latest_version.outputs.latest_version }}
steps:
- name: Get Latest Version
id: get_latest_version
run: |
untrimmed_ver=$(curl --header "Authorization: token ${{ secrets.GH_TOKEN }}" --request GET https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .name)
latest_version="${untrimmed_ver:1}"
echo "Latest Chainlink release version: $latest_version"
echo "latest_version=${latest_version}" >> "$GITHUB_OUTPUT"
# Check if latest_version is empty
if [ -z "$latest_version" ]; then
echo "Error: The latest_version is empty. The migration tests need a verison to run."
exit 1
fi
load-test-configurations:
name: Load test configurations
needs: [validate-inputs]
runs-on: ubuntu-latest
needs: validate-inputs
outputs:
run-docker-tests: ${{ steps.check-matrices.outputs.run-docker-tests }}
run-k8s-tests: ${{ steps.check-matrices.outputs.run-k8s-tests }}
Expand All @@ -151,7 +176,7 @@ jobs:
uses: actions/checkout@v3
with:
repository: 'smartcontractkit/chainlink-testing-framework'
ref: 35aa2ea0837aee32466f735a8d2220fb413413c6
ref: e7d83b97f9c1aa6c94c133f0b21d578fd0075560
path: 'chainlink-testing-framework'
- name: Setup Go
uses: ./.github/actions/setup-go
Expand Down Expand Up @@ -322,7 +347,7 @@ jobs:
# Run Docker tests
docker-tests:
name: Run docker tests (${{ matrix.tests.id }})
needs: [load-test-configurations, require-chainlink-image-versions-in-qa-ecr, require-chainlink-plugin-versions-in-qa-ecr]
needs: [load-test-configurations, require-chainlink-image-versions-in-qa-ecr, require-chainlink-plugin-versions-in-qa-ecr, get_latest_chainlink_release_version]
# Run when none of the needed jobs fail or are cancelled (skipped or successful jobs are ok)
if: ${{ needs.load-test-configurations.outputs.run-docker-tests == 'true' && always() && !failure() && !cancelled() }}
runs-on: ${{ matrix.tests.runsOn }}
Expand All @@ -337,10 +362,7 @@ jobs:
id-token: write
contents: read
env:
SELECTED_NETWORKS: SIMULATED
CHAINLINK_ENV_USER: ${{ github.actor }}
TEST_LOG_LEVEL: debug
QA_CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
LATEST_CHAINLINK_RELEASE_VERSION: ${{ needs.get_latest_chainlink_release_version.outputs.latest_chainlink_release_version }}
steps:
- name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
Expand All @@ -356,8 +378,8 @@ jobs:
if: inputs.test_config_override_base64 == ''
uses: ./.github/actions/create-default-e2e-config-override
with:
chainlink_version: ${{ inputs.chainlink_version || matrix.tests.test_inputs.chainlinkVersion || github.sha }}
chainlink_upgrade_version: ${{ matrix.tests.test_inputs.chainlinkUpgradeVersion || 'develop' }} # Set default upgrade version
chainlink_version: ${{ inputs.chainlink_version || matrix.tests.test_inputs.chainlink_version || github.sha }}
chainlink_upgrade_version: ${{ matrix.tests.test_inputs.chainlink_upgrade_version || 'develop' }} # Set default upgrade version
chainlink_postgres_version: ${{ matrix.tests.test_inputs.chainlinkPostgresVersion }}
selected_networks: ${{ matrix.tests.test_inputs.selectedNetworks || env.SELECTED_NETWORKS}}
logging_run_id: ${{ github.run_id }}
Expand All @@ -381,7 +403,7 @@ jobs:
duplicate-authorization-header: "true"

- name: Run tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@25e7c69bb6aae9781fec32355c6f9c485b12e594 # TODO: Create tag and use it here
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@6079d91c48cb08c686ea6dd53a047a36af9151f5 # TODO: Create tag and use it here
env:
DETACH_RUNNER: true
with:
Expand All @@ -405,8 +427,8 @@ jobs:
should_tidy: "false"
go_coverage_src_dir: /var/tmp/go-coverage
go_coverage_dest_dir: ${{ github.workspace }}/.covdata
DEFAULT_CHAINLINK_IMAGE: ${{ matrix.tests.test_inputs.chainlinkImage || env.CHAINLINK_IMAGE }}
DEFAULT_CHAINLINK_UPGRADE_IMAGE: ${{ matrix.tests.test_inputs.chainlinkUpgradeImage }}
DEFAULT_CHAINLINK_IMAGE: ${{ matrix.tests.test_inputs.chainlink_image || env.CHAINLINK_IMAGE }}
DEFAULT_CHAINLINK_UPGRADE_IMAGE: ${{ matrix.tests.test_inputs.chainlink_upgrade_image }}
DEFAULT_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
DEFAULT_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push
DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
Expand Down Expand Up @@ -456,7 +478,7 @@ jobs:
fi
run-k8s-runner-tests:
needs: [load-test-configurations, prepare-remote-runner-test-image, require-chainlink-image-versions-in-qa-ecr, require-chainlink-plugin-versions-in-qa-ecr]
needs: [load-test-configurations, prepare-remote-runner-test-image, require-chainlink-image-versions-in-qa-ecr, require-chainlink-plugin-versions-in-qa-ecr, get_latest_chainlink_release_version]
if: ${{ needs.load-test-configurations.outputs.run-k8s-tests == 'true' && always() && !failure() && !cancelled() }}
name: Run k8s tests (${{ matrix.tests.id }})
runs-on: ${{ matrix.tests.runsOn }}
Expand All @@ -471,11 +493,7 @@ jobs:
id-token: write
contents: read
env:
SELECTED_NETWORKS: SIMULATED
CHAINLINK_COMMIT_SHA: ${{ inputs.evm-ref || github.sha }}
CHAINLINK_ENV_USER: ${{ github.actor }}
TEST_LOG_LEVEL: debug

LATEST_CHAINLINK_RELEASE_VERSION: ${{ needs.get_latest_chainlink_release_version.outputs.latest_chainlink_release_version }}
steps:
- name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
Expand All @@ -492,8 +510,8 @@ jobs:
if: inputs.test_config_override_base64 == ''
uses: ./.github/actions/create-default-e2e-config-override
with:
chainlink_version: ${{ inputs.chainlink_version || matrix.tests.test_inputs.chainlinkVersion || github.sha }}
chainlink_upgrade_version: ${{ matrix.tests.test_inputs.chainlinkUpgradeVersion || 'develop' }} # Set default upgrade version
chainlink_version: ${{ inputs.chainlink_version || matrix.tests.test_inputs.chainlink_version || github.sha }}
chainlink_upgrade_version: ${{ matrix.tests.test_inputs.chainlink_upgrade_version || 'develop' }} # Set default upgrade version
chainlink_postgres_version: ${{ matrix.tests.test_inputs.chainlinkPostgresVersion }}
selected_networks: ${{ matrix.tests.test_inputs.selectedNetworks || env.SELECTED_NETWORKS}}
logging_run_id: ${{ github.run_id }}
Expand All @@ -508,7 +526,7 @@ jobs:
echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV
- name: Run tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@25e7c69bb6aae9781fec32355c6f9c485b12e594 # TODO: Create tag and use it here24
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@6079d91c48cb08c686ea6dd53a047a36af9151f5 # TODO: Create tag and use it here24
env:
DETACH_RUNNER: true
RR_MEM: ${{ matrix.tests.remoteRunnerMemory }}
Expand All @@ -533,8 +551,8 @@ jobs:
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
DEFAULT_CHAINLINK_IMAGE: ${{ matrix.tests.test_inputs.chainlinkImage || env.CHAINLINK_IMAGE }}
DEFAULT_CHAINLINK_UPGRADE_IMAGE: ${{ matrix.tests.test_inputs.chainlinkUpgradeImage }}
DEFAULT_CHAINLINK_IMAGE: ${{ matrix.tests.test_inputs.chainlink_image || env.CHAINLINK_IMAGE }}
DEFAULT_CHAINLINK_UPGRADE_IMAGE: ${{ matrix.tests.test_inputs.chainlink_upgrade_image }}
DEFAULT_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
DEFAULT_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push
DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
Expand Down

0 comments on commit 4b1f049

Please sign in to comment.