Skip to content

Commit 80f5097

Browse files
committed
feat(op-acceptance-tests): add more sysgo tests.
1 parent 98d1efe commit 80f5097

File tree

4 files changed

+118
-44
lines changed

4 files changed

+118
-44
lines changed

.circleci/config.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,7 @@ jobs:
11851185
description: The gate to run the acceptance tests against. This gate should be defined in op-acceptance-tests/acceptance-tests.yaml.
11861186
type: string
11871187
default: ""
1188+
11881189
no_output_timeout:
11891190
description: Timeout for when CircleCI kills the job if there's no output
11901191
type: string
@@ -1256,15 +1257,19 @@ jobs:
12561257
command: go test -v -c -o /dev/null $(go list -f '{{if .TestGoFiles}}{{.ImportPath}}{{end}}' ./tests/...)
12571258
# Run the acceptance tests (if the devnet is running)
12581259
- run:
1259-
name: Run acceptance tests (gate=<<parameters.gate>>)
1260+
name: Run acceptance tests
12601261
working_directory: op-acceptance-tests
12611262
no_output_timeout: 1h
12621263
environment:
12631264
GOFLAGS: "-mod=mod"
12641265
GO111MODULE: "on"
12651266
GOGC: "0"
12661267
command: |
1267-
# Run the tests
1268+
if [[ "<<parameters.gate>>" == "" ]]; then
1269+
echo "Running in gateless mode - auto-discovering all tests in ./op-acceptance-tests/..."
1270+
else
1271+
echo "Running in gate mode (gate=<<parameters.gate>>)"
1272+
fi
12681273
LOG_LEVEL=debug just acceptance-test "<<parameters.devnet>>" "<<parameters.gate>>"
12691274
- run:
12701275
name: Print results (summary)
@@ -2349,7 +2354,7 @@ workflows:
23492354
- cannon-prestate-quick: # needed for sysgo tests
23502355
context:
23512356
- circleci-repo-readonly-authenticated-github-token
2352-
# IN-PROCESS (base)
2357+
# IN-MEMORY (base)
23532358
- op-acceptance-tests:
23542359
# Acceptance Testing params
23552360
name: memory-base
@@ -2362,6 +2367,17 @@ workflows:
23622367
requires:
23632368
- contracts-bedrock-build
23642369
- cannon-prestate-quick
2370+
# IN-MEMORY (all)
2371+
- op-acceptance-tests:
2372+
name: memory-all
2373+
gate: "" # Empty gate = gateless mode
2374+
no_output_timeout: 60m
2375+
context:
2376+
- circleci-repo-readonly-authenticated-github-token
2377+
- discord
2378+
requires:
2379+
- contracts-bedrock-build
2380+
- cannon-prestate-quick
23652381
# KURTOSIS (Simple)
23662382
- op-acceptance-tests:
23672383
# Acceptance Testing params
@@ -2414,7 +2430,7 @@ workflows:
24142430
- cannon-prestate-quick: # needed for sysgo tests
24152431
context:
24162432
- circleci-repo-readonly-authenticated-github-token
2417-
# IN-PROCESS (base)
2433+
# IN-MEMORY (base)
24182434
- op-acceptance-tests:
24192435
# Acceptance Testing params
24202436
name: memory-base
@@ -2427,6 +2443,17 @@ workflows:
24272443
requires:
24282444
- contracts-bedrock-build
24292445
- cannon-prestate-quick
2446+
# IN-MEMORY (all)
2447+
- op-acceptance-tests:
2448+
name: memory-all
2449+
gate: "" # Empty gate = gateless mode
2450+
no_output_timeout: 60m
2451+
context:
2452+
- circleci-repo-readonly-authenticated-github-token
2453+
- discord
2454+
requires:
2455+
- contracts-bedrock-build
2456+
- cannon-prestate-quick
24302457
# KURTOSIS (Simple)
24312458
- op-acceptance-tests:
24322459
# Acceptance Testing params

mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ anvil = "1.1.0"
3838
codecov-uploader = "0.8.0"
3939
goreleaser-pro = "2.3.2-pro"
4040
kurtosis = "1.8.1"
41-
op-acceptor = "op-acceptor/v1.1.1"
41+
op-acceptor = "op-acceptor/v2.0.0"
4242

