Skip to content

Commit

Permalink
Added workflow for testnet and gauntlet ocr2 inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
smickovskid committed Jul 11, 2023
1 parent 0aa8591 commit 30580f5
Show file tree
Hide file tree
Showing 7 changed files with 323 additions and 32 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/e2e_custom_cl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ on:
required: true
default: develop
type: string
schedule:
- cron: '0 * * * *'

env:
CL_ECR: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ github.sha }}
Expand Down Expand Up @@ -150,13 +149,6 @@ jobs:
TEST_LOG_LEVEL: debug
SELECTED_NETWORKS: SIMULATED
steps:
- name: Display dynamic job name
run: |
if [[ "${{ github.event_name }}" == "schedule" ]]; then
echo "Running job: Scheduled E2E Custom Run Smoke Tests"
else
echo "Running job: E2E Custom Run Smoke Tests"
fi
- name: Collect Metrics
if: always()
id: collect-gha-metrics
Expand All @@ -171,7 +163,7 @@ jobs:
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@ad22fbd6f4d108b82aaf49b527bcf40f32babea8 # v2.2.0
with:
test_command_to_run: cd ./integration-tests && go test -timeout 24h -count=1 -json $(args) ./smoke 2>&1 | tee /tmp/gotest.log | gotestfmt
test_command_to_run: cd ./integration-tests && go test -timeout 24h -count=1 -run TestSolanaOCRV2Smoke -json $(args) ./smoke 2>&1 | tee /tmp/gotest.log | gotestfmt
go_mod_path: ./integration-tests/go.mod
cl_repo: ${{ env.CL_ECR }}
cl_image_tag: solana.${{ github.sha }}
Expand Down
198 changes: 198 additions & 0 deletions .github/workflows/e2e_testnet_daily.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
name: e2e_testnet_daily
on:
workflow_dispatch:
inputs:
cl_branch_ref:
description: Chainlink repo branch to integrate with
required: true
default: develop
type: string
RPC_URL:
description: RPC URL for the tests
required: true
default: https://api.devnet.solana.com
type: string
WS_URL:
description: WS URL for the tests
required: true
default: wss://api.devnet.solana.com/
type: string
PRIVATE_KEY:
description: Private key in byte format [12, 12 ...]
required: true
type: string
schedule:
- cron: '0 * * * *'
env:
CL_ECR: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ github.sha }}
CONTRACT_ARTIFACTS_PATH: contracts/target/deploy

# Only run 1 of this workflow at a time per PR
concurrency:
group: integration-tests-solana-${{ github.ref }}
cancel-in-progress: true

jobs:
get_projectserum_version:
name: Get ProjectSerum Version
environment: integration
runs-on: ubuntu-latest
outputs:
projectserum_version: ${{ steps.psversion.outputs.projectserum_version }}
steps:
- name: Checkout the repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Get ProjectSerum Version
id: psversion
uses: ./.github/actions/projectserum_version

test-image-exists:
environment: integration
permissions:
checks: write
pull-requests: write
id-token: write
contents: read
name: Check If Solana Test Image Exists
runs-on: ubuntu-latest
outputs:
exists: ${{ steps.check-image.outputs.exists }}
steps:
- name: Check if image exists
id: check-image
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@ad22fbd6f4d108b82aaf49b527bcf40f32babea8 # v2.2.0
with:
repository: chainlink-solana-tests
tag: ${{ github.sha }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}

e2e_custom_build_artifacts:
name: E2E Custom Build Artifacts
environment: integration
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
needs: [get_projectserum_version, test-image-exists]
container:
image: projectserum/build:${{ needs.get_projectserum_version.outputs.projectserum_version }}
env:
RUSTUP_HOME: "/root/.rustup"
FORCE_COLOR: 1
steps:
- name: Checkout the repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Build contracts
if: needs.test-image-exists.outputs.exists == 'false'
uses: ./.github/actions/build_contract_artifacts

e2e_custom_build_custom_chainlink_image:
name: E2E Custom Build Custom CL Image
runs-on: ubuntu-latest
environment: integration
permissions:
id-token: write
contents: read
steps:
- name: Check if image exists
id: check-image
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@ad22fbd6f4d108b82aaf49b527bcf40f32babea8 # v2.2.0
with:
repository: chainlink
tag: solana.${{ github.sha }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
- name: Build Image
if: steps.check-image.outputs.exists == 'false'
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@d5ab9fe53da374dd789b5d9ef10f3282197e088d # we will want to switch to this once cosmos settles back down 336617ae6d70fec60c15cc3382e17a4d2615a801 # v2.2.0
with:
cl_repo: smartcontractkit/chainlink
cl_ref: ${{ github.event.inputs.cl_branch_ref }}
dep_solana_sha: ${{ github.event.pull_request.head.sha }}
push_tag: ${{ env.CL_ECR }}:solana.${{ github.sha }}
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}

build_test_image:
environment: integration
permissions:
id-token: write
contents: read
name: Build Test Image
runs-on: ubuntu-latest
needs: [e2e_custom_build_artifacts]
steps:
- name: Collect Metrics
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@v1
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: Build Test Image
continue-on-error: true
- name: Checkout the repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Build Image
uses: ./.github/actions/build-test-image
with:
artifacts_path: ${{ env.CONTRACT_ARTIFACTS_PATH }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}

