Skip to content

Commit

Permalink
OCR2 E2E K8s Smoke test (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
skudasov authored and krebernisak committed Dec 20, 2021
1 parent 75a9f4d commit e2b62c3
Show file tree
Hide file tree
Showing 102 changed files with 11,853 additions and 25 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: e2e_tests
on: [push]

jobs:
build:
runs-on: ubuntu-latest
container:
image: projectserum/build:v0.18.0
env:
RUSTUP_HOME: "/root/.rustup"
FORCE_COLOR: 1
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- run: echo $HOME
- run: echo $PATH
- run: |
npm config set -- '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
NPM_TOKEN=${NPM_TOKEN} yarn install --frozen-lockfile
- name: set key ids
run: bash set_declare_ids.sh
working-directory: contracts
- run: anchor build
working-directory: contracts
- uses: actions/upload-artifact@master
with:
name: target
path: contracts/target/deploy
smoke:
runs-on: ubuntu-latest
needs: build
env:
CGO_ENABLED: 1
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v1
with:
go-version: 1.17
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.QA_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.QA_AWS_SECRET_KEY }}
aws-region: ${{ secrets.QA_AWS_REGION }}
role-to-assume: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
role-duration-seconds: 3600
- name: Set Kubernetes Context
uses: azure/k8s-set-context@v1
with:
method: kubeconfig
kubeconfig: ${{ secrets.QA_KUBECONFIG }}
- name: Cache Vendor Packages
uses: actions/cache@v2
id: cache-packages
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go Vendor Packages
if: steps.cache-packages.outputs.cache-hit != 'true'
run: go mod download
- name: Install Ginkgo CLI
run: |
go get github.com/onsi/ginkgo/v2/ginkgo/[email protected]
go get github.com/onsi/ginkgo/v2/ginkgo/[email protected]
go get github.com/onsi/ginkgo/v2/ginkgo/[email protected]
go install github.com/onsi/ginkgo/v2/ginkgo
- uses: actions/download-artifact@master
with:
name: target
path: contracts/target/deploy
- name: cp static deploy keys
run: cp tests/e2e/keys/*.json contracts/target/deploy
- name: Run Tests
env:
SELECTED_NETWORKS: solana
NETWORK_SETTINGS: /home/runner/work/chainlink-solana/chainlink-solana/tests/e2e/networks.yaml
run: |
export PATH=$PATH:$(go env GOPATH)/bin
ginkgo tests/e2e/smoke
- name: Publish Test Results
uses: mikepenz/action-junit-report@v2
if: always()
with:
report_paths: './tests-smoke-report.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: Smoke Test Results
- name: Publish Artifacts
if: failure()
uses: actions/[email protected]
with:
name: test-logs
path: ./logs
6 changes: 6 additions & 0 deletions contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,9 @@ Run anchor tests (automatically tests against a local node).
```
anchor test
```

### `anchor-go` bindings generation
Install `https://github.com/gagliardetto/anchor-go`
```
./anchor-generate.sh
```
7 changes: 7 additions & 0 deletions contracts/anchor-generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
for idl_path_str in "target/idl"/*
do
IFS='/' read -r -a idl_path <<< "${idl_path_str}"
IFS='.' read -r -a idl_name <<< "${idl_path[2]}"
anchor-go -src "${idl_path_str}" -dst generated/"${idl_name[0]}" -codec borsh
done
Empty file.
136 changes: 136 additions & 0 deletions contracts/generated/access_controller/AddAccess.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions contracts/generated/access_controller/AddAccess_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e2b62c3

Please sign in to comment.