From 1f8bb74bba0523aacdb76ed140339c48078c669b Mon Sep 17 00:00:00 2001 From: Sam Kleinman Date: Fri, 3 Sep 2021 13:25:36 -0400 Subject: [PATCH] e2e: skip assertions for stateless nodes (#6894) --- test/e2e/tests/app_test.go | 12 ------------ test/e2e/tests/block_test.go | 8 -------- test/e2e/tests/e2e_test.go | 10 ++++++++-- test/e2e/tests/net_test.go | 5 ----- test/e2e/tests/validator_test.go | 4 ---- 5 files changed, 8 insertions(+), 31 deletions(-) diff --git a/test/e2e/tests/app_test.go b/test/e2e/tests/app_test.go index 08710f168..be273526e 100644 --- a/test/e2e/tests/app_test.go +++ b/test/e2e/tests/app_test.go @@ -17,9 +17,6 @@ import ( // Tests that any initial state given in genesis has made it into the app. func TestApp_InitialState(t *testing.T) { testNode(t, func(t *testing.T, node e2e.Node) { - if node.Stateless() { - return - } if len(node.Testnet.InitialState) == 0 { return } @@ -39,10 +36,6 @@ func TestApp_InitialState(t *testing.T) { // block and the node sync status. func TestApp_Hash(t *testing.T) { testNode(t, func(t *testing.T, node e2e.Node) { - if node.Mode == e2e.ModeSeed { - return - } - client, err := node.Client() require.NoError(t, err) info, err := client.ABCIInfo(ctx) @@ -64,10 +57,6 @@ func TestApp_Hash(t *testing.T) { // Tests that we can set a value and retrieve it. func TestApp_Tx(t *testing.T) { testNode(t, func(t *testing.T, node e2e.Node) { - if node.Mode == e2e.ModeSeed { - return - } - client, err := node.Client() require.NoError(t, err) @@ -104,6 +93,5 @@ func TestApp_Tx(t *testing.T) { require.NoError(t, err) assert.Equal(t, key, string(abciResp.Response.Key)) assert.Equal(t, value, string(abciResp.Response.Value)) - }) } diff --git a/test/e2e/tests/block_test.go b/test/e2e/tests/block_test.go index 66a88bb78..f83cf3757 100644 --- a/test/e2e/tests/block_test.go +++ b/test/e2e/tests/block_test.go @@ -13,10 +13,6 @@ import ( func TestBlock_Header(t *testing.T) { blocks := fetchBlockChain(t) testNode(t, func(t *testing.T, node e2e.Node) { - if node.Mode == e2e.ModeSeed { - return - } - client, err := node.Client() require.NoError(t, err) status, err := client.Status(ctx) @@ -55,10 +51,6 @@ func TestBlock_Header(t *testing.T) { // Tests that the node contains the expected block range. func TestBlock_Range(t *testing.T) { testNode(t, func(t *testing.T, node e2e.Node) { - if node.Mode == e2e.ModeSeed { - return - } - client, err := node.Client() require.NoError(t, err) status, err := client.Status(ctx) diff --git a/test/e2e/tests/e2e_test.go b/test/e2e/tests/e2e_test.go index 15c747b5b..79bd26bd7 100644 --- a/test/e2e/tests/e2e_test.go +++ b/test/e2e/tests/e2e_test.go @@ -30,8 +30,9 @@ var ( blocksCacheMtx = sync.Mutex{} ) -// testNode runs tests for testnet nodes. The callback function is given a -// single node to test, running as a subtest in parallel with other subtests. +// testNode runs tests for testnet nodes. The callback function is +// given a single stateful node to test, running as a subtest in +// parallel with other subtests. // // The testnet manifest must be given as the envvar E2E_MANIFEST. If not set, // these tests are skipped so that they're not picked up during normal unit @@ -51,6 +52,11 @@ func testNode(t *testing.T, testFunc func(*testing.T, e2e.Node)) { for _, node := range nodes { node := *node + + if node.Stateless() { + continue + } + t.Run(node.Name, func(t *testing.T) { t.Parallel() testFunc(t, node) diff --git a/test/e2e/tests/net_test.go b/test/e2e/tests/net_test.go index 8d331aff9..e6ff27a0e 100644 --- a/test/e2e/tests/net_test.go +++ b/test/e2e/tests/net_test.go @@ -14,11 +14,6 @@ func TestNet_Peers(t *testing.T) { t.SkipNow() testNode(t, func(t *testing.T, node e2e.Node) { - // Seed nodes shouldn't necessarily mesh with the entire network. - if node.Mode == e2e.ModeSeed { - return - } - client, err := node.Client() require.NoError(t, err) netInfo, err := client.NetInfo(ctx) diff --git a/test/e2e/tests/validator_test.go b/test/e2e/tests/validator_test.go index 847a8d388..6e836ff78 100644 --- a/test/e2e/tests/validator_test.go +++ b/test/e2e/tests/validator_test.go @@ -14,10 +14,6 @@ import ( // scheduled validator updates. func TestValidator_Sets(t *testing.T) { testNode(t, func(t *testing.T, node e2e.Node) { - if node.Mode == e2e.ModeSeed { - return - } - client, err := node.Client() require.NoError(t, err) status, err := client.Status(ctx)