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

test: create e2e smoke test flow + use cluster for SP1 proofs #405

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c0e045b
test: create e2e smoke test flow + use cluster for SP1 proofs
gjermundgaraba Mar 13, 2025
fbf87d5
lint
gjermundgaraba Mar 13, 2025
6301d74
Merge branch 'main' into gjermund/e2e-test-improvements
gjermundgaraba Mar 13, 2025
fb38ef2
initial setup 3 e2e workflows
gjermundgaraba Mar 14, 2025
7726fd9
pull out e2e setup
gjermundgaraba Mar 14, 2025
f095c40
test matrix
gjermundgaraba Mar 14, 2025
242c96d
cleanup
gjermundgaraba Mar 14, 2025
d43edb9
ci cleanup
gjermundgaraba Mar 14, 2025
8cf10aa
fix newlines
gjermundgaraba Mar 14, 2025
f21248a
rename to yaml
gjermundgaraba Mar 14, 2025
8544375
Merge remote-tracking branch 'origin/main' into gjermund/e2e-test-imp…
gjermundgaraba Mar 14, 2025
f5a0214
fix checkout
gjermundgaraba Mar 14, 2025
c4fe1fa
single-line matrix output
gjermundgaraba Mar 14, 2025
dc39a2d
pass github pat to e2e setup
gjermundgaraba Mar 14, 2025
b0f88d8
fix matrix script
gjermundgaraba Mar 14, 2025
b4020b1
trying a different approach to the config
gjermundgaraba Mar 15, 2025
bffc470
lint
gjermundgaraba Mar 15, 2025
88b59e2
add missing checkout
gjermundgaraba Mar 15, 2025
3b76a82
fix skip tests
gjermundgaraba Mar 15, 2025
1019cde
more cleanup
gjermundgaraba Mar 16, 2025
44efbe3
fix broken test + stack trace support in relayer
gjermundgaraba Mar 16, 2025
62a896a
Merge remote-tracking branch 'origin/main' into gjermund/e2e-test-imp…
gjermundgaraba Mar 16, 2025
b3d1550
some more cleanups
gjermundgaraba Mar 16, 2025
b098839
remove unused type
gjermundgaraba Mar 16, 2025
29d7d90
cleanup after self-review
gjermundgaraba Mar 16, 2025
e26d03a
ups
gjermundgaraba Mar 16, 2025
571b89c
removed unecessary quotes
gjermundgaraba Mar 17, 2025
883a9a2
code review fixes
gjermundgaraba Mar 17, 2025
a887d2c
Merge remote-tracking branch 'origin/main' into gjermund/e2e-test-imp…
gjermundgaraba Mar 17, 2025
1cdd6b4
push to main run minimal
gjermundgaraba Mar 18, 2025
110a6b1
Merge remote-tracking branch 'origin/main' into gjermund/e2e-test-imp…
gjermundgaraba Mar 18, 2025
dc3c72d
test different tm_client settings
gjermundgaraba Mar 18, 2025
dccb743
Merge remote-tracking branch 'origin/main' into gjermund/e2e-test-imp…
gjermundgaraba Mar 18, 2025
0a7260a
Revert "test different tm_client settings"
gjermundgaraba Mar 18, 2025
f8e1c4e
type safety in sp1 config
gjermundgaraba Mar 18, 2025
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
21 changes: 21 additions & 0 deletions .github/actions/e2e-test-matrix/action.yml
Copy link
Member

Choose a reason for hiding this comment

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

Why is this in a separate directory called e2e-test-matrix/? Each action is to have its own dir? If you want to separate these into dirs, just use .github/actions/e2e/ imo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just how github actions are structured. There is one folder per action with a file called action.yml in it.

Copy link
Member

Choose a reason for hiding this comment

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

I see. I really don't like how this turned out. I almost rather prefer we keep what we have now (e2e.yml) and rename it to e2e-minimal.yml (which supports both pow mock and minimal pos like today). And just add a new e2e-full.yml with full code duplication from e2e-minimal.yml but only it runs on pos + mainnet. (And not on every PR). Wdyt?

I'm fine with you moving the setup action though. But this is super confusing now as we have 3 directories and two of them have different types of setup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd rather not duplicate this. Would naming this differently help? Like install-e2e-deps? It seems like this should be solvable with naming. Got any ideas?

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: e2e-test-matrix
description: 'Dynamically discovers and generates a test matrix for e2e tests'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To avoid having to specify every test every time.
Instead there is now a skip-list, which will be much shorter and easier to maintain

Copy link
Member

Choose a reason for hiding this comment

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

Tbh I actually do like listing. The amount of code added to create the list far exceeds the size of the list by several times, and is significantly harder to read. Likely contains weird edge cases. Why would it be bad to have them listed only in one file such as this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mostly because it's hard to know if any are missing and why. It's easy to miss if a test was not added to the list, and it seems like an unnecessary maintenance burden to keep around.

Copy link
Member

Choose a reason for hiding this comment

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

