Skip to content

Commit

Permalink
change log level to info
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 committed Apr 6, 2022
1 parent 48c8d39 commit cca6726
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ dm_unit_test_pkg: check_failpoint_ctl
dm_unit_test_in_verify_ci: check_failpoint_ctl tools/bin/gotestsum tools/bin/gocov tools/bin/gocov-xml
mkdir -p $(DM_TEST_DIR)
$(FAILPOINT_ENABLE)
@export log_level=error; \
@export log_level=info; \
CGO_ENABLED=1 tools/bin/gotestsum --junitfile dm-junit-report.xml -- -v -timeout 5m -p $(P) --race \
-covermode=atomic -coverprofile="$(DM_TEST_DIR)/cov.unit_test.out" $(DM_PACKAGES) \
|| { $(FAILPOINT_DISABLE); exit 1; }
Expand Down
35 changes: 16 additions & 19 deletions dm/pkg/schema/tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,20 @@ import (

"github.com/DATA-DOG/go-sqlmock"
. "github.com/pingcap/check"
"github.com/pingcap/log"
"github.com/pingcap/tidb/ddl"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/util/filter"
timock "github.com/pingcap/tidb/util/mock"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zapcore"

"github.com/pingcap/tiflow/dm/dm/config"
"github.com/pingcap/tiflow/dm/pkg/conn"
tcontext "github.com/pingcap/tiflow/dm/pkg/context"
dlog "github.com/pingcap/tiflow/dm/pkg/log"
"github.com/pingcap/tiflow/dm/pkg/terror"
"github.com/pingcap/tiflow/dm/syncer/dbconn"
"github.com/stretchr/testify/require"
)

func Test(t *testing.T) {
Expand Down Expand Up @@ -76,7 +73,7 @@ func (s *trackerSuite) TearDownSuite(c *C) {
}

func (s *trackerSuite) TestTiDBAndSessionCfg(c *C) {
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)
table := &filter.Table{
Schema: "testdb",
Name: "foo",
Expand Down Expand Up @@ -196,7 +193,7 @@ func (s *trackerSuite) TestTiDBAndSessionCfg(c *C) {
}

func (s *trackerSuite) TestDDL(c *C) {
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)
table := &filter.Table{
Schema: "testdb",
Name: "foo",
Expand Down Expand Up @@ -274,7 +271,7 @@ func (s *trackerSuite) TestDDL(c *C) {
}

func (s *trackerSuite) TestGetSingleColumnIndices(c *C) {
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)

tracker, err := NewTracker(context.Background(), "test-tracker", defaultTestSessionCfg, s.dbConn)
c.Assert(err, IsNil)
Expand Down Expand Up @@ -317,7 +314,7 @@ func (s *trackerSuite) TestGetSingleColumnIndices(c *C) {
}

func (s *trackerSuite) TestCreateSchemaIfNotExists(c *C) {
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)

tracker, err := NewTracker(context.Background(), "test-tracker", defaultTestSessionCfg, s.dbConn)
c.Assert(err, IsNil)
Expand Down Expand Up @@ -349,7 +346,7 @@ func (s *trackerSuite) TestCreateSchemaIfNotExists(c *C) {
}

func (s *trackerSuite) TestMultiDrop(c *C) {
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)

tracker, err := NewTracker(context.Background(), "test-tracker", defaultTestSessionCfg, s.dbConn)
c.Assert(err, IsNil)
Expand Down Expand Up @@ -397,7 +394,7 @@ func (aj asJSON) String() string {
}

func (s *trackerSuite) TestCreateTableIfNotExists(c *C) {
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)
table := &filter.Table{
Schema: "testdb",
Name: "foo",
Expand Down Expand Up @@ -484,7 +481,7 @@ func (s *trackerSuite) TestCreateTableIfNotExists(c *C) {
}

func (s *trackerSuite) TestBatchCreateTableIfNotExist(c *C) {
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)
tracker, err := NewTracker(context.Background(), "test-tracker", defaultTestSessionCfg, s.dbConn)
c.Assert(err, IsNil)
defer func() {
Expand Down Expand Up @@ -600,7 +597,7 @@ func (s *trackerSuite) TestBatchCreateTableIfNotExist(c *C) {
}

func (s *trackerSuite) TestAllSchemas(c *C) {
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)
ctx := context.Background()

tracker, err := NewTracker(context.Background(), "test-tracker", defaultTestSessionCfg, s.dbConn)
Expand Down Expand Up @@ -682,7 +679,7 @@ func (s *trackerSuite) TestAllSchemas(c *C) {
}

func (s *trackerSuite) TestNotSupportedVariable(c *C) {
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)

db, mock, err := sqlmock.New()
c.Assert(err, IsNil)
Expand All @@ -708,7 +705,7 @@ func (s *trackerSuite) TestNotSupportedVariable(c *C) {
}

func (s *trackerSuite) TestInitDownStreamSQLModeAndParser(c *C) {
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)

// tracker and sqlmock
db, mock, err := sqlmock.New()
Expand Down Expand Up @@ -738,7 +735,7 @@ func (s *trackerSuite) TestInitDownStreamSQLModeAndParser(c *C) {
}

func (s *trackerSuite) TestGetDownStreamIndexInfo(c *C) {
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)

// origin table info
p := parser.New()
Expand Down Expand Up @@ -780,7 +777,7 @@ func (s *trackerSuite) TestGetDownStreamIndexInfo(c *C) {
}

func (s *trackerSuite) TestReTrackDownStreamIndex(c *C) {
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)

// origin table info
p := parser.New()
Expand Down Expand Up @@ -873,7 +870,7 @@ func (s *trackerSuite) TestReTrackDownStreamIndex(c *C) {
}

func (s *trackerSuite) TestVarchar20000(c *C) {
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)

// origin table info
p := parser.New()
Expand Down Expand Up @@ -913,7 +910,7 @@ func (s *trackerSuite) TestVarchar20000(c *C) {
}

func (s *trackerSuite) TestPlacementRule(c *C) {
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)

// origin table info
p := parser.New()
Expand Down Expand Up @@ -968,7 +965,7 @@ func TestTrackerRecreateTables(t *testing.T) {
con, err := db.Conn(context.Background())
require.NoError(t, err)
dbConn := dbconn.NewDBConn(cfg, conn.NewBaseConn(con, nil))
log.SetLevel(zapcore.ErrorLevel)
//log.SetLevel(zapcore.ErrorLevel)

tracker, err := NewTracker(context.Background(), "test-tracker", defaultTestSessionCfg, dbConn)
require.NoError(t, err)
Expand Down

0 comments on commit cca6726

Please sign in to comment.