Commit 2ec6f8fc authored by Adrian Sutton's avatar Adrian Sutton

op-e2e: Disable cannon tests for external geth

Moves choice of running cannon tests to a separate env var rather so it is possible to run cannon tests with HTTP when desired.
parent bb83c60c
...@@ -772,6 +772,10 @@ jobs: ...@@ -772,6 +772,10 @@ jobs:
target: target:
description: The make target to execute description: The make target to execute
type: string type: string
cannon_enabled:
description: Whether to include cannon tests
default: true
type: boolean
docker: docker:
- image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest - image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
resource_class: xlarge resource_class: xlarge
...@@ -797,7 +801,8 @@ jobs: ...@@ -797,7 +801,8 @@ jobs:
command: go tool dist list | grep mips command: go tool dist list | grep mips
- run: - run:
name: run tests name: run tests
command: command: |
export OP_E2E_CANNON_ENABLED="<<parameters.cannon_enabled>>"
# Note: We don't use circle CI test splits because we need to split by test name, not by package. There is an additional # Note: We don't use circle CI test splits because we need to split by test name, not by package. There is an additional
# constraint that gotestsum does not currently (nor likely will) accept files from different pacakges when building. # constraint that gotestsum does not currently (nor likely will) accept files from different pacakges when building.
JUNIT_FILE=/tmp/test-results/<<parameters.module>>_<<parameters.target>>.xml make <<parameters.target>> JUNIT_FILE=/tmp/test-results/<<parameters.module>>_<<parameters.target>>.xml make <<parameters.target>>
...@@ -1361,6 +1366,7 @@ workflows: ...@@ -1361,6 +1366,7 @@ workflows:
name: op-e2e-HTTP-tests name: op-e2e-HTTP-tests
module: op-e2e module: op-e2e
target: test-http target: test-http
cannon_enabled: false
requires: requires:
- op-stack-go-lint - op-stack-go-lint
- devnet-allocs - devnet-allocs
...@@ -1368,6 +1374,7 @@ workflows: ...@@ -1368,6 +1374,7 @@ workflows:
name: op-e2e-ext-geth-tests name: op-e2e-ext-geth-tests
module: op-e2e module: op-e2e
target: test-external-geth target: test-external-geth
cannon_enabled: false
requires: requires:
- op-stack-go-lint - op-stack-go-lint
- devnet-allocs - devnet-allocs
......
...@@ -18,7 +18,7 @@ import ( ...@@ -18,7 +18,7 @@ import (
) )
func TestMultipleCannonGames(t *testing.T) { func TestMultipleCannonGames(t *testing.T) {
InitParallel(t, SkipIfHTTP) InitParallel(t, UsesCannon)
ctx := context.Background() ctx := context.Background()
sys, l1Client := startFaultDisputeSystem(t) sys, l1Client := startFaultDisputeSystem(t)
...@@ -78,7 +78,7 @@ func TestMultipleCannonGames(t *testing.T) { ...@@ -78,7 +78,7 @@ func TestMultipleCannonGames(t *testing.T) {
} }
func TestMultipleGameTypes(t *testing.T) { func TestMultipleGameTypes(t *testing.T) {
InitParallel(t, SkipIfHTTP) InitParallel(t, UsesCannon)
ctx := context.Background() ctx := context.Background()
sys, l1Client := startFaultDisputeSystem(t) sys, l1Client := startFaultDisputeSystem(t)
...@@ -277,7 +277,7 @@ func TestChallengerCompleteExhaustiveDisputeGame(t *testing.T) { ...@@ -277,7 +277,7 @@ func TestChallengerCompleteExhaustiveDisputeGame(t *testing.T) {
} }
func TestCannonDisputeGame(t *testing.T) { func TestCannonDisputeGame(t *testing.T) {
InitParallel(t, SkipIfHTTP) InitParallel(t, UsesCannon)
tests := []struct { tests := []struct {
name string name string
...@@ -328,7 +328,7 @@ func TestCannonDisputeGame(t *testing.T) { ...@@ -328,7 +328,7 @@ func TestCannonDisputeGame(t *testing.T) {
} }
func TestCannonDefendStep(t *testing.T) { func TestCannonDefendStep(t *testing.T) {
InitParallel(t, SkipIfHTTP) InitParallel(t, UsesCannon)
ctx := context.Background() ctx := context.Background()
sys, l1Client := startFaultDisputeSystem(t) sys, l1Client := startFaultDisputeSystem(t)
...@@ -370,7 +370,7 @@ func TestCannonDefendStep(t *testing.T) { ...@@ -370,7 +370,7 @@ func TestCannonDefendStep(t *testing.T) {
} }
func TestCannonProposedOutputRootInvalid(t *testing.T) { func TestCannonProposedOutputRootInvalid(t *testing.T) {
InitParallel(t, SkipIfHTTP) InitParallel(t, UsesCannon)
// honestStepsFail attempts to perform both an attack and defend step using the correct trace. // honestStepsFail attempts to perform both an attack and defend step using the correct trace.
honestStepsFail := func(ctx context.Context, game *disputegame.CannonGameHelper, correctTrace *disputegame.HonestHelper, parentClaimIdx int64) { honestStepsFail := func(ctx context.Context, game *disputegame.CannonGameHelper, correctTrace *disputegame.HonestHelper, parentClaimIdx int64) {
// Attack step should fail // Attack step should fail
...@@ -448,7 +448,7 @@ func TestCannonProposedOutputRootInvalid(t *testing.T) { ...@@ -448,7 +448,7 @@ func TestCannonProposedOutputRootInvalid(t *testing.T) {
} }
func TestCannonPoisonedPostState(t *testing.T) { func TestCannonPoisonedPostState(t *testing.T) {
InitParallel(t, SkipIfHTTP) InitParallel(t, UsesCannon)
ctx := context.Background() ctx := context.Background()
sys, l1Client := startFaultDisputeSystem(t) sys, l1Client := startFaultDisputeSystem(t)
...@@ -558,7 +558,7 @@ func setupDisputeGameForInvalidOutputRoot(t *testing.T, outputRoot common.Hash) ...@@ -558,7 +558,7 @@ func setupDisputeGameForInvalidOutputRoot(t *testing.T, outputRoot common.Hash)
} }
func TestCannonChallengeWithCorrectRoot(t *testing.T) { func TestCannonChallengeWithCorrectRoot(t *testing.T) {
InitParallel(t, SkipIfHTTP) InitParallel(t, UsesCannon)
ctx := context.Background() ctx := context.Background()
sys, l1Client := startFaultDisputeSystem(t) sys, l1Client := startFaultDisputeSystem(t)
......
...@@ -17,8 +17,8 @@ func InitParallel(t *testing.T, opts ...func(t *testing.T)) { ...@@ -17,8 +17,8 @@ func InitParallel(t *testing.T, opts ...func(t *testing.T)) {
} }
} }
func SkipIfHTTP(t *testing.T) { func UsesCannon(t *testing.T) {
if UseHTTP() { if os.Getenv("OP_E2E_CANNON_ENABLED") == "false" {
t.Skip("Skipping test because HTTP connection is in use") t.Skip("Skipping cannon test")
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment