From 7e88e6ecdc8c1e12fecdc0e51b3493211507a06f Mon Sep 17 00:00:00 2001 From: Yu Xia Date: Tue, 6 Jul 2021 08:37:40 -0700 Subject: [PATCH] Ignore bench and canary test coverage (#4297) --- Makefile | 3 ++- tools/sql/clitest/connTest.go | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 437c34b7e7b..91580069d51 100644 --- a/Makefile +++ b/Makefile @@ -417,6 +417,7 @@ INTEG_TEST_XDC_ROOT=./host/xdc INTEG_TEST_XDC_DIR=hostxdc INTEG_TEST_NDC_ROOT=./host/ndc INTEG_TEST_NDC_DIR=hostndc +OPT_OUT_TEST=./bench/% ./canary/% TEST_TIMEOUT ?= 20m TEST_ARG ?= -race $(if $(test_v),-v) -timeout $(TEST_TIMEOUT) @@ -433,7 +434,7 @@ endif # all directories with *_test.go files in them (exclude host/xdc) TEST_DIRS := $(filter-out $(INTEG_TEST_XDC_ROOT)%, $(sort $(dir $(filter %_test.go,$(ALL_SRC))))) # all tests other than end-to-end integration test fall into the pkg_test category -PKG_TEST_DIRS := $(filter-out $(INTEG_TEST_ROOT)%,$(TEST_DIRS)) +PKG_TEST_DIRS := $(filter-out $(INTEG_TEST_ROOT)% $(OPT_OUT_TEST), $(TEST_DIRS)) # Code coverage output files COVER_ROOT := $(BUILD)/coverage diff --git a/tools/sql/clitest/connTest.go b/tools/sql/clitest/connTest.go index 1cdde5f0454..91564f1cbad 100644 --- a/tools/sql/clitest/connTest.go +++ b/tools/sql/clitest/connTest.go @@ -21,6 +21,8 @@ package clitest import ( + "fmt" + "log" "net" "strconv" @@ -64,7 +66,7 @@ func (s *SQLConnTestSuite) SetupTest() { func (s *SQLConnTestSuite) SetupSuite() { conn, err := newTestConn("", s.pluginName) if err != nil { - s.Log.Fatal("error creating sql conn, ", tag.Error(err)) + log.Fatal(fmt.Sprintf("failed creating sql conn with error: %v", tag.Error(err))) } s.SetupSuiteBase(conn) }