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

ContractReader Interface Tests #945

Merged
merged 8 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/e2e_custom_cl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,5 @@ jobs:
env:
E2E_TEST_CHAINLINK_IMAGE: ${{ env.CL_ECR }}
E2E_TEST_SOLANA_SECRET: thisisatestingonlysecret
CHAINLINK_USER_TEAM: ${{ github.event.inputs.team || 'BIX' }}

54 changes: 54 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,57 @@ jobs:
cd /repo/contracts &&\
cargo check &&\
cargo clippy -- -D warnings"
relay_run_interface_tests:
name: Relay Run Interface Tests
runs-on: ubuntu-latest-8cores-32GB
needs: [get_projectserum_version, build_wrapped_anchor_image]
steps:
- name: Checkout sources
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5

- name: Cache cargo target dir
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: contracts/target
key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: cache docker build image
id: cache-image
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
fail-on-cache-miss: true
path: contracts/docker-build.tar
key: ${{ runner.os }}-docker-pnpm-build-${{ needs.get_projectserum_version.outputs.projectserum_version }}-${{ hashFiles('**/Cargo.lock') }}

- name: load cached image
run: |
docker load --input docker-build.tar
- name: Setup go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: "./integration-tests/go.mod"
check-latest: true
cache-dependency-path: "./integration-tests/go.sum"

- name: Install gotestloghelper
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/gotestloghelper@latest

- name: Install Solana CLI
run: ../scripts/install-solana-ci.sh

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
run: ../scripts/install-solana-ci.sh
run: ./scripts/install-solana-ci.sh

Workflow steps by default run from the root.


- name: Test Relay Interfaces
run: |
set -eoux pipefail
# compile artifacts
solana-keygen new -o id.json --no-bip39-passphrase
docker run -v "$(pwd)/../":/repo chainlink-solana:build bash -c "\
set -eoux pipefail &&\
RUSTUP_HOME=\"/root/.rustup\" &&\
FORCE_COLOR=1 &&\
cd /repo/contracts &&\
anchor build"
cd ..
make test_relay_integration
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ test_smoke:
cd ./integration-tests &&\
SELECTED_NETWORKS=SIMULATED go test -timeout 24h -count=1 -json $(args) -run TestSolanaOCRV2Smoke ./smoke 2>&1 | tee /tmp/gotest.log | gotestloghelper -json -tlogprefix -singlepackage -color

test_relay_integration:
cd ./integration-tests &&\
go test -timeout 20m -count=1 -json $(args) ./relayinterface/... 2>&1 | tee /tmp/gotest.log | gotestloghelper -json -tlogprefix -singlepackage -color

.PHONY: gomods
gomods: ## Install gomods
go install github.com/jmank88/[email protected]
Expand Down
1 change: 1 addition & 0 deletions contracts/Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ test = "pnpm run test"

[programs.localnet]
access_controller = "9xi644bRR8birboDGdTiwBq3C7VEeR7VuamRYYXCubUW"
contract-reader-interface = "6AfuXF6HapDUhQfE4nQG9C1SGtA1YjP3icaJyRfU4RyE"
log-read-test = "J1zQwrBNBngz26jRPNWsUSZMHJwBwpkoDitXRV95LdK4"
ocr_2 = "cjg3oHmg9uuPsP8D6g29NWvhySJkdYdAo9D25PRbKXJ" # need to rename the idl to satisfy anchor.js...
store = "HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny"
7 changes: 7 additions & 0 deletions contracts/Cargo.lock

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

188 changes: 188 additions & 0 deletions contracts/generated/contract_reader_interface/Initialize.go

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

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

Loading
Loading