test/

directory
v100.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2024 License: Apache-2.0

README

CometBFT Tests

Unit tests

The unit tests (ie. go test) can be run with make test from the root directory of the repository.

Integration tests

The integration tests can be run with make test_integrations from the root directory of the repository.

Running the integrations test will build a docker container with local version of CometBFT and run the following tests in docker containers:

  • go tests, with --race
    • includes test coverage
  • app tests
    • kvstore app over socket
  • persistence tests
    • crash cometbft at each of many predefined points, restart, and ensure it syncs properly with the app

End-to-end tests

You can run e2e nightly tests locally by running

make -j2 docker generator runner && ./build/generator -g 5 -d networks/nightly/ -p && ./run-multiple.sh networks/nightly/*-group*-*.toml

from the root directory of the repository.

Please refer to the README.MD in the e2e folder for more information.

localnet tests

During development you might need a local network that runs modified code.

  1. Build a linux binary with the code modifications
make build-linux
  1. Run a local network with four nodes
make localnet-start

This command will build a localnet docker image and run it using Docker Compose.

  1. You can send arbitrary transactions on your local network by building and running the loadtime application.
make -C test/loadtime build
test/loadtime/build/load -c 2 --broadcast-tx-method sync -T 1200 --endpoints ws://127.0.0.1:26657/websocket

Refer to the README.md for more information.

  1. You can also monitor your network using Prometheus and Grafana.
make monitoring-start

Refer to the README.md for more information.

Fuzzing

Fuzzing of various system inputs.

See ./fuzz/README.md for more details.

Directories

Path Synopsis
e2e
app
pkg
pkg/grammar/grammar-auto/lexer
Package lexer is generated by GoGLL.
Package lexer is generated by GoGLL.
pkg/grammar/grammar-auto/parser
Package parser is generated by gogll.
Package parser is generated by gogll.
pkg/grammar/grammar-auto/parser/bsr
Package bsr implements a Binary Subtree Representation set as defined in
Package bsr implements a Binary Subtree Representation set as defined in
pkg/grammar/grammar-auto/parser/slot
Package slot is generated by gogll.
Package slot is generated by gogll.
pkg/grammar/grammar-auto/parser/symbols
Package symbols is generated by gogll.
Package symbols is generated by gogll.
pkg/grammar/grammar-auto/sppf
Package sppf implements a Shared Packed Parse Forest as defined in:
Package sppf implements a Shared Packed Parse Forest as defined in:
pkg/grammar/grammar-auto/token
Package token is generated by GoGLL.
Package token is generated by GoGLL.
fuzz
loadtime

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL