From 0a1d4576947632cf00f7dba16c564657079debe5 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Fri, 16 Jun 2023 09:17:03 +0900 Subject: [PATCH] fix: fix cli_test error of wasmplus (#52) * fix: fix cli_test error of wasmplus * ci: add cli_test and race unittest in ci * chore: update changelog * chore: change makefile test name. --- .github/workflows/test.yml | 31 +++++++++++++++++++ CHANGELOG.md | 1 + Makefile | 5 ++- x/wasm/client/testutil/cli_test.go | 4 +-- x/wasmplus/client/testutil/cli_test.go | 4 +-- .../testutil/testdata/wasm_genesis.json | 4 --- 6 files changed, 40 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 522cbf4b4..d4150295b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,6 +15,37 @@ jobs: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'" + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3.5.0 + with: + go-version: 1.18 + - name: Display go version + run: go version + - name: Check if difference + uses: technote-space/get-diff-action@v6.1.2 + id: git_diff + with: + PATTERNS: | + **/**.go + go.mod + go.sum + .github/workflows/test.yml + - name: Build + run: make build + if: env.GIT_DIFF + - name: Test + run: make test + if: env.GIT_DIFF + - name: Test race + run: make test-race + if: env.GIT_DIFF + - name: Test integration + run: make test-cli + if: env.GIT_DIFF + test-cover: runs-on: ubuntu-latest steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 466713ed9..da41a8e8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Improvements ### Bug Fixes +* [\#52](https://github.com/Finschia/wasmd/pull/52) fix cli_test error of wasmplus and add cli_test ci ### Breaking Changes diff --git a/Makefile b/Makefile index 04d2431e4..9100788ef 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ distclean: clean test: test-unit -test-all: check test-race test-cover +test-all: test-race test-cover test-cli test-unit: @VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock' ./... @@ -133,6 +133,9 @@ test-race: test-cover: @go test -mod=readonly -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock' ./... +test-cli: + @go test -mod=readonly -tags="cli_test" ./.../testutil/... + benchmark: @go test -mod=readonly -bench=. ./... diff --git a/x/wasm/client/testutil/cli_test.go b/x/wasm/client/testutil/cli_test.go index 91cf8dd7c..66814e75c 100644 --- a/x/wasm/client/testutil/cli_test.go +++ b/x/wasm/client/testutil/cli_test.go @@ -1,5 +1,5 @@ -//go:build norace -// +build norace +//go:build cli_test +// +build cli_test package testutil diff --git a/x/wasmplus/client/testutil/cli_test.go b/x/wasmplus/client/testutil/cli_test.go index 26b6f4fea..dde213c4d 100644 --- a/x/wasmplus/client/testutil/cli_test.go +++ b/x/wasmplus/client/testutil/cli_test.go @@ -1,5 +1,5 @@ -//go:build norace -// +build norace +//go:build cli_test +// +build cli_test package testutil diff --git a/x/wasmplus/client/testutil/testdata/wasm_genesis.json b/x/wasmplus/client/testutil/testdata/wasm_genesis.json index dabc0aa2d..a4ecaa3e5 100644 --- a/x/wasmplus/client/testutil/testdata/wasm_genesis.json +++ b/x/wasmplus/client/testutil/testdata/wasm_genesis.json @@ -51,9 +51,6 @@ "address": "", "permission": "Everybody" }, - "compile_cost": "3", - "gas_multiplier": "140000000", - "instance_cost": "60000", "instantiate_default_permission": "Everybody" }, "sequences": @@ -67,5 +64,4 @@ "value": "2" } ] -} } \ No newline at end of file