e2e_custom_run_daily_testnet_smoke_tests:
name: E2E Run Daily Smoke Tests
environment: integration
permissions:
checks: write
pull-requests: write
id-token: write
contents: read
runs-on: ubuntu-latest

needs: [e2e_custom_build_artifacts, e2e_custom_build_custom_chainlink_image, build_test_image]
env:
TEST_SUITE: smoke
TEST_ARGS: -test.timeout 30m
CHAINLINK_COMMIT_SHA: ${{ github.sha }}
CHAINLINK_ENV_USER: ${{ github.actor }}
TEST_LOG_LEVEL: debug
SELECTED_NETWORKS: SIMULATED
RPC_URL: ${{ github.event_name == 'schedule' && 'https://api.devnet.solana.com' || github.event.inputs.RPC_URL }}
WS_URL: ${{ github.event_name == 'schedule' && 'wss://api.devnet.solana.com/' || github.event.inputs.WS_URL }}
PROGRAM_ID_OCR2: 9v5sGbNhyTM23yVvczzPbk5NtCqrARQpZjuzebBur43h
PROGRAM_ID_ACCESS_CONTROLLER: 5Gm8JySC3RzGonihF1hj1kZkjHyyW7qxJNvyzq1ieAY5
PROGRAM_ID_STORE: ANooJg7j9UxgJ2DNuLqUJs5h956qzc5LdPLFFtQdDb8M
LINK_TOKEN: Dmw5mDvteezKfop9zd3RQbJmZfBATF3QuSqDU66axyts
VAULT_ADDRESS: G27m7KxTh4KVLapxB9MXfEA8HLUfYuGYQ1ELEs2zQdiQ
PRIVATE_KEY: ${{ github.event_name == 'schedule' && secrets.PRIVATE_KEY || github.event.inputs.PRIVATE_KEY }}

steps:
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@8163dcea2f01a0a8fec84b284406ff7af1d2e1c0
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: E2E Run Daily Smoke Tests
continue-on-error: true
- name: Checkout the repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@ad22fbd6f4d108b82aaf49b527bcf40f32babea8 # v2.2.0
with:
test_command_to_run: cd ./integration-tests && go test -timeout 24h -count=1 -run TestSolanaGauntletOCRV2Smoke -json $(args) ./smoke 2>&1 | tee /tmp/gotest.log | gotestfmt
go_mod_path: ./integration-tests/go.mod
cl_repo: ${{ env.CL_ECR }}
cl_image_tag: solana.${{ github.sha }}
artifacts_location: /home/runner/work/chainlink-solana/chainlink-solana/integration-tests/logs
token: ${{ secrets.GITHUB_TOKEN }}
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
should_cleanup: false
6 changes: 6 additions & 0 deletions integration-tests/common/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,11 @@ func (m *OCRv2TestState) ConfigureGauntlet(secret string) map[string]string {
if !exists {
panic("Please define RPC_URL")
}

wsUrl, exists := os.LookupEnv("WS_URL")
if !exists {
panic("Please define WS_URL")
}
privateKey, exists := os.LookupEnv("PRIVATE_KEY")
if !exists {
panic("Please define PRIVATE_KEY")
Expand Down Expand Up @@ -568,6 +573,7 @@ func (m *OCRv2TestState) ConfigureGauntlet(secret string) map[string]string {

return map[string]string{
"NODE_URL": rpcUrl,
"WS_URL": wsUrl,
"PRIVATE_KEY": privateKey,
"PROGRAM_ID_OCR2": programIdOCR2,
"PROGRAM_ID_ACCESS_CONTROLLER": programIdAccessController,
Expand Down
7 changes: 4 additions & 3 deletions integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ replace github.com/smartcontractkit/chainlink-solana => ../

require (
github.com/ethereum/go-ethereum v1.12.0
github.com/gagliardetto/binary v0.7.1
github.com/gagliardetto/solana-go v1.4.1-0.20220428092759-5250b4abbb27
github.com/gagliardetto/binary v0.7.7
github.com/gagliardetto/solana-go v1.8.3
github.com/lib/pq v1.10.9
github.com/onsi/gomega v1.24.1
github.com/rs/zerolog v1.29.1
Expand Down Expand Up @@ -43,7 +43,6 @@ require (
github.com/avast/retry-go v3.0.0+incompatible // indirect
github.com/aws/constructs-go/constructs/v10 v10.1.255 // indirect
github.com/aws/jsii-runtime-go v1.75.0 // indirect
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 // indirect
github.com/benbjohnson/clock v1.3.4 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
Expand Down Expand Up @@ -296,6 +295,7 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.14.0 // indirect
github.com/status-im/keycard-go v0.2.0 // indirect
github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
github.com/tendermint/btcd v0.1.1 // indirect
Expand Down Expand Up @@ -326,6 +326,7 @@ require (
go.dedis.ch/fixbuf v1.0.3 // indirect
go.dedis.ch/kyber/v3 v3.0.14 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.mongodb.org/mongo-driver v1.11.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.starlark.net v0.0.0-20220817180228-f738f5508c12 // indirect
go.uber.org/atomic v1.11.0 // indirect
Expand Down
Loading

0 comments on commit 30580f5

Please sign in to comment.