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

Fix LP tests filters check and add to smoke tests in CI #11649

Merged
merged 39 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8669b49
fix hasFilters, fix cancelling log emission in case of errors, add so…
Tofel Dec 21, 2023
5cd31c7
fix replay test
Tofel Dec 21, 2023
2bd609c
fix lints
Tofel Dec 21, 2023
3c7ec93
shorten chaos log poller test
Tofel Dec 21, 2023
4f029dc
remove debug logs
Tofel Dec 21, 2023
74248fe
disable backup poller. DO NOT MERGE THIS
Tofel Dec 22, 2023
bc8afe6
make it configurable which container is paused: cl node or postgres
Tofel Dec 22, 2023
2344b9a
Merge branch 'develop' into lp_tests_final_fix_and_ci
Tofel Jan 8, 2024
b7ed75c
try Domino's way of stopping log poller
Tofel Jan 8, 2024
e509bbe
fix smoke test job name
Tofel Jan 8, 2024
9f09b95
remove unnecessary check
Tofel Jan 8, 2024
428505f
Merge branch 'develop' into lp_tests_final_fix_and_ci
Tofel Jan 9, 2024
eefb8ba
Merge branch 'develop' into lp_tests_final_fix_and_ci
Tofel Jan 10, 2024
bcb5b39
Merge branch 'lp_tests_final_fix_and_ci' of github.com:smartcontractk…
Tofel Jan 10, 2024
1d6355e
try executing postgress pausing lp test, more debug info about missin…
Tofel Jan 10, 2024
095b18b
Merge branch 'develop' into lp_tests_final_fix_and_ci
Tofel Jan 10, 2024
1c0469f
fix lints
Tofel Jan 10, 2024
3986381
Merge branch 'develop' into lp_tests_final_fix_and_ci
Tofel Jan 10, 2024
84c2268
Merge branch 'develop' into lp_tests_final_fix_and_ci
Tofel Jan 11, 2024
c9a4f11
revert disabling of backpolling, simplify some code, less logs
Tofel Jan 11, 2024
5017d47
make optional parameters not required in lp on demand test
Tofel Jan 11, 2024
c6561fe
run lp smoke tests in a separate job
Tofel Jan 12, 2024
c39a46a
prepare log poller json test list
Tofel Jan 12, 2024
28201c6
add missing comma, revert some comments
Tofel Jan 15, 2024
470be1d
Merge branch 'develop' into lp_tests_final_fix_and_ci
Tofel Jan 15, 2024
a79a60d
fix filename for lp matrix job
Tofel Jan 15, 2024
fd53328
Merge branch 'develop' into lp_tests_final_fix_and_ci
Tofel Jan 19, 2024
d8e50c4
Merge branch 'develop' into lp_tests_final_fix_and_ci
Tofel Jan 22, 2024
bbcd6b6
Merge branch 'develop' into lp_tests_final_fix_and_ci
Tofel Jan 22, 2024
cf37f31
Merge branch 'develop' into lp_tests_final_fix_and_ci
Tofel Jan 22, 2024
623033a
move log poller scenarios to test file, remove unused load test
Tofel Jan 22, 2024
2b41ffc
Merge branch 'develop' into lp_tests_final_fix_and_ci
Tofel Jan 23, 2024
af7db75
reduce code duplication in lp tests
Tofel Jan 23, 2024
7de3fd7
fix lp tests, fix smoke workflow
Tofel Jan 23, 2024
34243da
Merge branch 'develop' into lp_tests_final_fix_and_ci
Tofel Jan 23, 2024
62ee2d1
Merge branch 'develop' into lp_tests_final_fix_and_ci
Tofel Jan 23, 2024
451d457
remove commented out sections, remove cosmossdk.io/errors
Tofel Jan 23, 2024
f52c011
Merge branch 'lp_tests_final_fix_and_ci' of github.com:smartcontractk…
Tofel Jan 23, 2024
157e683
removed trailing spaces, added comments to functions
Tofel Jan 23, 2024
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
88 changes: 81 additions & 7 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ jobs:
runs-on: ubuntu-latest
name: Compare/Build Automation Test List
outputs:
matrix: ${{ env.MATRIX_JSON }}
automation-matrix: ${{ env.AUTOMATION_JOB_MATRIX_JSON }}
lp-matrix: ${{ env.LP_JOB_MATRIX_JSON }}
steps:
- name: Check for Skip Tests Label
if: contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests')
Expand All @@ -203,6 +204,7 @@ jobs:
cd ./integration-tests
./scripts/compareTestList.sh ./smoke/automation_test.go
./scripts/compareTestList.sh ./smoke/keeper_test.go
./scripts/compareTestList.sh ./smoke/log_poller_test.go
- name: Build Test Matrix Lists
id: build-test-matrix-list
run: |
Expand All @@ -211,19 +213,22 @@ jobs:
MATRIX_JSON_KEEPER=$(./scripts/buildTestMatrixList.sh ./smoke/keeper_test.go keeper ubuntu-latest 1)
COMBINED_ARRAY=$(jq -c -n "$MATRIX_JSON_AUTOMATION + $MATRIX_JSON_KEEPER")

