-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat(test): E2E tests #145
Open
janjakubnanista
wants to merge
18
commits into
ethpandaops:main
Choose a base branch
from
janjakubnanista:jan/op-deployer-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
19f37d2
chore: Add BATS
janjakubnanista 3a70d8f
chore: Add mise
janjakubnanista b68ae86
chore: Add Justfile
janjakubnanista 5a9c3c7
chore: Add E2E tests to the workflow
janjakubnanista 2f45a79
chore: Add a stub of an E2E test
janjakubnanista 37fd80f
chore: Drop the op-deployer version overwrite in E2E test
janjakubnanista c0ed4b9
fix: Drop empty teardown
janjakubnanista e99d91a
chore: Start the engine
janjakubnanista 876c16a
chore: Downgrade kurtosis version
janjakubnanista e4b6ede
chore: Drop unused codecov-cli from mise.toml
janjakubnanista 583541b
chore: Whitespace
janjakubnanista ab4bdb8
chore: Make bats binary nicer
janjakubnanista 9e1b3a8
chore: Add a docs section about mise
janjakubnanista 7275205
chore: Install BATS using mise
janjakubnanista f329d81
chore: Drop bats alias from Justfile
janjakubnanista b75bbce
chore: Drop the bats submodule
janjakubnanista b27f023
chore: Move bats libs
janjakubnanista 9e54fe2
chore: Move tests around
janjakubnanista File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "test/e2e/lib/bats-support"] | ||
path = test/lib/bats-support | ||
url = https://github.com/bats-core/bats-support.git | ||
[submodule "test/e2e/lib/bats-assert"] | ||
path = test/lib/bats-assert | ||
url = https://github.com/bats-core/bats-assert.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test-e2e: | ||
bats test/e2e/**/*.bats |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[tools] | ||
|
||
# Core dependencies | ||
bats = "1.11.1" | ||
jq = "1.7.1" | ||
just = "1.37.0" | ||
"ubi:kurtosis-tech/kurtosis-cli-release-artifacts[exe=kurtosis]" = "1.4.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ethereum_package: | ||
participants: | ||
- el_type: reth | ||
cl_type: lighthouse | ||
optimism_package: | ||
chains: | ||
- network_params: | ||
isthmus_time_offset: 0 | ||
participants: | ||
- el_type: op-geth | ||
el_image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:latest | ||
cl_type: op-node | ||
cl_image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:develop | ||
cl_extra_params: | ||
- "--l1.trustrpc=true" | ||
batcher_params: | ||
extra_params: | ||
- "--throttle-interval=0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
setup() { | ||
load "../../lib/bats-support/load.bash" | ||
load "../../lib/bats-assert/load.bash" | ||
} | ||
|
||
@test "should have isthmus time if isthmus_time_offset is configured" { | ||
local ENCLAVE_ID=op-isthmus--001 | ||
local ARGS_FILE=$BATS_TEST_DIRNAME/assets/kurtosis_args_isthmus.yaml | ||
assert [ -f "$ARGS_FILE" ] | ||
|
||
# First we start the enclave | ||
run kurtosis run --enclave $ENCLAVE_ID . --args-file $BATS_TEST_DIRNAME/assets/kurtosis_args_isthmus.yaml | ||
assert_success | ||
|
||
# We get the UUID of the op-geth service | ||
local OP_GETH_SERVICE_UUID=$(kurtosis enclave inspect $ENCLAVE_ID --full-uuids | grep op-el-1-op-geth-op-node-op-kurtosis | awk '{print $1;}') | ||
assert [ -n "$OP_GETH_SERVICE_UUID" ] | ||
|
||
# Now we find its RPC URL | ||
local OP_GETH_RPC_URL=$(kurtosis service inspect $ENCLAVE_ID $OP_GETH_SERVICE_UUID | grep ' rpc:' | awk '{print $4;}') | ||
assert [ -n "$OP_GETH_RPC_URL" ] | ||
|
||
# We ask the RPC for the node info | ||
local OP_GETH_NODE_INFO_JSON=$(curl -s -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"admin_nodeInfo","params":[],"id":1}' $OP_GETH_RPC_URL) | ||
|
||
# And finally we find the isthmusTime and make sure it's defined | ||
local OP_GETH_ISTHMUS_TIME=$(jq '.result.protocols.eth.config.isthmusTime' <<< $OP_GETH_NODE_INFO_JSON) | ||
assert_equal "$OP_GETH_ISTHMUS_TIME" "0" | ||
|
||
kurtosis enclave rm -f $ENCLAVE_ID | ||
} |
Submodule bats-assert
added at
e2d855
Submodule bats-support
added at
9bf10e
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm worried we might be leaking enclaves if the tests fail.
Should we have "kurtosis enclave add/rm" in setup/teardown functions around the test itself (or at the suite level to save time/resources)?