e2e: skip assertions for stateless nodes (#6894)

This commit is contained in:
Sam Kleinman
2021-09-03 13:25:36 -04:00
committed by GitHub
parent 77615b900f
commit 1f8bb74bba
5 changed files with 8 additions and 31 deletions

View File

@@ -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))
})
}

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)