Skip to content

Commit

Permalink
Start system tests (#1410)
Browse files Browse the repository at this point in the history
* Start system tests

* Go mod tidy

* Add system tests (#1411)

* Add tests

* Add test-system to CI

* Fix path

* Remove store artifact steps

* Add small fixes

* Add stake/unstake tests

* Add unsafe-reset-all extention + system test

* Replace ustake with stake

* Add more tests + fix bug in cli

* Fix comments and add multi contract system test

* Updates and fixes to system tests (#1449)

* Updates

* Minor cleanup

* Make tests pass

---------

Co-authored-by: Alexander Peters <alpe@users.noreply.github.com>

* Fix Makefile to return exit code for system tests (#1450)

* Abort on error results

---------

Co-authored-by: pinosu <95283998+pinosu@users.noreply.github.com>
  • Loading branch information
alpe and pinosu authored Jun 15, 2023
1 parent 1ce86ca commit a4548ba
Show file tree
Hide file tree
Showing 22 changed files with 4,306 additions and 3 deletions.
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ jobs:
- "profiles/*"
- store_artifacts:
path: /tmp/logs

test-system:
executor: golang
parallelism: 1
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- restore_cache:
keys:
- go-mod-v1-{{ checksum "go.sum" }}
- run:
name: Build and run system tests
command: make test-system

benchmark:
executor: golang
Expand Down Expand Up @@ -234,6 +248,9 @@ workflows:
- upload-coverage:
requires:
- test-cover
- test-system:
requires:
- test-cover
- benchmark:
requires:
- test-cover
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,8 @@ distclean: clean
########################################
### Testing


test: test-unit
test-all: check test-race test-cover
test-all: check test-race test-cover test-system

test-unit:
@VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock' ./...
Expand All @@ -152,6 +151,9 @@ test-sim-deterministic: runsim
@echo "Running short multi-seed application simulation. This may take awhile!"
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 1 1 TestAppStateDeterminism

test-system: install
@VERSION=$(VERSION) cd tests/system; go test -mod=readonly -failfast -tags='system_test' ./... --wait-time=45s --verbose; EXIT_CODE=$$?; cd -; exit $$EXIT_CODE

###############################################################################
### Linting ###
###############################################################################
Expand Down Expand Up @@ -201,3 +203,4 @@ proto-check-breaking:
go-mod-cache draw-deps clean build format \
test test-all test-build test-cover test-unit test-race \
test-sim-import-export build-windows-client \
test-system
6 changes: 5 additions & 1 deletion cmd/wasmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"io"
"os"

banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"

rosettaCmd "cosmossdk.io/tools/rosetta/cmd"
dbm "github.com/cometbft/cometbft-db"
tmcfg "github.com/cometbft/cometbft/config"
Expand Down Expand Up @@ -33,6 +35,7 @@ import (
"github.com/CosmWasm/wasmd/app"
"github.com/CosmWasm/wasmd/app/params"
"github.com/CosmWasm/wasmd/x/wasm"
wasmcli "github.com/CosmWasm/wasmd/x/wasm/client/cli"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
)
Expand Down Expand Up @@ -148,13 +151,14 @@ func initAppConfig() (string, interface{}) {
func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
rootCmd.AddCommand(
genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome),
// testnetCmd(app.ModuleBasics, banktypes.GenesisBalancesIterator{}),
NewTestnetCmd(app.ModuleBasics, banktypes.GenesisBalancesIterator{}),
debug.Cmd(),
config.Cmd(),
pruning.PruningCmd(newApp),
)

server.AddCommands(rootCmd, app.DefaultNodeHome, newApp, appExport, addModuleInitFlags)
wasmcli.ExtendUnsafeResetAllCmd(rootCmd)

// add keybase, auxiliary RPC, query, and tx child commands
rootCmd.AddCommand(
Expand Down
Loading

0 comments on commit a4548ba

Please sign in to comment.