Browse Source

test/e2e: add conceptual overview (#5857)

This should be useful to understand the overall purpose and structure of the end-to-end tests.
pull/5861/head
Erik Grinaker 4 years ago
committed by GitHub
parent
commit
1570d26f84
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 1 deletions
  1. +21
    -1
      test/e2e/README.md

+ 21
- 1
test/e2e/README.md View File

@ -7,7 +7,27 @@ make
./build/runner -f networks/ci.toml
```
This creates and runs a testnet named `ci` under `networks/ci/` (determined by the manifest filename).
This creates and runs a testnet named `ci` under `networks/ci/`.
## Conceptual Overview
End-to-end testnets are used to test Tendermint functionality as a user would use it, by spinning up a set of nodes with various configurations and making sure the nodes and network behave correctly. The background for the E2E test suite is outlined in [RFC-001](https://github.com/tendermint/tendermint/blob/master/docs/rfc/rfc-001-end-to-end-testing.md).
The end-to-end tests can be thought of in this manner:
1. Does a certain (valid!) testnet configuration result in a block-producing network where all nodes eventually reach the latest height?
2. If so, does each node in that network satisfy all invariants specified by the Go E2E tests?
The above should hold for any arbitrary, valid network configuration, and that configuration space should be searched and tested by randomly generating testnets.
A testnet configuration is specified as a TOML testnet manifest (see below). The testnet runner uses the manifest to configure a set of Docker containers and start them in some order. The manifests can be written manually (to test specific configurations) or generated randomly by the testnet generator (to test a wide range of configuration permutations).
When running a testnet, the runner will first start the Docker nodes in some sequence, submit random transactions, and wait for the nodes to come online and the first blocks to be produced. This may involve e.g. waiting for nodes to fast sync and/or state sync. If specified, it will then run any misbehaviors (e.g. double-signing) and perturbations (e.g. killing or disconnecting nodes). It then waits for the testnet to stabilize, with all nodes online and having reached the latest height.
Once the testnet stabilizes, a set of Go end-to-end tests are run against the live testnet to verify network invariants (for example that blocks are identical across nodes). These use the RPC client to interact with the network, and should consider the entire network as a black box (i.e. it should not test any network or node internals, only externally visible behavior via RPC). The tests may use the `testNode()` helper to run parallel tests against each individual testnet node, and/or inspect the full blockchain history via `fetchBlockChain()`.
The tests must take into account the network and/or node configuration, and tolerate that the network is still live and producing blocks. For example, validator tests should only run against nodes that are actually validators, and take into account the node's block retention and/or state sync configuration to not query blocks that don't exist.
## Testnet Manifests


Loading…
Cancel
Save