prysm-pulse/testing/endtoend
Preston Van Loon 943dec525c
Refactor mock test helpers (#10133)
* Delete deploy contract tool. Move mock to its own package as testonly with some helper functions

* gofmt contracts/deposit/mock/mock.go

* move stategen mock.go to its on testonly pkg

* move password_reader_mock.go to mock testonly package

* move mock keymanager to its own testonly package

* move attestations mock

* move voluntaryexits mock

* Move slashings mock to mock pkg

* move the slasher mock

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-01-26 14:48:20 +00:00
..
components Refactor mock test helpers (#10133) 2022-01-26 14:48:20 +00:00
evaluators Use signature length from fieldparams (#10019) 2021-12-15 15:14:30 -05:00
helpers Resolve issues with G304 (#10115) 2022-01-21 16:52:31 +00:00
params Changes to E2E for Optimized Slasher (#9698) 2021-09-30 20:28:14 +00:00
policies Move EndtoEnd Tests to Testing/ Folder (#9586) 2021-09-15 14:42:05 +00:00
types e2e: Add web3signer component (#10088) 2022-01-19 16:22:23 +00:00
BUILD.bazel Refactor mock test helpers (#10133) 2022-01-26 14:48:20 +00:00
deps.bzl e2e: Add web3signer component (#10088) 2022-01-19 16:22:23 +00:00
endtoend_test.go e2e: Add web3signer component (#10088) 2022-01-19 16:22:23 +00:00
geth_deps.go Move EndtoEnd Tests to Testing/ Folder (#9586) 2021-09-15 14:42:05 +00:00
minimal_e2e_test.go e2e: Add web3signer component (#10088) 2022-01-19 16:22:23 +00:00
minimal_slashing_e2e_test.go Changes to E2E for Optimized Slasher (#9698) 2021-09-30 20:28:14 +00:00
README.md e2e: Add web3signer component (#10088) 2022-01-19 16:22:23 +00:00
slasher_simulator_e2e_test.go Refactor mock test helpers (#10133) 2022-01-26 14:48:20 +00:00
web3signer.BUILD e2e: Add web3signer component (#10088) 2022-01-19 16:22:23 +00:00

End-to-end Testing Package

This is the main project folder of the end-to-end testing suite for Prysm. This performs a full end-to-end test for Prysm, including spinning up an ETH1 dev chain, sending deposits to the deposit contract, and making sure the beacon node and its validators are running and performing properly for a few epochs. It also performs a test on a syncing node, and supports featureflags to allow easy E2E testing of experimental features.

How it works

Through the end2EndConfig struct, you can declare several options such as how many epochs the test should run for, and what BeaconConfig the test should use. You can also declare how many beacon nodes and validator clients are run, the E2E will automatically divide the validators evently among the beacon nodes.

In order to "evaluate" the state of the beacon chain while the E2E is running, there are Evaluators that use the beacon chain node API to determine if the network is performing as it should. This can evaluate for conditions like validator activation, finalization, validator participation and more.

Evaluators have 3 parts, the name for it's test name, a policy which declares which epoch(s) the evaluator should run, and then the evaluation which uses the beacon chain API to determine if the beacon chain passes certain conditions like finality.

Current end-to-end tests

  • Minimal Config - 2 beacon nodes, 256 validators, running for 8 epochs
  • Minimal Config Slashing Test - 2 beacon nodes, 256 validators, tests attester and proposer slashing

Instructions

Note: Java 11 or greater is required to run web3signer.

If you wish to run all the minimal spec E2E tests, you can run them through bazel with:

bazel test //testing/endtoend:go_default_test --test_output=streamed