Files
tendermint/test/e2e/tests/app_test.go
Erik Grinaker a58454e788 test: add end-to-end testing framework (#5435)
Partial fix for #5291. For details, see [README.md](https://github.com/tendermint/tendermint/blob/erik/e2e-tests/test/e2e/README.md) and [RFC-001](https://github.com/tendermint/tendermint/blob/master/docs/rfc/rfc-001-end-to-end-testing.md).

This only includes a single test case under `test/e2e/tests/`, as a proof of concept - additional test cases will be submitted separately. A randomized testnet generator will also be submitted separately, there a currently just a handful of static testnets under `test/e2e/networks/`. This will eventually replace the current P2P tests and run in CI.
2020-10-22 13:36:08 +02:00

31 lines
747 B
Go

package e2e_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
e2e "github.com/tendermint/tendermint/test/e2e/pkg"
)
// 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) {
switch {
case node.Mode == e2e.ModeSeed:
return
case len(node.Testnet.InitialState) == 0:
return
}
client, err := node.Client()
require.NoError(t, err)
for k, v := range node.Testnet.InitialState {
resp, err := client.ABCIQuery(ctx, "", []byte(k))
require.NoError(t, err)
assert.Equal(t, k, string(resp.Response.Key))
assert.Equal(t, v, string(resp.Response.Value))
}
})
}