LOG_POLLER_MATRIX_JSON=$(./scripts/buildTestMatrixList.sh ./smoke/log_poller_test.go log_poller ubuntu-latest 1)
echo "LP_JOB_MATRIX_JSON=${LOG_POLLER_MATRIX_JSON}" >> $GITHUB_ENV

# if we running a PR against the develop branch we should only run the automation tests unless we are in the merge group event
if [[ "$GITHUB_EVENT_NAME" == "merge_group" ]]; then
echo "We are in a merge_group event, run both automation and keepers tests"
echo "MATRIX_JSON=${COMBINED_ARRAY}" >> $GITHUB_ENV
echo "AUTOMATION_JOB_MATRIX_JSON=${COMBINED_ARRAY}" >> $GITHUB_ENV
else
echo "we are not in a merge_group event, if this is a PR to develop run only automation tests, otherwise run everything because we could be running against a release branch"
target_branch=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.base.ref)
if [[ "$target_branch" == "develop" ]]; then
echo "only run automation tests"
echo "MATRIX_JSON=${MATRIX_JSON_AUTOMATION}" >> $GITHUB_ENV
echo "AUTOMATION_JOB_MATRIX_JSON=${MATRIX_JSON_AUTOMATION}" >> $GITHUB_ENV
else
echo "run both automation and keepers tests"
echo "MATRIX_JSON=${COMBINED_ARRAY}" >> $GITHUB_ENV
echo "AUTOMATION_JOB_MATRIX_JSON=${COMBINED_ARRAY}" >> $GITHUB_ENV
fi
fi

Expand All @@ -245,7 +250,7 @@ jobs:
strategy:
fail-fast: false
matrix:
product: ${{fromJson(needs.compare-tests.outputs.matrix)}}
product: ${{fromJson(needs.compare-tests.outputs.automation-matrix)}}
runs-on: ${{ matrix.product.os }}
name: ETH Smoke Tests ${{ matrix.product.name }}
steps:
Expand Down Expand Up @@ -286,7 +291,7 @@ jobs:
LOGSTREAM_LOG_TARGETS: ${{ vars.LOGSTREAM_LOG_TARGETS }}
GRAFANA_URL: ${{ vars.GRAFANA_URL }}
GRAFANA_DATASOURCE: ${{ vars.GRAFANA_DATASOURCE }}
RUN_ID: ${{ github.run_id }}
RUN_ID: ${{ github.run_id }}
with:
test_command_to_run: cd ./integration-tests && go test -timeout 30m -count=1 -json -test.parallel=${{ matrix.product.nodes }} ${{ steps.build-go-test-command.outputs.run_command }} 2>&1 | tee /tmp/gotest.log | gotestfmt
test_download_vendor_packages_command: cd ./integration-tests && go mod download
Expand All @@ -306,6 +311,75 @@ jobs:
if: always()
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@ea889b3133bd7f16ab19ba4ba130de5d9162c669 # v2.3.4

