Skip to content

Commit

Permalink
chore: Add a stub of an E2E test
Browse files Browse the repository at this point in the history
  • Loading branch information
janjakubnanista committed Jan 27, 2025
1 parent fe19560 commit 815c4fb
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/e2e/tests/assets/kurtosis_args_isthmus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ethereum_package:
participants:
- el_type: reth
cl_type: lighthouse
optimism_package:
op_contract_deployer_params:
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-deployer:v0.0.11
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"
33 changes: 33 additions & 0 deletions test/e2e/tests/isthmus.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
setup() {
load "../lib/bats-support/load.bash"
load "../lib/bats-assert/load.bash"
}

teardown() {

}

@test "should have isthmus time if isthmus_time_offset is configured" {
local ENCLAVE_ID=op-isthmus--001

# First we start the enclave
run kurtosis run --enclave $ENCLAVE_ID . --args-file test/e2e/tests/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
}

0 comments on commit 815c4fb

Please sign in to comment.