Skip to content

Commit

Permalink
Fix for E2E tests nightly workflow (smartcontractkit#14200)
Browse files Browse the repository at this point in the history
* Fix slack notification in e2e reusable workflow

Fix notification when no tests were executed. Then load-test-configurations fails and failed notification will be send

* Fix nightly workflow

* Fix

* Run tests on workflow or test list changes

* Update job names
  • Loading branch information
lukaszcl authored Aug 22, 2024
1 parent e452ee1 commit 2900a1e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ runner-test-matrix:
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_env_vars:
E2E_TEST_CHAINLINK_VERSION: '{{ env.GITHUB_SHA_PLUGINS }}' # This is the chainlink version that has the plugins
E2E_TEST_CHAINLINK_VERSION: '{{ env.DEFAULT_CHAINLINK_PLUGINS_VERSION }}' # This is the chainlink version that has the plugins
ENABLE_OTEL_TRACES: true

# END: OCR tests
Expand Down Expand Up @@ -823,7 +823,7 @@ runner-test-matrix:
E2E_TEST_CHAINLINK_IMAGE: public.ecr.aws/chainlink/chainlink
E2E_TEST_CHAINLINK_VERSION: '{{ env.LATEST_CHAINLINK_RELEASE_VERSION }}'
E2E_TEST_CHAINLINK_UPGRADE_IMAGE: '{{ env.QA_CHAINLINK_IMAGE }}'
E2E_TEST_CHAINLINK_UPGRADE_VERSION: '{{ env.GITHUB_SHA }}'
E2E_TEST_CHAINLINK_UPGRADE_VERSION: '{{ env.DEFAULT_CHAINLINK_VERSION }}'

# END: Other tests

Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,21 @@ jobs:
id: changes
with:
filters: |
github_ci_changes:
- '.github/workflows/integration-tests.yml'
- '.github/workflows/run-e2e-tests-reusable-workflow.yml'
- '.github/e2e-tests.yml'
core_changes:
- '**/*.go'
- '**/*go.sum'
- '**/*go.mod'
- '.github/workflows/integration-tests.yml'
- '**/*Dockerfile'
- 'core/**/migrations/*.sql'
- 'core/**/config/**/*.toml'
- 'integration-tests/**/*.toml'
ccip_changes:
- '**/*ccip*'
- '**/*ccip*/**'
- '**/*ccip*/**'
- name: Ignore Filter On Workflow Dispatch
if: ${{ github.event_name == 'workflow_dispatch' }}
id: ignore-filter
Expand All @@ -120,6 +123,7 @@ jobs:
this-job-name: Check Paths That Require Tests To Run
continue-on-error: true
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 }}

Expand Down Expand Up @@ -193,7 +197,7 @@ jobs:
needs: [changes, enforce-ctf-version]
steps:
- name: Collect Metrics
if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch'
if: needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true' || github.event_name == 'workflow_dispatch'
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1
with:
Expand All @@ -218,7 +222,7 @@ jobs:
aws-region: ${{ secrets.AWS_REGION }}
set-git-config: "true"
- name: Build Chainlink Image
if: needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch'
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 }}
Expand All @@ -237,7 +241,7 @@ jobs:
id-token: write
contents: read
needs: [build-chainlink, changes]
if: needs.changes.outputs.core_changes == 'true'
if: needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true'
uses: ./.github/workflows/run-e2e-tests-reusable-workflow.yml
with:
workflow_name: Run Core E2E Tests
Expand Down Expand Up @@ -273,7 +277,7 @@ jobs:
id-token: write
contents: read
needs: [build-chainlink, changes]
if: needs.changes.outputs.ccip_changes == 'true'
if: needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true'
uses: ./.github/workflows/run-e2e-tests-reusable-workflow.yml
with:
workflow_name: Run CCIP E2E Tests
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/run-e2e-tests-reusable-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ on:
type: string
default: 'Run E2E Tests'
chainlink_version:
description: 'Enter Chainlink version to use for the tests. Example: "v2.10.0" or sha'
description: 'Enter Chainlink version to use for the tests. Example: v2.10.0, develop or commit sha'
required: false
type: string
chainlink_upgrade_version:
description: 'Enter Chainlink version to upgrade to for upgrade tests. Example: "v2.10.0" or sha'
description: 'Enter Chainlink version to use for the upgrade tests. Example: v2.10.0, develop or commit sha'
required: false
type: string
test_ids:
Expand Down Expand Up @@ -134,8 +134,8 @@ 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: ${{ github.sha }}
GITHUB_SHA_PLUGINS: ${{ github.sha }}-plugins
DEFAULT_CHAINLINK_VERSION: ${{ inputs.chainlink_version || github.sha }}
DEFAULT_CHAINLINK_PLUGINS_VERSION: ${{ inputs.chainlink_version != '' && format('{0}-plugins', inputs.chainlink_version) || format('{0}-plugins', github.sha) }}
CHAINLINK_ENV_USER: ${{ github.actor }}
CHAINLINK_COMMIT_SHA: ${{ inputs.evm-ref || github.sha }}
SELECTED_NETWORKS: SIMULATED
Expand Down Expand Up @@ -408,7 +408,7 @@ jobs:

# Run Docker tests
run-docker-tests:
name: Run ${{ matrix.tests.id }}
name: ${{ matrix.tests.id }}
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() }}
Expand All @@ -435,7 +435,7 @@ jobs:
org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }}
this-job-name: ${{ inputs.workflow_name }} / Run ${{ matrix.tests.id }}
this-job-name: ${{ inputs.workflow_name }} / ${{ matrix.tests.id }}
test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}'
continue-on-error: true

Expand Down Expand Up @@ -626,7 +626,7 @@ jobs:
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, get_latest_chainlink_release_version]
if: ${{ needs.load-test-configurations.outputs.run-k8s-tests == 'true' && always() && !failure() && !cancelled() }}
name: Run ${{ matrix.tests.id }}
name: ${{ matrix.tests.id }}
runs-on: ${{ matrix.tests.runs_on }}
strategy:
fail-fast: false
Expand All @@ -650,7 +650,7 @@ jobs:
org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }}
this-job-name: ${{ inputs.workflow_name }} / Run ${{ matrix.tests.id }}
this-job-name: ${{ inputs.workflow_name }} / ${{ matrix.tests.id }}
continue-on-error: true

- name: Checkout repository
Expand Down Expand Up @@ -769,7 +769,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ inputs.slack_notification_after_tests_name }} - ${{ steps.combine_results.outputs.result == 'failure' && 'Failed :x:' || steps.combine_results.outputs.result == 'cancelled' && 'Cancelled :warning:' || 'Passed :white_check_mark:' }}"
"text": "${{ inputs.slack_notification_after_tests_name }} - ${{ contains(join(needs.*.result, ','), 'failure') && 'Failed :x:' || contains(join(needs.*.result, ','), 'cancelled') && 'Cancelled :warning:' || 'Passed :white_check_mark:' }}"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-nightly-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: ./.github/workflows/run-e2e-tests-reusable-workflow.yml
with:
chainlink_version: develop
test_workflow: Run Nightly E2E Tests
test_workflow: Nightly E2E Tests
slack_notification_after_tests: true
slack_notification_after_tests_channel_id: "#team-test-tooling-internal"
slack_notification_after_tests_name: Nightly E2E Tests
Expand Down

0 comments on commit 2900a1e

Please sign in to comment.