Skip to content

Commit

Permalink
more fixes to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anupsv committed Sep 17, 2024
1 parent 1be6eb1 commit 933aa34
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions e2e/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ func TestOptimismClientWithGenericCommitment(t *testing.T) {
}

func TestProxyClient(t *testing.T) {

Check failure on line 109 in e2e/server_test.go

View workflow job for this annotation

GitHub Actions / Linter

TestProxyClient's subtests should call t.Parallel (tparallel)
if !runIntegrationTests && !runTestnetIntegrationTests {
t.Skip("Skipping test as INTEGRATION or TESTNET env var not set")
}
//if !runIntegrationTests && !runTestnetIntegrationTests {

Check failure on line 110 in e2e/server_test.go

View workflow job for this annotation

GitHub Actions / Linter

commentFormatting: put a space between `//` and comment text (gocritic)
// t.Skip("Skipping test as INTEGRATION or TESTNET env var not set")
//}

t.Parallel()

Expand Down Expand Up @@ -146,13 +146,11 @@ func TestProxyClient(t *testing.T) {
t.Log("Setting input data on proxy server...")
_, err := daClient.SetData(ts.Ctx, testPreimage)
require.NoError(t, err)
assert.True(t, !isPanic(err.Error()))

testPreimage = []byte("§") // Empty preimage
t.Log("Setting input data on proxy server...")
_, err = daClient.SetData(ts.Ctx, testPreimage)
require.NoError(t, err)
assert.True(t, !isPanic(err.Error()))

})

Expand All @@ -161,22 +159,20 @@ func TestProxyClient(t *testing.T) {
t.Log("Setting input data on proxy server...")
_, err := daClient.SetData(ts.Ctx, testPreimage)
require.NoError(t, err)
assert.True(t, !isPanic(err.Error()))
})

t.Run("get data edge cases", func(t *testing.T) {
testCert := []byte("")
_, err := daClient.GetData(ts.Ctx, testCert)
require.Error(t, err)
assert.True(t, strings.Contains(err.Error(),
"received error response, code=400, msg = commitment is empty") && !isPanic(err.Error()))
"commitment is too short") && !isPanic(err.Error()))

testCert = []byte{1}
_, err = daClient.GetData(ts.Ctx, testCert)
require.Error(t, err)
assert.True(t, strings.Contains(err.Error(),
"received error response, code=500, msg = failed to decode DA cert to RLP format: EOF") &&
!isPanic(err.Error()))
"commitment is too short") && !isPanic(err.Error()))

testCert = []byte(e2e.RandString(10000))
_, err = daClient.GetData(ts.Ctx, testCert)
Expand Down

0 comments on commit 933aa34

Please sign in to comment.