From 3d60d3dd420ffbdaa54ba55e4d64c6c4a86dfea8 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Sat, 10 Jun 2023 17:15:00 +0900 Subject: [PATCH 1/4] fix: fix cli_test error of wasmplus --- x/wasmplus/client/testutil/testdata/wasm_genesis.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/x/wasmplus/client/testutil/testdata/wasm_genesis.json b/x/wasmplus/client/testutil/testdata/wasm_genesis.json index dabc0aa2db..a4ecaa3e59 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 From ac4d3f97928f5b22fc959029780582f4e1da8d62 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Sat, 10 Jun 2023 17:15:34 +0900 Subject: [PATCH 2/4] ci: add cli_test and race unittest in ci --- .github/workflows/test.yml | 31 ++++++++++++++++++++++++++ Makefile | 5 ++++- x/wasm/client/testutil/cli_test.go | 4 ++-- x/wasmplus/client/testutil/cli_test.go | 4 ++-- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 522cbf4b4f..6faba11746 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-integration + if: env.GIT_DIFF + test-cover: runs-on: ubuntu-latest steps: diff --git a/Makefile b/Makefile index 04d2431e43..3da906be4d 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-integration 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-integration: + @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 91cf8dd7c4..66814e75c1 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 26b6f4feae..dde213c4d9 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 From f3f23226d85cfb94e9fc6a404519d762cdcd893a Mon Sep 17 00:00:00 2001 From: zemyblue Date: Sat, 10 Jun 2023 17:24:11 +0900 Subject: [PATCH 3/4] chore: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 466713ed93..da41a8e8f4 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 From 1dc09a36b17814e3f420a03371ede643af4e41ec Mon Sep 17 00:00:00 2001 From: zemyblue Date: Mon, 12 Jun 2023 16:30:13 +0900 Subject: [PATCH 4/4] chore: change makefile test name. --- .github/workflows/test.yml | 2 +- Makefile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6faba11746..d4150295b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,7 +43,7 @@ jobs: run: make test-race if: env.GIT_DIFF - name: Test integration - run: make test-integration + run: make test-cli if: env.GIT_DIFF test-cover: diff --git a/Makefile b/Makefile index 3da906be4d..9100788ef3 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ distclean: clean test: test-unit -test-all: test-race test-cover test-integration +test-all: test-race test-cover test-cli test-unit: @VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock' ./... @@ -133,7 +133,7 @@ test-race: test-cover: @go test -mod=readonly -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock' ./... -test-integration: +test-cli: @go test -mod=readonly -tags="cli_test" ./.../testutil/... benchmark: