Skip to content

Commit

Permalink
ci: fix sims nightly and tests nightly (#1446)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanchristo authored Aug 31, 2022
1 parent 07cc14f commit 91e79f8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ localnet-build-env:
$(MAKE) -C contrib/images regen-env

localnet-build-nodes:
$(DOCKER) run --rm -v $(CURDIR)/.testnets:/data regenledger/regen-env \
$(DOCKER) run --rm -v $(CURDIR)/.testnets:/data regen-ledger/regen-env \
testnet init-files --v 4 -o /data --starting-ip-address 192.168.10.2 --keyring-backend=test
docker-compose up -d

Expand Down
4 changes: 2 additions & 2 deletions contrib/images/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
all: regen-env

regen-env: regen-rmi
docker build --tag regenledger/regen-env -f regen-env/Dockerfile \
docker build --tag regen-ledger/regen-env -f regen-env/Dockerfile \
$(shell git rev-parse --show-toplevel)

regen-rmi:
docker rmi regenledger/regen-env 2>/dev/null; true
docker rmi regen-ledger/regen-env 2>/dev/null; true

.PHONY: all regen-env regen-rmi
26 changes: 17 additions & 9 deletions make/sims.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@

SIM_TEST_DIR = ./app/simulation

empty :=
whitespace := $(empty) $(empty)

# https://github.com/cosmos/tools/blob/master/cmd/runsim/main.go#L32-L40
default_seeds := 1,2,4,7,32,123,124,582,1893,2989,3012,4728,37827,981928,87821, \
891823782,989182,89182391,11,22,44,77,99,2020,3232,123123,124124,582582,18931893, \
29892989,30123012,47284728,7601778,8090485,977367484,491163361,424254581,673398983

JOBS ?= 4
SEED ?= 1
SEEDS ?= # https://github.com/cosmos/tools/blob/master/cmd/runsim/main.go#L32-L40
SEEDS ?= $(subst $(whitespace),$(empty),$(default_seeds))
PERIOD ?= 5
NUM_BLOCKS ?= 100
BLOCK_SIZE ?= 200
Expand All @@ -28,6 +36,12 @@ sim-app:
-NumBlocks=$(NUM_BLOCKS) \
-BlockSize=$(BLOCK_SIZE)

sim-app-multi-seed: runsim
@echo "Running app simulation with multiple seeds..."
@echo "Period=$(PERIOD) NumBlocks=$(NUM_BLOCKS)"
runsim -Jobs=$(JOBS) -SimAppPkg=$(SIM_TEST_DIR) -ExitOnFail -Seeds $(SEEDS) \
$(NUM_BLOCKS) $(PERIOD) TestApp

sim-app-genesis:
@echo "Running app simulation with custom genesis..."
@echo "Seed=$(SEED) Period=$(PERIOD) NumBlocks=$(NUM_BLOCKS) BlockSize=$(BLOCK_SIZE) Genesis=$(GENESIS)"
Expand All @@ -40,13 +54,7 @@ sim-app-genesis:
-BlockSize=$(BLOCK_SIZE) \
-Genesis=$(GENESIS)

sim-app-multi-seed: runsim
@echo "Running app simulation with multiple seeds..."
@echo "Period=$(PERIOD) NumBlocks=$(NUM_BLOCKS)"
runsim -Jobs=$(JOBS) -SimAppPkg=$(SIM_TEST_DIR) -ExitOnFail -Seeds $(SEEDS) \
$(NUM_BLOCKS) $(PERIOD) TestApp

sim-app-multi-seed-genesis: runsim
sim-app-genesis-multi-seed: runsim
@echo "Running app simulation with multiple seeds and custom genesis..."
@echo "Period=$(PERIOD) NumBlocks=$(NUM_BLOCKS) Genesis=$(GENESIS)"
runsim -Jobs=$(JOBS) -SimAppPkg=$(SIM_TEST_DIR) -ExitOnFail -Seeds $(SEEDS) -Genesis=$(GENESIS) \
Expand Down Expand Up @@ -103,6 +111,6 @@ sim-after-import-multi-seed: runsim
runsim -Jobs=$(JOBS) -SimAppPkg=$(SIM_TEST_DIR) -ExitOnFail -Seeds $(SEEDS) \
$(NUM_BLOCKS) $(PERIOD) TestAppAfterImport

.PHONY: runsim sim-app sim-app-genesis sim-app-multi-seed sim-app-multi-seed-genesis \
.PHONY: runsim sim-app sim-app-multi-seed sim-app-genesis sim-app-genesis-multi-seed \
sim-determinism sim-determinism-multi-seed sim-import-export sim-import-export-multi-seed \
sim-after-import sim-after-import-multi-seed

0 comments on commit 91e79f8

Please sign in to comment.