Skip to content

Commit

Permalink
ci: add component management to .codecov.yaml and migrate flag mana…
Browse files Browse the repository at this point in the history
…ge (#9252)
  • Loading branch information
wuhuizuo authored Jul 3, 2023
1 parent f74252b commit fd95ba3
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 18 deletions.
59 changes: 44 additions & 15 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ parsers:
macro: no

comment:
layout: "header, flags, diff"
layout: "header, components, flags, diff"
behavior: default
require_changes: no

Expand All @@ -41,20 +41,49 @@ ignore:
- "mock/.*"
- "*_mock.go"

flags:
cdc:
carryforward: true
paths:
- "cdc/"
- "cmd/"
- "pkg/"
component_management:
default_rules: # default rules that will be inherited by all components
statuses:
- type: project # in this case every component that doens't have a status defined will have a project type one
target: auto
individual_components:
- component_id: component_cdc # this is an identifier that should not be changed
name: cdc # this is a display name, and can be changed freely
paths:
- cdc/**
- cmd/**
- pkg/**
- component_id: component_dm
name: dm
paths:
- dm/**
- component_id: component_engine
name: engine
paths:
- engine/**
# more components.

dm:
flag_management:
default_rules: # the rules that will be followed for any flag added, generally
carryforward: true
paths:
- "dm/"
statuses:
- type: project
target: 60%
- type: patch
target: 60%

engine:
carryforward: true
paths:
- "engine/"
individual_flags: # exceptions to the default rules above, stated flag by flag
- name: cdc #fill in your own flag name
paths:
- cdc/** #fill in your own path. Note, accepts globs, not regexes
- cmd/**
- pkg/**
carryforward: true
- name: dm
paths:
- dm/**
carryforward: true
- name: engine
paths:
- engine/**
carryforward: true
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ unit_test_in_verify_ci: check_failpoint_ctl tools/bin/gotestsum tools/bin/gocov
|| { $(FAILPOINT_DISABLE); exit 1; }
tools/bin/gocov convert "$(TEST_DIR)/cov.unit.out" | tools/bin/gocov-xml > cdc-coverage.xml
$(FAILPOINT_DISABLE)
@bash <(curl -s https://codecov.io/bash) -F cdc -f $(TEST_DIR)/cov.unit.out -t $(TICDC_CODECOV_TOKEN)
@bash <(curl -s https://codecov.io/bash) -F unit,cdc -f $(TEST_DIR)/cov.unit.out -t $(TICDC_CODECOV_TOKEN)

leak_test: check_failpoint_ctl
$(FAILPOINT_ENABLE)
Expand Down Expand Up @@ -417,7 +417,7 @@ dm_unit_test_in_verify_ci: check_failpoint_ctl tools/bin/gotestsum tools/bin/goc
|| { $(FAILPOINT_DISABLE); exit 1; }
tools/bin/gocov convert "$(DM_TEST_DIR)/cov.unit_test.out" | tools/bin/gocov-xml > dm-coverage.xml
$(FAILPOINT_DISABLE)
@bash <(curl -s https://codecov.io/bash) -F dm -f $(DM_TEST_DIR)/cov.unit_test.out -t $(TICDC_CODECOV_TOKEN)
@bash <(curl -s https://codecov.io/bash) -F unit,dm -f $(DM_TEST_DIR)/cov.unit_test.out -t $(TICDC_CODECOV_TOKEN)

dm_integration_test_build: check_failpoint_ctl
$(FAILPOINT_ENABLE)
Expand Down Expand Up @@ -579,7 +579,7 @@ engine_unit_test_in_verify_ci: check_failpoint_ctl tools/bin/gotestsum tools/bin
|| { $(FAILPOINT_DISABLE); exit 1; }
tools/bin/gocov convert "$(ENGINE_TEST_DIR)/cov.unit_test.out" | tools/bin/gocov-xml > engine-coverage.xml
$(FAILPOINT_DISABLE)
@bash <(curl -s https://codecov.io/bash) -F engine -f $(ENGINE_TEST_DIR)/cov.unit_test.out -t $(TICDC_CODECOV_TOKEN)
@bash <(curl -s https://codecov.io/bash) -F unit,engine -f $(ENGINE_TEST_DIR)/cov.unit_test.out -t $(TICDC_CODECOV_TOKEN)

prepare_test_binaries:
cd scripts && ./download-integration-test-binaries.sh master && cd ..
Expand Down

0 comments on commit fd95ba3

Please sign in to comment.