-
Notifications
You must be signed in to change notification settings - Fork 13
feature: e2e regression testing tool #119
Changes from 36 commits
feeee91
8e304f7
238594e
221aa95
18cb797
66b5d96
3fd15cd
0266c41
60568ac
845b110
de9906b
937a593
536b3fa
a0d8faf
750f703
1bdd043
e7db067
87905f6
4464879
ad869e3
3dfeb12
a416c09
8c97c8f
26f5c24
a4d88a3
eb09d95
92ad853
deeec65
997a0d3
85a98f1
5a06766
9fdd47b
56ac08e
417d2f4
80924f7
835a704
62da1f6
aefa1fd
1bbd617
47cdaeb
d4b4f75
1ad0a5f
098fbd5
fa3b13e
2c69a1b
861e7b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Regression Tests - Agglayer | ||
'on': | ||
pull_request: | ||
types: [opened, synchronize] # Trigger on new pull requests and when existing ones are synchronized | ||
branches: | ||
- main | ||
inputs: | ||
bake_time: | ||
description: bake time (minutes) | ||
required: false | ||
default: 20 | ||
jobs: | ||
deploy_devnet: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Clone and build agglayer image locally | ||
run: | | ||
git clone https://github.com/0xPolygon/agglayer.git | ||
cd agglayer | ||
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then | ||
GITHUB_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha) | ||
fi | ||
git checkout $GITHUB_SHA | ||
echo "Containerizing and testing commit: $GITHUB_SHA" | ||
docker compose -f docker/docker-compose.yaml build --no-cache agglayer | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
- name: Clone internal kurtosis-cdk repo | ||
run: | | ||
git clone https://github.com/0xPolygon/kurtosis-cdk.git | ||
cd kurtosis-cdk | ||
git checkout dan/jit_containers | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we going to merge this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup it's not needed anymore. We would just need to install For reference: https://github.com/0xPolygon/kurtosis-cdk/blob/main/.github/workflows/regression-tests.yml#L102-L115 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed! |
||
- name: Install kurtosis | ||
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 | ||
rebelArtists marked this conversation as resolved.
Show resolved
Hide resolved
|
||
kurtosis analytics disable | ||
- name: Deploy CDK devnet on local github runner | ||
run: | | ||
cd kurtosis-cdk | ||
kurtosis run --enclave cdk-v1 --args-file params.yml . | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we use a local params file instead of relying on the version matrix in the kurtosis repo? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file defines the configuration of the entire CDK stack, not just the agglayer. In the context of e2e tests, I think it's interesting to use the kurtosis-cdk configuration file. It allows you to test the agglayer in contact with the latest versions of the other components (because we maintain the tool and we're iterating fast at the moment) and, what's more, you have one less file to maintain. But up to you :) |
||
- name: Monitor and report any potential regressions to CI logs | ||
run: | | ||
bake_time=30 # minutes | ||
end_minute=$((10#$(date +'%M') + bake_time)) | ||
|
||
export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" | ||
INITIAL_STATUS=$(cast rpc zkevm_verifiedBatchNumber 2>/dev/null) | ||
incremented=false | ||
|
||
while [ $(date +'%M') -lt $end_minute ]; do | ||
# Attempt to connect to the service | ||
if STATUS=$(cast rpc zkevm_verifiedBatchNumber 2>/dev/null); then | ||
echo "ZKEVM_VERIFIED_BATCH_NUMBER: $STATUS" | ||
|
||
# Check if STATUS has incremented | ||
if [ "$STATUS" != "$INITIAL_STATUS" ]; then | ||
incremented=true | ||
echo "ZKEVM_VERIFIED_BATCH_NUMBER successfully incremented to $STATUS. Exiting..." | ||
exit 0 | ||
fi | ||
else | ||
echo "Failed to connect, waiting and retrying..." | ||
sleep 60 | ||
continue | ||
fi | ||
sleep 60 | ||
done | ||
|
||
if ! $incremented; then | ||
echo "ZKEVM_VERIFIED_BATCH_NUMBER did not increment. This may indicate chain experienced a regression. Please investigate." | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really needed if the current repo is already agglayer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call! and I think we should build the Docker image using
Dockerfile.release
.https://github.com/0xPolygon/kurtosis-cdk/blob/main/.github/workflows/regression-tests.yml#L52-L56
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, good call