Skip to content

Commit 9d9728e

Browse files
committed
feat: OP Stack integration test - refactor testing
1 parent 006449a commit 9d9728e

File tree

11 files changed

+43
-154
lines changed

11 files changed

+43
-154
lines changed

.vscode/launch.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Go Test E2E",
9+
"type": "go",
10+
"request": "launch",
11+
"mode": "test",
12+
"program": "${workspaceFolder}/e2e",
13+
"env": {
14+
"OPTIMISM": "true"
15+
},
16+
"args": [
17+
"./e2e/...",
18+
"-deploy-config", "/Users/ethenpociask/eigenlayer/eigenda-proxy/e2e/resources/optimism/devnetL1.json"
19+
]
20+
},
21+
{
22+
"name": "Launch Package",
23+
"type": "go",
24+
"request": "launch",
25+
"mode": "auto",
26+
"program": "${fileDirname}"
27+
}
28+
]
29+
}

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
1212
LDFLAGSSTRING +=-X main.Version=$(VERSION)
1313
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
1414

15-
ALLOCS := e2e/resources/optimism/devnetL1.json
16-
1715
.PHONY: eigenda-proxy
1816
eigenda-proxy:
1917
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/eigenda-proxy ./cmd/server
@@ -30,10 +28,10 @@ clean:
3028

3129
test:
3230
go test -v ./...
33-
go test -timeout 50m -v ./e2e/ -optimism -deploy-config ${ALLOCS}
31+
OPTIMISM=true go test -timeout 50m -v ./e2e/... -deploy-config ../.devnet/devnetL1.json
3432

3533
e2e-test:
36-
go test -timeout 50m -v ./e2e/server_test.go -testnet-integration
34+
TESTNET=true go test -timeout 50m -v ./e2e/server_test.go -testnet-integration
3735

3836
.PHONY: lint
3937
lint:

e2e/main_test.go

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
package e2e_test
22

33
import (
4-
"flag"
54
"os"
65
"testing"
76
)
87

98
var (
10-
optimism bool
11-
runTestnetIntegrationTests bool
9+
runOptimismIntegrationTests bool
10+
runTestnetIntegrationTests bool
1211
)
1312

14-
func init() {
15-
flag.BoolVar(&optimism, "optimism", false, "Run OP Stack integration tests")
16-
flag.BoolVar(&runTestnetIntegrationTests, "testnet-integration", false, "Run testnet-based integration tests")
17-
13+
func ParseEnv() {
14+
runOptimismIntegrationTests = os.Getenv("OPTIMISM") == "true" || os.Getenv("OPTIMISM") == "1"
15+
runTestnetIntegrationTests = os.Getenv("TESTNET") == "true" || os.Getenv("TESTNET") == "1"
1816
}
1917

2018
func TestMain(m *testing.M) {
21-
println("Parsing flags")
22-
flag.Parse()
23-
println("Flags parsed")
24-
19+
ParseEnv()
2520
code := m.Run()
2621
os.Exit(code)
2722
}

e2e/optimism_test.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,6 @@ import (
1313
"github.com/stretchr/testify/require"
1414
)
1515

16-
// var (
17-
// runOptimismIntegrationTests bool
18-
19-
// // deployConfig string
20-
// )
21-
22-
// func init() {
23-
// flag.BoolVar(&runOptimismIntegrationTests, "optimism", false, "Run OP Stack integration tests")
24-
// // flag.StringVar(&deployConfig, "deploy-config", "", "Path to deploy config")
25-
// }
26-
2716
var defaultAlloc = &e2eutils.AllocParams{PrefundTestUsers: true}
2817

2918
// L2PlasmaDA is a test harness for manipulating plasma DA state.
@@ -120,15 +109,15 @@ func (a *L2PlasmaDA) ActL1Finalized(t actions.Testing) {
120109

121110
// TestOptimism ... Creates a new SysTestSuite
122111
func TestOptimism(gt *testing.T) {
123-
println("Optimism ", optimism)
124-
if !optimism {
112+
if !runOptimismIntegrationTests {
125113
gt.Skip("Skipping OP Stack integration test")
126114
}
127115

128116
proxyTS, close := CreateTestSuite(gt, true)
129117
defer close()
130118

131119
t := actions.NewDefaultTesting(gt)
120+
132121
op_stack := NewL2PlasmaDA(t, proxyTS.Address())
133122

134123
// build L1 block #1

e2e/resources/optimism/addresses.json

Lines changed: 0 additions & 36 deletions
This file was deleted.

e2e/resources/optimism/allocs-l1.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

e2e/resources/optimism/allocs-l2-delta.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

e2e/resources/optimism/allocs-l2-ecotone.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

e2e/resources/optimism/allocs-l2.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

e2e/resources/optimism/devnetL1.json

Lines changed: 0 additions & 73 deletions
This file was deleted.

e2e/server_test.go

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,8 @@ import (
1313
"github.com/stretchr/testify/require"
1414
)
1515

16-
// var (
17-
// runTestnetIntegrationTests bool
18-
// )
19-
20-
// func init() {
21-
// flag.BoolVar(&runTestnetIntegrationTests, "testnet-integration", false, "Run testnet-based integration tests")
22-
23-
// }
24-
2516
func TestHoleskyWithPlasmaClient(t *testing.T) {
26-
if !runTestnetIntegrationTests {
17+
if !runTestnetIntegrationTests || runOptimismIntegrationTests {
2718
t.Skip("Skipping testnet integration test")
2819
}
2920

@@ -51,7 +42,7 @@ func TestHoleskyWithPlasmaClient(t *testing.T) {
5142
}
5243

5344
func TestHoleskyWithProxyClient(t *testing.T) {
54-
if !runTestnetIntegrationTests {
45+
if !runTestnetIntegrationTests || runOptimismIntegrationTests {
5546
t.Skip("Skipping testnet integration test")
5647
}
5748

@@ -103,7 +94,7 @@ func TestHoleskyWithProxyClient(t *testing.T) {
10394
}
10495

10596
func TestMemStoreWithPlasmaClient(t *testing.T) {
106-
if runTestnetIntegrationTests {
97+
if runTestnetIntegrationTests || runOptimismIntegrationTests {
10798
t.Skip("Skipping non-testnet integration test")
10899
}
109100

@@ -131,7 +122,7 @@ func TestMemStoreWithPlasmaClient(t *testing.T) {
131122
}
132123

133124
func TestMemStoreWithProxyClient(t *testing.T) {
134-
if runTestnetIntegrationTests {
125+
if runTestnetIntegrationTests || runOptimismIntegrationTests {
135126
t.Skip("Skipping non-testnet integration test")
136127
}
137128

0 commit comments

Comments
 (0)