Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Tweak our code coverage profile behavior #14967

Merged
merged 23 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5bcfd75
Tweak our code coverage profile behavior
mattlord Jan 16, 2024
14c677c
Increase runner size
mattlord Jan 16, 2024
54082fd
Add covermode=atomic for parallel work
mattlord Jan 16, 2024
9e8c768
More misc tweaks
mattlord Jan 16, 2024
09f47dc
Move to the codecov action v4
mattlord Jan 16, 2024
a61bf8a
Fail fast for code coverage
mattlord Jan 16, 2024
a507a05
Ignore vttestserver related files
mattlord Jan 16, 2024
06ebcba
Don't remove vttestserver
mattlord Jan 16, 2024
f3ea9e0
Restore deleted e2e test files before codecov work
mattlord Jan 17, 2024
02eb2ac
Remove all e2e test files again
mattlord Jan 17, 2024
9fc549e
Try going back to codecov-action@v3
mattlord Jan 17, 2024
7a19e6d
Try to de-flake TestProbesPostDisable/aggregated
mattlord Jan 17, 2024
72cb0ca
Revert "Try going back to codecov-action@v3"
mattlord Jan 17, 2024
a7861b9
Revert "Try to de-flake TestProbesPostDisable/aggregated"
mattlord Jan 17, 2024
18f89bb
Merge remote-tracking branch 'origin/main' into codecov_tweaks
mattlord Jan 17, 2024
aa763f4
Count partial line coverage as a hit (line coverage)
mattlord Jan 17, 2024
5c2a044
Add e2e test dirs to codecov ignore list
mattlord Jan 19, 2024
56f139f
Ignore code generated files
mattlord Jan 21, 2024
a9850dd
Use new v4 GA action
mattlord Jan 31, 2024
54639be
Merge remote-tracking branch 'origin/main' into codecov_tweaks
mattlord Jan 31, 2024
b5ae453
Fix TestGetDir unit test
mattlord Jan 31, 2024
5e5bbd9
Try alternate ignore paths
mattlord Jan 31, 2024
c2fe9d2
Address review comment
mattlord Feb 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-beta
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=./... -coverprofile=coverage.out ./go/...
frouioui marked this conversation as resolved.
Show resolved Hide resolved
# 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
26 changes: 26 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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/test/endtoend"
- "go/*/endtoend"
- "go/vt/*/endtoend"
- "go/cmd/vttestserver" # This relies on end-to-end test packages
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we exclude all cached_size.go files as well as generated code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added here: 56f139f

Please let me know if you think we should remove any of the added ignore lines. Thanks!


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just stating for posterity that i'm good with this given that https://docs.codecov.com/docs/github-checks#hiding-annotations-in-the-files-view exists

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had no idea this existed, but tested and approved
image


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect


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)
Comment on lines +883 to +885
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated non-functional change that came up in a side discussion.

if err != nil {
return nil, err
}
Expand Down
Loading