From b23fd1de970db5a7bf82dc1c7ff0309b081dd2ac Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Tue, 23 Nov 2021 17:05:51 +0800 Subject: [PATCH 1/2] test(ticdc): separate statistics for unit tests and integration tests (#3570) (#3578) --- Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b9d2f3477b5..48197f11f32 100644 --- a/Makefile +++ b/Makefile @@ -176,16 +176,21 @@ tidy: check: check-copyright fmt lint check-static tidy errdoc check-leaktest-added check-merge-conflicts -coverage: +integration_test_coverage: GO111MODULE=off go get github.com/wadey/gocovmerge gocovmerge "$(TEST_DIR)"/cov.* | grep -vE ".*.pb.go|$(CDC_PKG)/testing_utils/.*|$(CDC_PKG)/cdc/kv/testing.go|$(CDC_PKG)/cdc/entry/schema_test_helper.go|$(CDC_PKG)/cdc/sink/simple_mysql_tester.go|.*.__failpoint_binding__.go" > "$(TEST_DIR)/all_cov.out" - grep -vE ".*.pb.go|$(CDC_PKG)/testing_utils/.*|$(CDC_PKG)/cdc/kv/testing.go|$(CDC_PKG)/cdc/sink/simple_mysql_tester.go|.*.__failpoint_binding__.go" "$(TEST_DIR)/cov.unit.out" > "$(TEST_DIR)/unit_cov.out" ifeq ("$(JenkinsCI)", "1") GO111MODULE=off go get github.com/mattn/goveralls @goveralls -coverprofile=$(TEST_DIR)/all_cov.out -service=jenkins-ci -repotoken $(COVERALLS_TOKEN) - @bash <(curl -s https://codecov.io/bash) -f $(TEST_DIR)/unit_cov.out -t $(CODECOV_TOKEN) else go tool cover -html "$(TEST_DIR)/all_cov.out" -o "$(TEST_DIR)/all_cov.html" +endif + +unit_test_coverage: + grep -vE ".*.pb.go|$(CDC_PKG)/testing_utils/.*|$(CDC_PKG)/cdc/kv/testing.go|$(CDC_PKG)/cdc/sink/simple_mysql_tester.go|.*.__failpoint_binding__.go" "$(TEST_DIR)/cov.unit.out" > "$(TEST_DIR)/unit_cov.out" +ifeq ("$(JenkinsCI)", "1") + @bash <(curl -s https://codecov.io/bash) -f $(TEST_DIR)/unit_cov.out -t $(CODECOV_TOKEN) +else go tool cover -html "$(TEST_DIR)/unit_cov.out" -o "$(TEST_DIR)/unit_cov.html" go tool cover -func="$(TEST_DIR)/unit_cov.out" endif From 3e04da8b5e3a4a5aee12de80e1d011d48f9b82fa Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Tue, 23 Nov 2021 17:37:51 +0800 Subject: [PATCH 2/2] ticdc/metrics: fix processor checkpoint-ts lag expr (#3543) (#3558) --- metrics/grafana/ticdc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metrics/grafana/ticdc.json b/metrics/grafana/ticdc.json index c37fc158c13..5ca6a1fd173 100644 --- a/metrics/grafana/ticdc.json +++ b/metrics/grafana/ticdc.json @@ -1585,7 +1585,7 @@ "refId": "A" }, { - "expr": "sum(ticdc_processor_resolved_ts_lag{tidb_cluster=\"$tidb_cluster\", changefeed=~\"$changefeed\", capture=~\"$capture\"}) by (capture,changefeed)", + "expr": "sum(ticdc_processor_checkpoint_ts_lag{tidb_cluster=\"$tidb_cluster\", changefeed=~\"$changefeed\", capture=~\"$capture\"}) by (capture,changefeed)", "format": "time_series", "interval": "", "intervalFactor": 1,