-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* debug sim test * start modifuing for v50 * add sim test v1 * add sim export * move simulation tests to a separate directory * remove unused functions * add comments * enable gov module * enable gov module * fix lint error * add todos for BasicManager * add todos for BasicManager * add cleanup for TestFullAppSimulation * register legacy router * added a doc for simulation testing * undo db close for multi threaded test * add description for tests * remove go module from simulation tests * make basicsmanager private * Update Makefile Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]> * Update changelog.md Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]> * format simulation.md --------- Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>
- Loading branch information
Showing
17 changed files
with
1,032 additions
and
395 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -354,6 +354,61 @@ start-upgrade-import-mainnet-test: zetanode-upgrade | |
export UPGRADE_HEIGHT=225 && \ | ||
cd contrib/localnet/ && ./scripts/import-data.sh mainnet && $(DOCKER_COMPOSE) --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d | ||
|
||
|
||
############################################################################### | ||
### Simulation Tests ### | ||
############################################################################### | ||
|
||
BINDIR ?= $(GOPATH)/bin | ||
SIMAPP = ./tests/simulation | ||
|
||
|
||
# Run sim is a cosmos tool which helps us to run multiple simulations in parallel. | ||
runsim: $(BINDIR)/runsim | ||
$(BINDIR)/runsim: | ||
@echo 'Installing runsim...' | ||
@TEMP_DIR=$$(mktemp -d) && \ | ||
cd $$TEMP_DIR && \ | ||
go install github.com/cosmos/tools/cmd/[email protected] && \ | ||
rm -rf $$TEMP_DIR || (echo 'Failed to install runsim' && exit 1) | ||
@echo 'runsim installed successfully' | ||
|
||
|
||
# Configuration parameters for simulation tests | ||
# NumBlocks: Number of blocks to simulate | ||
# BlockSize: Number of transactions in a block | ||
# Commit: Whether to commit the block or not | ||
# Period: Invariant check period | ||
# Timeout: Timeout for the simulation test | ||
define run-sim-test | ||
@echo "Running $(1)..." | ||
@go test -mod=readonly $(SIMAPP) -run $(2) -Enabled=true \ | ||
-NumBlocks=$(3) -BlockSize=$(4) -Commit=true -Period=0 -v -timeout $(5) | ||
endef | ||
|
||
test-sim-nondeterminism: | ||
$(call run-sim-test,"non-determinism test",TestAppStateDeterminism,100,200,2h) | ||
|
||
test-sim-fullappsimulation: | ||
$(call run-sim-test,"TestFullAppSimulation",TestFullAppSimulation,100,200,2h) | ||
|
||
test-sim-multi-seed-long: runsim | ||
@echo "Running long multi-seed application simulation." | ||
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 500 50 TestFullAppSimulation | ||
|
||
test-sim-multi-seed-short: runsim | ||
@echo "Running short multi-seed application simulation." | ||
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 10 TestFullAppSimulation | ||
|
||
|
||
|
||
.PHONY: \ | ||
test-sim-nondeterminism \ | ||
test-sim-fullappsimulation \ | ||
test-sim-multi-seed-long \ | ||
test-sim-multi-seed-short | ||
|
||
|
||
############################################################################### | ||
### GoReleaser ### | ||
############################################################################### | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.