From c25b4c0a387bc19cbc21763ed721dd0674557aca Mon Sep 17 00:00:00 2001 From: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Date: Mon, 9 Oct 2023 10:05:18 +0200 Subject: [PATCH] docs: Add more details to the test framework README (#1343) * Add more details to the test framework README * Add regnerate_traces file * Add make target for e2e traces * Remove regenerate-traces script --- Makefile | 7 +++++++ tests/e2e/README.md | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 516db825bd..a614e3bea0 100644 --- a/Makefile +++ b/Makefile @@ -183,3 +183,10 @@ build-docs: @cd docs && ./build.sh .PHONY: build-docs + +############################################################################### +### Test Traces ### +############################################################################### + +e2e-traces: + cd tests/e2e; go test -timeout 30s -run ^TestWriteExamples -v \ No newline at end of file diff --git a/tests/e2e/README.md b/tests/e2e/README.md index ee9c962651..4fb3e721e8 100644 --- a/tests/e2e/README.md +++ b/tests/e2e/README.md @@ -10,4 +10,15 @@ If the chain state from `state.go` is modified, the `ChainStateWithProposalTypes When adding a new proposal type: * add a case for your proposal type to `json_utils.go/UnmarshalProposalWithType` -* add a generator for your proposal type in `state_rapid_test.go` and add it to the `GetProposalGen` function \ No newline at end of file +* add a generator for your proposal type in `state_rapid_test.go` and add it to the `GetProposalGen` function + +## Regenerating Traces + +The traces in `tracehandler_testdata` are generated by the test `trace_handlers_test.go/TestWriteExamples`. + +You can regenerate them by running `make e2e-traces` in the root of the repo. + +## Running against traces + +To run a test trace in the e2e tests, run `go run . --test-file $TRACEFILE::$TESTCONFIG`. +See `--help` for more details.