4343
# Fake dependencies
4444
# Put things here if you need to track versions of tools or projects that can't

op-acceptance-tests/README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ For rapid test development, use in-process testing:
9696

9797
```bash
9898
cd op-acceptance-tests
99-
just acceptance-test "" base # Uses sysgo orchestrator - faster!
99+
# Not providing a network uses the sysgo orchestrator (in-memory network) which is faster and easier to iterate with.
100+
just acceptance-test "" base
100101
```
101102

102103
### Testing Against External Devnets
@@ -163,8 +164,25 @@ To add new acceptance tests:
163164
package: github.com/ethereum-optimism/optimism/your/package/path
164165
```
165166
167+
### Quick Development
168+
169+
For rapid development and testing:
170+
171+
```bash
172+
cd op-acceptance-tests
173+
174+
# Run all tests (sysgo gateless mode) - most comprehensive coverage
175+
just acceptance-test "" ""
176+
177+
# Run specific gate-based tests (traditional mode)
178+
just acceptance-test "" base # In-process (sysgo) with gate
179+
just acceptance-test simple base # External devnet (sysext) with gate
180+
```
181+
182+
Using an empty gate (`""`) triggers gateless mode with the sysgo orchestrator, auto-discovering all tests.
183+
166184
## Further Information
167185

168186
For more details about `op-acceptor` and the acceptance testing process, refer to the main documentation or ask the team for guidance.
169187

170-
The source code for `op-acceptor` is available at [github.com/ethereum-optimism/infra/op-acceptor](https://github.com/ethereum-optimism/infra/tree/main/op-acceptor). If you discover any bugs or have feature requests, please open an issue in that repository.
188+
The source code for `op-acceptor` is available at [github.com/ethereum-optimism/infra/op-acceptor](https://github.com/ethereum-optimism/infra/tree/main/op-acceptor). If you discover any bugs or have feature requests, please open an issue in that repository.

op-acceptance-tests/justfile

Lines changed: 66 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ ACCEPTOR_IMAGE := env_var_or_default("ACCEPTOR_IMAGE", DOCKER_REGISTRY + "/op-ac
88
default:
99
@just acceptance-test simple base
1010

11+
12+
1113
holocene:
1214
@just acceptance-test simple holocene
1315

@@ -19,27 +21,27 @@ interop:
1921

2022

2123
# Run acceptance tests with mise-managed binary
24+
# Usage: just acceptance-test [devnet] [gate]
25+
# Examples:
26+
# just acceptance-test simple base # External devnet with specific gate
27+
# just acceptance-test "" base # In-process (sysgo) with specific gate
28+
# just acceptance-test "" "" # In-process gateless mode (all tests)
2229
acceptance-test devnet="" gate="holocene":
2330
#!/usr/bin/env bash
2431
set -euo pipefail
2532

26-
# Check if mise is installed
27-
if command -v mise >/dev/null; then
28-
echo "mise is installed"
29-
else
30-
echo "Mise not installed, falling back to Docker..."
31-
just acceptance-test-docker {{devnet}} {{gate}}
32-
fi
33-
34-
if [[ "{{devnet}}" == "" ]]; then
35-
echo -e "DEVNET: in-memory, GATE: {{gate}}\n"
33+
# Determine if we're running in gateless mode (empty gate = gateless)
34+
GATELESS_MODE=false
35+
if [[ "{{gate}}" == "" ]]; then
36+
GATELESS_MODE=true
37+
echo -e "DEVNET: in-memory (sysgo), MODE: gateless (all tests)\n"
38+
elif [[ "{{devnet}}" == "" ]]; then
39+
echo -e "DEVNET: in-memory (sysgo), GATE: {{gate}}\n"
3640
else
37-
echo -e "DEVNET: {{devnet}}, GATE: {{gate}}\n"
41+
echo -e "DEVNET: {{devnet}} (sysext), GATE: {{gate}}\n"
3842
fi
3943

40-
# For sysgo orchestrator (in-process testing) ensure:
41-
# - contracts are built
42-
# - cannon dependencies are built
44+
# For sysgo orchestrator (in-process testing) ensure dependencies are built
4345
# Note: build contracts only if not in CI (CI jobs already take care of this)
4446
if [[ "{{devnet}}" == "" && -z "${CIRCLECI:-}" ]]; then
4547
echo "Building contracts (local build)..."
@@ -63,6 +65,19 @@ acceptance-test devnet="" gate="holocene":
6365
fi
6466
fi
6567

68+
cd {{REPO_ROOT}}/op-acceptance-tests
69+
70+
71+
# Gate mode: use existing gate-based approach
72+
# Check if mise is installed
73+
if command -v mise >/dev/null; then
74+
echo "mise is installed"
75+
else
76+
echo "Mise not installed, falling back to Docker..."
77+
just acceptance-test-docker {{devnet}} {{gate}}
78+
exit 0
79+
fi
80+
6681
# Try to install op-acceptor using mise
6782
if ! mise install op-acceptor; then
6883
echo "WARNING: Failed to install op-acceptor with mise, falling back to Docker..."
@@ -74,31 +89,45 @@ acceptance-test devnet="" gate="holocene":
7489
BINARY_PATH=$(mise which op-acceptor)
7590
echo "Using mise-managed binary: $BINARY_PATH"
7691

77-
# Build the command with conditional parameters
78-
CMD_ARGS=(
79-
"go" "run" "cmd/main.go"
80-
"--gate" "{{gate}}"
81-
"--testdir" "{{REPO_ROOT}}"
82-
"--validators" "./acceptance-tests.yaml"
83-
"--log.level" "${LOG_LEVEL:-info}"
84-
"--acceptor" "$BINARY_PATH"
85-
)
86-
87-
# Set orchestrator and devnet based on input
88-
if [[ "{{devnet}}" == "" ]]; then
89-
# In-process testing
90-
CMD_ARGS+=("--orchestrator" "sysgo")
92+
if [[ "$GATELESS_MODE" == "true" ]]; then
93+
# Gateless mode: auto-discover all tests within a directory
94+
echo "Running gateless mode - auto-discovering all tests in ./op-acceptance-tests/..."
95+
96+
# (Temporarily) allow skips
97+
op-acceptor \
98+
--testdir {{REPO_ROOT}}/op-acceptance-tests/... \
99+
--orchestrator sysgo \
100+
--allow-skips \
101+
--timeout 90m \
102+
--log.level "${LOG_LEVEL:-info}"
91103
else
92-
# External devnet testing
93-
CMD_ARGS+=("--orchestrator" "sysext")
94-
CMD_ARGS+=("--devnet" "{{devnet}}")
95-
# Include kurtosis-dir for devnet deployment
96-
CMD_ARGS+=("--kurtosis-dir" "{{KURTOSIS_DIR}}")
97-
fi
104+
# Gate mode: use a gate-based testing approach
105+
106+
# Build the command with conditional parameters
107+
CMD_ARGS=(
108+
"go" "run" "cmd/main.go"
109+
"--gate" "{{gate}}"
110+
"--testdir" "{{REPO_ROOT}}"
111+
"--validators" "./acceptance-tests.yaml"
112+
"--log.level" "${LOG_LEVEL:-info}"
113+
"--acceptor" "$BINARY_PATH"
114+
)
115+
116+
# Set orchestrator and devnet based on input
117+
if [[ "{{devnet}}" == "" ]]; then
118+
# In-process testing
119+
CMD_ARGS+=("--orchestrator" "sysgo")
120+
else
121+
# External devnet testing
122+
CMD_ARGS+=("--orchestrator" "sysext")
123+
CMD_ARGS+=("--devnet" "{{devnet}}")
124+
# Include kurtosis-dir for devnet deployment
125+
CMD_ARGS+=("--kurtosis-dir" "{{KURTOSIS_DIR}}")
126+
fi
98127

99-
# Execute the command
100-
cd {{REPO_ROOT}}/op-acceptance-tests
101-
"${CMD_ARGS[@]}"
128+
# Execute the command
129+
"${CMD_ARGS[@]}"
130+
fi
102131

103132

104133
# Run acceptance tests against a devnet using Docker (fallback if needed)

0 commit comments

Comments
 (0)