eth-smoke-tests-matrix-log-poller:
if: ${{ !(contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') || github.event_name == 'workflow_dispatch') }}
environment: integration
permissions:
checks: write
pull-requests: write
id-token: write
contents: read
needs:
[build-chainlink, changes, compare-tests, build-lint-integration-tests]
env:
SELECTED_NETWORKS: SIMULATED,SIMULATED_1,SIMULATED_2
CHAINLINK_COMMIT_SHA: ${{ github.sha }}
CHAINLINK_ENV_USER: ${{ github.actor }}
TEST_LOG_LEVEL: debug
strategy:
fail-fast: false
matrix:
product: ${{fromJson(needs.compare-tests.outputs.lp-matrix)}}
runs-on: ${{ matrix.product.os }}
name: ETH Smoke Tests ${{ matrix.product.name }}
steps:
- name: Collect Metrics
if: needs.changes.outputs.src == 'true'
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@d1618b772a97fd87e6505de97b872ee0b1f1729a # v2.0.2
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: ETH Smoke Tests ${{ matrix.product.name }}
test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}'
continue-on-error: true
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- name: Build Go Test Command
id: build-go-test-command
run: |
# if the matrix.product.run is set, use it for a different command
if [ "${{ matrix.product.run }}" != "" ]; then
echo "run_command=${{ matrix.product.run }} ./smoke/${{ matrix.product.file }}_test.go" >> "$GITHUB_OUTPUT"
else
echo "run_command=./smoke/${{ matrix.product.name }}_test.go" >> "$GITHUB_OUTPUT"
fi
## Run this step when changes that require tests to be run are made
- name: Run Tests
if: needs.changes.outputs.src == 'true'
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@e865e376b8c2d594028c8d645dd6c47169b72974 # v2.2.16
env:
PYROSCOPE_SERVER: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725
PYROSCOPE_ENVIRONMENT: ${{ matrix.product.pyroscope_env }}
PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }}
with:
test_command_to_run: cd ./integration-tests && go test -timeout 30m -count=1 -json -test.parallel=${{ matrix.product.nodes }} ${{ steps.build-go-test-command.outputs.run_command }} 2>&1 | tee /tmp/gotest.log | gotestfmt
test_download_vendor_packages_command: cd ./integration-tests && go mod download
cl_repo: ${{ env.CHAINLINK_IMAGE }}
cl_image_tag: ${{ github.sha }}
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
artifacts_location: ./integration-tests/smoke/logs/
publish_check_name: ${{ matrix.product.name }}
token: ${{ secrets.GITHUB_TOKEN }}
go_mod_path: ./integration-tests/go.mod
cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }}
cache_restore_only: "true"
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ""

eth-smoke-tests-matrix:
if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }}
environment: integration
Expand Down Expand Up @@ -505,7 +579,7 @@ jobs:
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: trace-data
path: ./integration-tests/smoke/traces/trace-data.json
path: ./integration-tests/smoke/traces/trace-data.json
- name: Print failed test summary
if: always()
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@ea889b3133bd7f16ab19ba4ba130de5d9162c669 # v2.3.4
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/on-demand-log-poller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,22 @@ on:
required: true
selectedNetworks:
type: choice
description: Networks to test on
options:
- "SIMULATED"
- "SEPOLIA"
- "MUMBAI"
fundingPrivateKey:
description: Private funding key (Skip for Simulated)
required: true
required: false
type: string
wsURL:
description: WS URL for the network (Skip for Simulated)
required: true
required: false
type: string
httpURL:
description: HTTP URL for the network (Skip for Simulated)
required: true
required: false
type: string

jobs:
Expand Down Expand Up @@ -84,4 +85,4 @@ jobs:
run: |
cd integration-tests
go mod download
go test -v -timeout 5h -v -count=1 -run ^TestLogPollerFromEnv$ ./reorg/log_poller_maybe_reorg_test.go
go test -v -timeout 5h -v -count=1 -run ^TestLogPollerFewFiltersFixedDepth$ ./smoke/log_poller_test.go
2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ go 1.21.4
replace github.com/smartcontractkit/chainlink/v2 => ../

require (
cosmossdk.io/errors v1.0.0
github.com/K-Phoen/grabana v0.21.17
github.com/cli/go-gh/v2 v2.0.0
github.com/ethereum/go-ethereum v1.13.8
Expand Down Expand Up @@ -60,6 +59,7 @@ require (
cosmossdk.io/api v0.3.1 // indirect
cosmossdk.io/core v0.5.1 // indirect
cosmossdk.io/depinject v1.0.0-alpha.3 // indirect
cosmossdk.io/errors v1.0.0 // indirect
cosmossdk.io/math v1.0.1 // indirect
dario.cat/mergo v1.0.0 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
Expand Down
22 changes: 0 additions & 22 deletions integration-tests/load/log_poller/config.toml

This file was deleted.

25 changes: 0 additions & 25 deletions integration-tests/load/log_poller/log_poller_test.go

This file was deleted.

43 changes: 0 additions & 43 deletions integration-tests/reorg/log_poller_maybe_reorg_test.go

This file was deleted.

Loading
Loading