From e940b6f230acd3a3ea200f97d4eadcb8c50a1e28 Mon Sep 17 00:00:00 2001 From: hunjixin <1084400399@qq.com> Date: Wed, 2 Nov 2022 17:40:42 +0800 Subject: [PATCH] chore: remove test duplicate package --- .github/workflows/test.yml | 7 +++---- Makefile | 3 ++- tools/gengen/util/gengen_test.go | 10 ++++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 794975815d..f5d8e19660 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,21 +51,20 @@ jobs: ./gengen --keypath ./fixtures/live --out-car ./fixtures/live/genesis.car --out-json ./fixtures/live/gen.json --config ./fixtures/setup.json ./gengen --keypath ./fixtures/test --out-car ./fixtures/test/genesis.car --out-json ./fixtures/test/gen.json --config ./fixtures/setup.json - - name: Integration Test + - name: Venus Shared Test run: go test -coverpkg=./... -coverprofile=coverage_venus_shared.txt -covermode=atomic -timeout=30m -parallel=4 -v ./venus-shared/... - name: Unit Test - run: go test -coverpkg=./... -coverprofile=coverage_unit.txt -covermode=atomic -timeout=30m -parallel=4 -v ./... -integration=false -unit=true + run: go test -coverpkg=./... -coverprofile=coverage_unit.txt -covermode=atomic -timeout=30m -parallel=4 -v $(go list ./... | grep -v /venus-shared/) -integration=false -unit=true - name: Integration Test - run: go test -coverpkg=./... -coverprofile=coverage_integration.txt -covermode=atomic -timeout=30m -parallel=4 -v ./... -integration=true -unit=false + run: go test -coverpkg=./... -coverprofile=coverage_integration.txt -covermode=atomic -timeout=30m -parallel=4 -v $(go list ./... | grep -v /venus-shared/) -integration=true -unit=false - name: Upload uses: codecov/codecov-action@v2 with: token: files: ./coverage_unit.txt,./coverage_integration.txt,./coverage_venus_shared.txt - flags: unittests,integration name: venus fail_ci_if_error: true verbose: true diff --git a/Makefile b/Makefile index 744c115e4a..ce2425794b 100644 --- a/Makefile +++ b/Makefile @@ -103,7 +103,8 @@ test:test-venus-shared go build -o gengen ./tools/gengen ./gengen --keypath ./fixtures/live --out-car ./fixtures/live/genesis.car --out-json ./fixtures/live/gen.json --config ./fixtures/setup.json ./gengen --keypath ./fixtures/test --out-car ./fixtures/test/genesis.car --out-json ./fixtures/test/gen.json --config ./fixtures/setup.json - go test $(go list ./... | grep -v /venus-shared/) -unit=false + go test $$(go list ./... | grep -v /venus-shared/) -timeout=30m -v -integration=true -unit=false + go test $$(go list ./... | grep -v /venus-shared/) -timeout=30m -v -integration=false -unit=true lint: $(BUILD_DEPS) golangci-lint run diff --git a/tools/gengen/util/gengen_test.go b/tools/gengen/util/gengen_test.go index 1dd0ab2652..66448a75f1 100644 --- a/tools/gengen/util/gengen_test.go +++ b/tools/gengen/util/gengen_test.go @@ -5,8 +5,9 @@ import ( "os" "testing" + "github.com/filecoin-project/go-state-types/builtin" + "github.com/filecoin-project/go-state-types/abi" - builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" ds "github.com/ipfs/go-datastore" blockstore "github.com/ipfs/go-ipfs-blockstore" @@ -72,9 +73,10 @@ func TestGenGenLoading(t *testing.T) { o := td.Run("state", "list-actor").AssertSuccess() stdout := o.ReadStdout() - assert.Contains(t, stdout, builtin2.StoragePowerActorCodeID.String()) - assert.Contains(t, stdout, builtin2.StorageMarketActorCodeID.String()) - assert.Contains(t, stdout, builtin2.InitActorCodeID.String()) + //address won't change + assert.Contains(t, stdout, builtin.StoragePowerActorAddr.String()) + assert.Contains(t, stdout, builtin.StorageMarketActorAddr.String()) + assert.Contains(t, stdout, builtin.InitActorAddr.String()) } func TestGenGenDeterministic(t *testing.T) {