Now we will never know if a test is missing. I think we can make a practice to add every test we write to the CI lisr, and just have the ones we don't use commented out with a comment explaining why. I don't trust these scripts to not miss some tests eventually. Idk, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can do that of course, but I'd rather have less things to worry about than more - hence the want to reduce the maintenance burden. It's not a big deal, but I do prefer this method which we also use in ibc-go (although there it's a go script). Would you feel more comfortable if it was a go script instead of a bash script?

One possibility is to take the go script from ibc-go, pull it out into a separate repo, clean it up and publish it as an action we can use in both repos (and maybe others could use too)?


inputs:
skip-tests:
description: 'Comma-separated list of tests to skip'
required: false
default: ''

outputs:
matrix:
description: 'JSON string containing the test matrix'
value: ${{ steps.generate-matrix.outputs.matrix }}

runs:
using: "composite"
steps:
- name: Generate Test Matrix
id: generate-matrix
shell: bash
run: echo "matrix=$(${{ github.workspace }}/scripts/generate-e2e-test-matrix.sh '${{ inputs.skip-tests }}')" >> $GITHUB_OUTPUT
61 changes: 61 additions & 0 deletions .github/actions/setup-e2e/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: setup-e2e

inputs:
github_token:
description: 'A Github PAT'
required: true

runs:
using: composite
steps:
- name: "Set up environment"
uses: ./.github/actions/setup

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.23"
check-latest: true
cache-dependency-path: e2e/interchaintestv8/go.sum

- name: "Cache Relayer and Operator"
id: cache-relayer
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/relayer
~/.cargo/bin/operator
key: ${{ runner.os }}-relayer-${{ hashFiles('Cargo.lock', 'packages/**', 'programs/**', 'abi/**') }}

- name: Install SP1 toolchain
if: (steps.cache-relayer.outputs.cache-hit != 'true')
shell: bash
run: |
curl -L https://sp1.succinct.xyz | bash
~/.sp1/bin/sp1up --token ${{ inputs.github_token }}
~/.sp1/bin/cargo-prove prove --version

- name: Install operator
if: steps.cache-relayer.outputs.cache-hit != 'true'
uses: actions-rs/cargo@v1
with:
command: install
args: --bin operator --path programs/operator --locked

- name: Install relayer
if: steps.cache-relayer.outputs.cache-hit != 'true'
uses: actions-rs/cargo@v1
with:
command: install
args: --bin relayer --path programs/relayer --locked

- name: Setup Kurtosis
if: env.ETH_TESTNET_TYPE == 'pos'
shell: bash
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli=1.5.0 # Must match the kurtosis library version we use in the e2e tests
kurtosis engine start
kurtosis analytics disable
echo "$(dirname $(which kurtosis))" >> $GITHUB_PATH
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: setup
runs:
using: composite
steps:
- name: "Check out the repo"
uses: "actions/checkout@v4"
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/abigen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ jobs:
name: "Check for abigen changes"
runs-on: depot-ubuntu-22.04-4
steps:
- name: Checkout sources
uses: actions/checkout@v4

- uses: actions/checkout@v4
- name: "Set up environment"
uses: ./.github/setup
uses: ./.github/actions/setup

- uses: actions/setup-go@v4
with:
Expand All @@ -44,9 +42,7 @@ jobs:
name: lint
runs-on: depot-ubuntu-22.04-4
steps:
- name: Checkout sources
uses: actions/checkout@v4

- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.23"
Expand All @@ -61,9 +57,7 @@ jobs:
test:
runs-on: depot-ubuntu-22.04-4
steps:
- name: Checkout sources
uses: actions/checkout@v4

- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.23"
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
FOUNDRY_ETH_RPC_URL: http://localhost:8545
DEPLOYMENT_ENV: local
steps:
- name: Check out the repo
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: "Set up environment"
uses: ./.github/setup
uses: ./.github/actions/setup

- name: Deploy Anvil
run: |
anvil &
Expand All @@ -35,8 +35,7 @@ jobs:
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Set deployment matrix
id: matrix
run: |
Expand All @@ -50,10 +49,9 @@ jobs:
env:
DEPLOYMENT_ENV: "${{ matrix.env }}"
steps:
- name: Check out the repo
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: "Set up environment"
uses: ./.github/setup
uses: ./.github/actions/setup
- name: Export the RPC URL
run: |
cat deployments/${{ matrix.env }}/${{ matrix.file }} | jq -r ". | \"FOUNDRY_ETH_RPC_URL=\(.rpc_url)\"" >> $GITHUB_ENV
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ jobs:
env:
registry_url: ghcr.io/cosmos/eureka-relayer
steps:
- name: Check out the repo
- uses: actions/checkout@v4
if: github.event_name != 'pull_request'
uses: actions/checkout@v4
- name: Check out the PR commit head
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/e2e-full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: e2e-full
on:
workflow_dispatch:
schedule:
- cron: "0 0 */3 * *" # Run every 3 days at midnight UTC

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
FOUNDRY_PROFILE: ci
ETH_TESTNET_TYPE: pos
SP1_PROVER: network
ETHEREUM_POS_NETWORK_PRESET: mainnet
permissions:
contents: read

jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.get-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- name: Generate Test Matrix
id: get-matrix
uses: ./.github/actions/e2e-test-matrix
with:
skip-tests: 'TestWithRelayerTestSuite/Test_2_ConcurrentRecvPacketToEth_Groth16,TestWithRelayerTestSuite/TestMultiPeriodClientUpdateToCosmos'
Copy link
Member

Choose a reason for hiding this comment

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

Can these be listed properly rather than be comma delimited? Like:

Suggested change
skip-tests: 'TestWithRelayerTestSuite/Test_2_ConcurrentRecvPacketToEth_Groth16,TestWithRelayerTestSuite/TestMultiPeriodClientUpdateToCosmos'
skip-tests:
- 'TestWithRelayerTestSuite/Test_2_ConcurrentRecvPacketToEth_Groth16'
- 'TestWithRelayerTestSuite/TestMultiPeriodClientUpdateToCosmos'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really. There is no list type for input, so it would have to be either comma separated, or like a json array, but again, as a string '["test1", "test2"]'

Copy link
Member

Choose a reason for hiding this comment

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

Oof


e2e:
needs: generate-matrix
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
name: ${{ matrix.test }}
runs-on: depot-ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "Set up E2E environment"
uses: ./.github/actions/setup-e2e
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Run Tests
env:
NETWORK_PRIVATE_KEY: ${{ secrets.SP1_PRIVATE_KEY }}
run: |
cd e2e/interchaintestv8
go test -v -mod=readonly . -run '^${{ matrix.test }}$' -timeout 120m
54 changes: 54 additions & 0 deletions .github/workflows/e2e-pos-minimal.yml
Copy link
Member

Choose a reason for hiding this comment

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

can just be called e2e-minimal.yml imo. We shouldn't add too many words to these imo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason I opted for this, was because I realized the naming got a bit confusing with quick and minimal. By adding pos minimal it is more obvious that it refers to the pos setup being minimal, which is what this one is

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: e2e-pos-minimal
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: "0 3 * * *" # Run daily at 3 AM UTC (outside EU and US work hours)

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
FOUNDRY_PROFILE: ci
ETH_TESTNET_TYPE: pos
SP1_PROVER: network
ETHEREUM_POS_NETWORK_PRESET: minimal
permissions:
contents: read

jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.get-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- name: Generate Test Matrix
id: get-matrix
uses: ./.github/actions/e2e-test-matrix
with:
skip-tests: 'TestWithRelayerTestSuite/Test_2_ConcurrentRecvPacketToEth_Groth16'

e2e:
needs: generate-matrix
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
name: ${{ matrix.test }}
runs-on: depot-ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "Set up E2E environment"
uses: ./.github/actions/setup-e2e
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Run Tests
env:
NETWORK_PRIVATE_KEY: ${{ secrets.SP1_PRIVATE_KEY }}
run: |
cd e2e/interchaintestv8
go test -v -mod=readonly . -run '^${{ matrix.test }}$' -timeout 60m
75 changes: 75 additions & 0 deletions .github/workflows/e2e-quick.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: e2e-quick
on:
Copy link
Member

Choose a reason for hiding this comment

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

should this also run on push to main? Or any of the others such as minimal

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, yeah, I guess it could. Which one would you prefer?

Copy link
Member

Choose a reason for hiding this comment

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

hmm. Probably minimal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

workflow_dispatch:
pull_request:
paths:
- '**.rs'
- '**.go'
- '**.toml'
- '**.lock'
- '**.mod'
- '**.sum'
- '**.sol'
- '.github/workflows/quick-e2e.yml'
- 'bun.lockb'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
FOUNDRY_PROFILE: ci
ETH_TESTNET_TYPE: pow
SP1_PROVER: mock
permissions:
contents: read

jobs:
golangci:
name: lint
runs-on: depot-ubuntu-22.04-4
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.23"
cache-dependency-path: e2e/interchaintestv8/go.sum

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.63
working-directory: e2e/interchaintestv8

generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.get-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- name: Generate Test Matrix
id: get-matrix
uses: ./.github/actions/e2e-test-matrix
with:
skip-tests: 'TestWithRelayerTestSuite/Test_2_ConcurrentRecvPacketToEth_Groth16,TestWithRelayerTestSuite/TestMultiPeriodClientUpdateToCosmos'

e2e:
needs: generate-matrix
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
name: ${{ matrix.test }}
runs-on: depot-ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "Set up E2E environment"
uses: ./.github/actions/setup-e2e
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Run Tests
env:
NETWORK_PRIVATE_KEY: ${{ secrets.SP1_PRIVATE_KEY }}
run: |
cd e2e/interchaintestv8
go test -v -mod=readonly . -run '^${{ matrix.test }}$' -timeout 40m
Loading
Loading