Skip to content

Commit

Permalink
fix: sim tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NagaTulasi committed Sep 27, 2024
1 parent c2df3e6 commit 3b1d7d4
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 34 deletions.
57 changes: 55 additions & 2 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
push:
branches:
- main

concurrency:
group: ci-${{ github.ref }}-sims
cancel-in-progress: true
Expand All @@ -23,7 +23,7 @@ jobs:
with:
go-version: "1.21"
check-latest: true
- run: make -C simapp build
- run: make build
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/[email protected]
- uses: actions/cache@v3
Expand All @@ -49,6 +49,59 @@ jobs:
run: |
make test-sim-nondeterminism
# test-sim-import-export:
# runs-on: ubuntu-latest
# needs: [build]
# timeout-minutes: 60
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-go@v4
# with:
# go-version: "1.21"
# check-latest: true
# - uses: actions/cache@v3
# with:
# path: ~/go/bin
# key: ${{ runner.os }}-go-runsim-binary
# - name: test-sim-import-export
# run: |
# make test-sim-import-export

# test-sim-after-import:
# runs-on: ubuntu-latest
# needs: [build]
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-go@v4
# with:
# go-version: "1.21"
# check-latest: true
# - uses: actions/cache@v3
# with:
# path: ~/go/bin
# key: ${{ runner.os }}-go-runsim-binary
# - name: test-sim-after-import
# run: |
# make test-sim-after-import

# test-sim-multi-seed-short:
# runs-on: ubuntu-latest
# needs: [build]
# timeout-minutes: 60
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-go@v4
# with:
# go-version: "1.21"
# check-latest: true
# - uses: actions/cache@v3
# with:
# path: ~/go/bin
# key: ${{ runner.os }}-go-runsim-binary
# - name: test-sim-multi-seed-short
# run: |
# make test-sim-multi-seed-short

sims-notify-success:
needs:
[test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export]
Expand Down
64 changes: 32 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,38 +159,38 @@ test-sim-nondeterminism:
@cd ${CURRENT_DIR}/simapp/app && go test -mod=readonly -run TestAppStateDeterminism -Enabled=true \
-NumBlocks=20 -BlockSize=200 -Commit=true -Period=0 -v -timeout 24h

# test-sim-custom-genesis-fast:
# @echo "Running custom genesis simulation..."
# @echo "By default, ${HOME}/.cada/config/genesis.json will be used."
# @cd ${CURRENT_DIR}/simapp && go test -mod=readonly -run TestFullAppSimulation -Genesis=${HOME}/.cada/config/genesis.json \
# -Enabled=true -NumBlocks=100 -BlockSize=200 -Commit=true -Seed=99 -Period=5 -v -timeout 24h

# test-sim-import-export: runsim
# @echo "Running application import/export simulation. This may take several minutes..."
# @cd ${CURRENT_DIR}/simapp && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 50 5 TestAppImportExport

# test-sim-after-import: runsim
# @echo "Running application simulation-after-import. This may take several minutes..."
# @cd ${CURRENT_DIR}/simapp && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 50 5 TestAppSimulationAfterImport

# test-sim-custom-genesis-multi-seed: runsim
# @echo "Running multi-seed custom genesis simulation..."
# @echo "By default, ${HOME}/.cada/config/genesis.json will be used."
# @cd ${CURRENT_DIR}/simapp && $(BINDIR)/runsim -Genesis=${HOME}/.cada/config/genesis.json -SimAppPkg=. -ExitOnFail 400 5 TestFullAppSimulation

# test-sim-multi-seed-long: runsim
# @echo "Running long multi-seed application simulation. This may take awhile!"
# @cd ${CURRENT_DIR}/simapp && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 500 50 TestFullAppSimulation

# test-sim-multi-seed-short: runsim
# @echo "Running short multi-seed application simulation. This may take awhile!"
# @cd ${CURRENT_DIR}/simapp && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 50 10 TestFullAppSimulation

# test-sim-benchmark-invariants:
# @echo "Running simulation invariant benchmarks..."
# cd ${CURRENT_DIR}/simapp && @go test -mod=readonly -benchmem -bench=BenchmarkInvariants -run=^$ \
# -Enabled=true -NumBlocks=1000 -BlockSize=200 \
# -Period=1 -Commit=true -Seed=57 -v -timeout 24h
test-sim-custom-genesis-fast:
@echo "Running custom genesis simulation..."
@echo "By default, ${HOME}/.cada/config/genesis.json will be used."
@cd ${CURRENT_DIR}/simapp && go test -mod=readonly -run TestFullAppSimulation -Genesis=${HOME}/.cada/config/genesis.json \
-Enabled=true -NumBlocks=100 -BlockSize=200 -Commit=true -Seed=99 -Period=5 -v -timeout 24h

test-sim-import-export: runsim
@echo "Running application import/export simulation. This may take several minutes..."
@cd ${CURRENT_DIR}/simapp && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 50 5 TestAppImportExport

test-sim-after-import: runsim
@echo "Running application simulation-after-import. This may take several minutes..."
@cd ${CURRENT_DIR}/simapp && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 50 5 TestAppSimulationAfterImport

test-sim-custom-genesis-multi-seed: runsim
@echo "Running multi-seed custom genesis simulation..."
@echo "By default, ${HOME}/.cada/config/genesis.json will be used."
@cd ${CURRENT_DIR}/simapp && $(BINDIR)/runsim -Genesis=${HOME}/.cada/config/genesis.json -SimAppPkg=. -ExitOnFail 400 5 TestFullAppSimulation

test-sim-multi-seed-long: runsim
@echo "Running long multi-seed application simulation. This may take awhile!"
@cd ${CURRENT_DIR}/simapp && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 500 50 TestFullAppSimulation

test-sim-multi-seed-short: runsim
@echo "Running short multi-seed application simulation. This may take awhile!"
@cd ${CURRENT_DIR}/simapp && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 50 10 TestFullAppSimulation

test-sim-benchmark-invariants:
@echo "Running simulation invariant benchmarks..."
cd ${CURRENT_DIR}/simapp && @go test -mod=readonly -benchmem -bench=BenchmarkInvariants -run=^$ \
-Enabled=true -NumBlocks=1000 -BlockSize=200 \
-Period=1 -Commit=true -Seed=57 -v -timeout 24h

.PHONY: \
test-sim-nondeterminism \
Expand Down

0 comments on commit 3b1d7d4

Please sign in to comment.