Skip to content

Commit

Permalink
Migrate on-demand-vrfv2plus-smoke-tests.yml to reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcl committed Sep 5, 2024
1 parent df5862f commit f9e2f74
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 190 deletions.
89 changes: 0 additions & 89 deletions .github/workflows/on-demand-vrfv2plus-smoke-tests 2.yml

This file was deleted.

158 changes: 57 additions & 101 deletions .github/workflows/on-demand-vrfv2plus-smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
description: "Test Suite to run"
required: true
type: choice
default: "All Tests"
options:
- "All Tests"
- "Selected Tests"
Expand All @@ -25,108 +26,63 @@ on:
description: Chainlink image version to use
default: develop
required: false
type: string
type: string

jobs:
vrfv2plus_smoke_test:
name: VRFV2 Plus Smoke Test
environment: integration
runs-on: ubuntu22.04-8cores-32GB
permissions:
checks: write
pull-requests: write
id-token: write
contents: read
env:
LOKI_URL: ${{ secrets.LOKI_URL }}
LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }}
LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }}
TEST_LOG_LEVEL: debug
REF_NAME: ${{ github.head_ref || github.ref_name }}
SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }}
SLACK_CHANNEL: ${{ secrets.QA_VRF_SLACK_CHANNEL }}
GRAFANA_URL: "http://localhost:8080/primary"
GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs"
GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }}
WASP_LOG_LEVEL: info
set-tests-to-run:
name: Set tests to run
runs-on: ubuntu-latest
outputs:
test_list: ${{ steps.set-tests.outputs.test_list }}
steps:
- name: Collect Metrics
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1
with:
id: on-demand-vrfv2plus-smoke-tests
org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }}
this-job-name: ${{ inputs.network }} VRFV2 Plus Smoke Test
continue-on-error: true
- name: Checkout code
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: 0
- name: Show test config override path in summary
if: ${{ inputs.test_config_override_path }}
run: |
echo "### Test config override path" >> $GITHUB_STEP_SUMMARY
echo "[${{ inputs.test_config_override_path }}]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/blob/${{ github.sha }}/${{ inputs.test_config_override_path }})" >> $GITHUB_STEP_SUMMARY
- name: Show test secrets override key in summary
if: ${{ inputs.test_secrets_override_key }}
run: |
echo "### Test secrets override key" >> $GITHUB_STEP_SUMMARY
echo "${{ inputs.test_secrets_override_key }}" >> $GITHUB_STEP_SUMMARY
- name: Show chainlink version in summary
- name: Generate Test List JSON
id: set-tests
run: |
echo "### Chainlink version" >> $GITHUB_STEP_SUMMARY
echo "${{ inputs.chainlink_version }}" >> $GITHUB_STEP_SUMMARY
- name: Run Tests
if: ${{ github.event.inputs.test_suite == 'Selected Tests' }}
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@94cb11f4bd545607a2f221c6685052b3abee723d # v2.3.32
env:
E2E_TEST_CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
E2E_TEST_CHAINLINK_VERSION: ${{ inputs.chainlink_version }} # Default chainlink version if not overrided in the test config
E2E_TEST_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
E2E_TEST_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push
E2E_TEST_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
E2E_TEST_GRAFANA_BASE_URL: "http://localhost:8080/primary"
E2E_TEST_GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs"
E2E_TEST_GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }}
with:
test_command_to_run: cd ./integration-tests/smoke && go test -v -count=1 -parallel=1 -timeout 2h -run "${{ inputs.test_list_regex }}" 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs
test_download_vendor_packages_command: cd ./integration-tests && go mod download
test_secrets_override_base64: ${{ secrets[inputs.test_secrets_override_key] }}
test_config_override_path: ${{ inputs.test_config_override_path }}
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
artifacts_name: vrf-test-logs
artifacts_location: ./integration-tests/smoke/vrfv2plus/logs/
token: ${{ secrets.GITHUB_TOKEN }}
go_mod_path: ./integration-tests/go.mod
should_cleanup: false
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
- name: Run Tests
if: ${{ github.event.inputs.test_suite == 'All Tests' }}
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@94cb11f4bd545607a2f221c6685052b3abee723d # v2.3.32
env:
E2E_TEST_CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
E2E_TEST_CHAINLINK_VERSION: ${{ inputs.chainlink_version }} # Default chainlink version if not overrided in the test config
E2E_TEST_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
E2E_TEST_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push
E2E_TEST_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
E2E_TEST_GRAFANA_BASE_URL: "http://localhost:8080/primary"
E2E_TEST_GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs"
E2E_TEST_GRAFANA_BEARER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }}
with:
test_command_to_run: cd ./integration-tests/smoke && go test -v -count=1 -parallel=1 -timeout 3h vrfv2plus_test.go 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs
test_download_vendor_packages_command: cd ./integration-tests && go mod download
test_secrets_override_base64: ${{ secrets[inputs.test_secrets_override_key] }}
test_config_override_path: ${{ inputs.test_config_override_path }}
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
artifacts_name: vrf-test-logs
artifacts_location: ./integration-tests/smoke/vrfv2plus/logs/
token: ${{ secrets.GITHUB_TOKEN }}
go_mod_path: ./integration-tests/go.mod
should_cleanup: false
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
if [[ "${{ inputs.test_suite }}" == "All Tests" ]]; then
TEST_CMD="cd integration-tests/smoke && go test vrfv2plus_test.go -test.parallel=1 -timeout 3h -count=1 -json -v"
else
TEST_CMD='cd integration-tests/smoke && go test -test.run "${{ inputs.test_list_regex }}" -test.parallel=1 -timeout 2h -count=1 -json -v'
fi
TEST_CONFIG_OVERRIDE_PATH=${{ inputs.test_config_override_path }}
TEST_LIST=$(jq -n -c \
--arg test_cmd "$TEST_CMD" \
--arg test_config_override_path "$TEST_CONFIG_OVERRIDE_PATH" \
'{
"tests": [
{
"id": "TestVRFv2Plus_Smoke",
"path": "integration-tests/smoke/vrfv2plus_test.go",
"runs_on": "ubuntu-latest",
"test_env_type": "docker",
"test_cmd": $test_cmd,
"test_config_override_path": $test_config_override_path
}
]
}')
echo "test_list=$TEST_LIST" >> $GITHUB_OUTPUT
run-e2e-tests-workflow:
name: Run E2E Tests
needs: set-tests-to-run
uses: ./.github/workflows/run-e2e-tests-reusable-workflow.yml
with:
custom_test_list_json: ${{ needs.set-tests-to-run.outputs.test_list }}
chainlink_version: ${{ inputs.chainlink_version }}
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 }}
QA_PYROSCOPE_INSTANCE: ${{ secrets.QA_PYROSCOPE_INSTANCE }}
QA_PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
GRAFANA_INTERNAL_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }}
GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }}
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 }}
AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }}
TEST_SECRETS_OVERRIDE_BASE64: ${{ secrets[inputs.test_secrets_override_key] }}

0 comments on commit f9e2f74

Please sign in to comment.