From 5a8b33fa09b1c8b30a952edbff462c9f3aabf475 Mon Sep 17 00:00:00 2001 From: John Guo Date: Tue, 3 Jan 2023 14:33:41 +0800 Subject: [PATCH] fix gf.yaml (#2385) * fix gf.yaml * up --- .github/workflows/build_and_test.sh | 2 ++ .github/workflows/gf.yml | 4 +--- contrib/drivers/clickhouse/clickhouse_model_test.go | 6 +++--- contrib/drivers/clickhouse/clickhouse_test.go | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_and_test.sh b/.github/workflows/build_and_test.sh index 14355d51b..7c46adabc 100644 --- a/.github/workflows/build_and_test.sh +++ b/.github/workflows/build_and_test.sh @@ -40,8 +40,10 @@ for file in `find . -name go.mod`; do go mod tidy go build ./... go test ./... -race -coverprofile=coverage.out -covermode=atomic -coverpkg=./...,github.com/gogf/gf/... || exit 1 + if grep -q "/gogf/gf/.*/v2" go.mod; then sed -i "s/gogf\/gf\(\/.*\)\/v2/gogf\/gf\/v2\1/g" coverage.out fi + cd - done \ No newline at end of file diff --git a/.github/workflows/gf.yml b/.github/workflows/gf.yml index 2338c4203..2a6efe3fb 100644 --- a/.github/workflows/gf.yml +++ b/.github/workflows/gf.yml @@ -180,9 +180,7 @@ jobs: run: bash .github/workflows/before_script.sh - name: Build & Test - run: | - GOARCH=${{ matrix.goarch }} - bash .github/workflows/build_and_test.sh + run: bash .github/workflows/build_and_test.sh - name: Stop Redis Cluster Containers run: docker-compose -f ".github/workflows/redis/docker-compose.yml" down diff --git a/contrib/drivers/clickhouse/clickhouse_model_test.go b/contrib/drivers/clickhouse/clickhouse_model_test.go index bbc9340d0..1d6bbdab4 100644 --- a/contrib/drivers/clickhouse/clickhouse_model_test.go +++ b/contrib/drivers/clickhouse/clickhouse_model_test.go @@ -42,7 +42,7 @@ func Test_Model_Raw(t *testing.T) { gtest.C(t, func(t *gtest.T) { count, err := db.Model(table).Raw(fmt.Sprintf("select id from %s ", table)).Count() - t.Assert(count, int64(10)) + t.Assert(count, 10) t.AssertNil(err) }) @@ -249,12 +249,12 @@ func Test_Model_Count(t *testing.T) { gtest.C(t, func(t *gtest.T) { count, err := db.Model(table).Count() t.AssertNil(err) - t.Assert(count, int64(TableSize)) + t.Assert(count, TableSize) }) gtest.C(t, func(t *gtest.T) { count, err := db.Model(table).FieldsEx("id").Where("id>8").Count() t.AssertNil(err) - t.Assert(count, int64(2)) + t.Assert(count, 2) }) } diff --git a/contrib/drivers/clickhouse/clickhouse_test.go b/contrib/drivers/clickhouse/clickhouse_test.go index a737168e8..34eee4a53 100644 --- a/contrib/drivers/clickhouse/clickhouse_test.go +++ b/contrib/drivers/clickhouse/clickhouse_test.go @@ -297,7 +297,7 @@ func TestDriverClickhouse_Insert(t *testing.T) { gtest.AssertNil(err) total, err = connect.Model("visits").Count() gtest.AssertNil(err) - gtest.AssertEQ(total, int64(2)) + gtest.AssertEQ(total, 2) var list []*insertItem for i := 0; i < 50; i++ { list = append(list, &insertItem{ @@ -312,7 +312,7 @@ func TestDriverClickhouse_Insert(t *testing.T) { gtest.AssertNil(err) total, err = connect.Model("visits").Count() gtest.AssertNil(err) - gtest.AssertEQ(total, int64(102)) + gtest.AssertEQ(total, 102) } func TestDriverClickhouse_Insert_Use_Exec(t *testing.T) { @@ -467,7 +467,7 @@ func TestDriverClickhouse_NilTime(t *testing.T) { gtest.AssertNil(err) count, err := connect.Model("data_type").Where("Col4", "Inc.").Count() gtest.AssertNil(err) - gtest.AssertEQ(count, int64(10000)) + gtest.AssertEQ(count, 10000) data, err := connect.Model("data_type").Where("Col4", "Inc.").One() gtest.AssertNil(err) @@ -508,7 +508,7 @@ func TestDriverClickhouse_BatchInsert(t *testing.T) { gtest.AssertNil(err) count, err := connect.Model("data_type").Where("Col2", "ClickHouse").Where("Col3", "Inc").Count() gtest.AssertNil(err) - gtest.AssertEQ(count, int64(10000)) + gtest.AssertEQ(count, 10000) } func TestDriverClickhouse_Open(t *testing.T) {