Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: decrease sim test time #350

Merged
merged 9 commits into from
Oct 15, 2021
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 86 additions & 1 deletion .github/workflows/release-sims.yml
Original file line number Diff line number Diff line change
@@ -35,9 +35,94 @@ jobs:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary

test-sim-multi-seed-long-part1:
test-sim-nondeterminism:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
go-version: 1.15
- name: Display go version
run: go version
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.go
!**/**_test.go
go.mod
go.sum
- uses: actions/[email protected]
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: env.GIT_DIFF
- name: test-sim-nondeterminism
run: |
make test-sim-nondeterminism
if: env.GIT_DIFF

test-sim-import-export:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
go-version: 1.15
- name: Display go version
run: go version
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.go
!**/**_test.go
go.mod
go.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- uses: actions/[email protected]
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: env.GIT_DIFF
- name: test-sim-import-export
run: |
make test-sim-import-export
if: env.GIT_DIFF

test-sim-after-import:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
go-version: 1.15
- name: Display go version
run: go version
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.go
!**/**_test.go
go.mod
go.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- uses: actions/[email protected]
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: env.GIT_DIFF
- name: test-sim-after-import
run: |
make test-sim-after-import
if: env.GIT_DIFF

test-sim-multi-seed-long-part1:
runs-on: ubuntu-latest
needs: [build, install-runsim, test-sim-import-export, test-sim-after-import]
steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]
18 changes: 9 additions & 9 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ jobs:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary

test-sim-nondeterminism:
test-sim-nondeterminism-short:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
@@ -66,12 +66,12 @@ jobs:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: env.GIT_DIFF
- name: test-sim-nondeterminism
- name: test-sim-nondeterminism-short
run: |
make test-sim-nondeterminism
make test-sim-nondeterminism-short
if: env.GIT_DIFF

test-sim-import-export:
test-sim-import-export-short:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
@@ -95,12 +95,12 @@ jobs:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: env.GIT_DIFF
- name: test-sim-import-export
- name: test-sim-import-export-short
run: |
make test-sim-import-export
make test-sim-import-export-short
if: env.GIT_DIFF

test-sim-after-import:
test-sim-after-import-short:
runs-on: ubuntu-latest
needs: [build, install-runsim]
steps:
@@ -124,9 +124,9 @@ jobs:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: env.GIT_DIFF
- name: test-sim-after-import
- name: test-sim-after-import-short
run: |
make test-sim-after-import
make test-sim-after-import-short
if: env.GIT_DIFF

test-sim-multi-seed-short:
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -258,6 +258,11 @@ endif

.PHONY: run-tests test test-all $(TEST_TARGETS)

test-sim-nondeterminism-short:
@echo "Running non-determinism test..."
@go test -mod=readonly $(SIMAPP) -run TestAppStateDeterminism -Enabled=true \
-NumBlocks=50 -BlockSize=100 -Commit=true -Period=0 -v -timeout 24h

test-sim-nondeterminism:
@echo "Running non-determinism test..."
@go test -mod=readonly $(SIMAPP) -run TestAppStateDeterminism -Enabled=true \
@@ -269,10 +274,18 @@ test-sim-custom-genesis-fast:
@go test -mod=readonly $(SIMAPP) -run TestFullAppSimulation -Genesis=${HOME}/.gaiad/config/genesis.json \
-Enabled=true -NumBlocks=100 -BlockSize=200 -Commit=true -Seed=99 -Period=5 -v -timeout 24h

test-sim-import-export-short: runsim
@echo "Running application import/export simulation. This may take several minutes..."
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 20 5 TestAppImportExport

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

test-sim-after-import-short: runsim
@echo "Running application simulation-after-import. This may take several minutes..."
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 10 5 TestAppSimulationAfterImport

test-sim-after-import: runsim
@echo "Running application simulation-after-import. This may take several minutes..."
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestAppSimulationAfterImport
@@ -301,7 +314,7 @@ test-sim-multi-seed-long-part3: runsim

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

test-sim-benchmark-invariants:
@echo "Running simulation invariant benchmarks..."
3 changes: 3 additions & 0 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
@@ -23,6 +23,9 @@ import (
sdkerrors "github.com/line/lbm-sdk/types/errors"
)

// TODO: remove this comment
// meaningless comment for running actions.

// InitChain implements the ABCI interface. It runs the initialization logic
// directly on the CommitMultiStore.
func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain) {