mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-05 04:55:18 +00:00
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.
31 lines
747 B
Go
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))
|
|
}
|
|
})
|
|
}
|