Skip to content

Commit

Permalink
CI: Tweak our code coverage profile behavior (#14967)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord authored Feb 2, 2024
1 parent 6f9c5c2 commit 6e7645c
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 13 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions: read-all
jobs:
test:
name: Code Coverage
runs-on: gh-hosted-runners-4cores-1
runs-on: gh-hosted-runners-16cores-1

steps:
- name: Check out code
Expand Down Expand Up @@ -106,8 +106,14 @@ jobs:
eatmydata -- make unit_test_cover
# Restore the files we deleted as codecov tries to fix their paths.
git reset --hard HEAD
- name: Upload coverage reports to codecov.io
if: steps.changes.outputs.changed_files == 'true'
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ e2e_test: build
# Run the code coverage tools, compute aggregate.
unit_test_cover: build dependency_check demo
source build.env
go test $(VT_GO_PARALLEL) -count=1 -coverprofile=coverage.out ./go/...
go test $(VT_GO_PARALLEL) -count=1 -failfast -covermode=atomic -coverpkg=vitess.io/vitess/go/... -coverprofile=coverage.out ./go/...
# Handle go tool cover failures due to not handling `//line` directives, which
# the goyacc compiler adds to the generated parser in sql.go. See:
# https://github.com/golang/go/issues/41222
Expand Down
50 changes: 50 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# https://docs.codecov.com/docs/
# https://docs.codecov.com/docs/codecov-yaml

codecov:
branch: main # Set the default branch

parsers:
go:
partials_as_hits: true

ignore:
# Ignore our end-to-end test code
- "go/flags/endtoend/**"
- "go/mysql/endtoend/**"
- "go/test/endtoend/**"
- "go/vt/vtctl/endtoend/**"
- "go/vt/vtctl/grpcvtctldserver/endtoend/**"
- "go/vt/vtgate/endtoend/**"
- "go/vt/vttablet/endtoend/**"
- "go/cmd/vttestserver/**" # This relies on end-to-end test packages
# Ignore generated code
- "go/**/cached_size.go" # Code generated by Sizegen
- "go/vt/sqlparser/ast_clone.go" # Code generated by ASTHelperGen
- "go/vt/sqlparser/ast_copy_on_rewrite.go" # Code generated by ASTHelperGen
- "go/vt/sqlparser/ast_equals.go" # Code generated by ASTHelperGen
- "go/vt/sqlparser/ast_format_fast.go" # Code generated by ASTFmtGen
- "go/vt/sqlparser/ast_rewrite.go" # Code generated by ASTHelperGen
- "go/vt/sqlparser/ast_visit.go" # Code generated by ASTHelperGen
- "go/vt/vttablet/tabletserver/txthrottler/mock_healthcheck_test.go" # Code generated by MockGen
- "go/vt/vttablet/tabletserver/txthrottler/mock_throttler_test.go" # Code generated by MockGen
- "go/vt/sqlparser/sql.go" # Code generated by goyacc
- "go/mysql/collations/charset/korean/tables.go" # Code generated by go run maketables.go
- "go/mysql/collations/charset/simplifiedchinese/tables.go" # Code generated by go run maketables.go
- "go/mysql/collations/colldata/mysqldata.go" # Code generated by makecolldata
- "go/mysql/collations/colldata/mysqlucadata.go" # Code generated by makecolldata
- "go/mysql/collations/internal/uca/fasttables.go" # Code generated by makecolldata
- "go/mysql/collations/mysqlversion.go" # Code generated by makecolldata
- "go/mysql/collations/supported.go" # Code generated by makecolldata
# Ignore proto files
- "go/vt/proto/**"

comment: # https://docs.codecov.com/docs/pull-request-comments
hide_project_coverage: false

coverage:
status: # https://docs.codecov.com/docs/commit-status
project:
default:
informational: true # Don't ever fail the codecov/project or codecov/patch tests

8 changes: 0 additions & 8 deletions go/tools/releases/releases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ func TestGetDirs(t *testing.T) {
currentDir: dir{
Path: "./",
},
expectedErr: "",
},
{
name: "Temp dir",
currentDir: dir{
Path: "/tmp",
},
expectedErr: "open /tmp/snap-private-tmp: permission denied",
},
}

Expand Down
Empty file.
5 changes: 3 additions & 2 deletions go/vt/wrangler/vexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -880,8 +880,9 @@ func (wr *Wrangler) ListAllWorkflows(ctx context.Context, keyspace string, activ
}

// ShowWorkflow will return all of the relevant replication related information for the given workflow.
func (wr *Wrangler) ShowWorkflow(ctx context.Context, workflow, keyspace string, shards []string) (*ReplicationStatusResult, error) {
replStatus, err := wr.getStreams(ctx, workflow, keyspace, shards)
// If shardSubset is nil, then all shards will be queried.
func (wr *Wrangler) ShowWorkflow(ctx context.Context, workflow, keyspace string, shardSubset []string) (*ReplicationStatusResult, error) {
replStatus, err := wr.getStreams(ctx, workflow, keyspace, shardSubset)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 6e7645c

Please sign in to comment.