8000 feat: merge coverage file and report to goverall by cutecutecat · Pull Request #1211 · tensorchord/envd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: merge coverage file and report to goverall #1211

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

Merged
merged 1 commit into from
Nov 21, 2022

Conversation

cutecutecat
Copy link
Member
@cutecutecat cutecutecat commented Nov 20, 2022

Signed-off-by: cutecutecat starkind1997@gmail.com

The action cutecutecat/go-cover-merge makes the wrapper of gocovmerge.

Caution: actions/download-artifact@v3 will create a directory of path, and put the actual artifact file inside that path when using argument path
So:

- name: Get cli e2e coverage report
  uses: actions/download-artifact@v3
  with:
    name: e2e-cli-coverage-out
    path: e2e-cli-coverage.out

will lead to a path of e2e-cli-coverage.out/e2e-cli-coverage.out

will close #636

@muniu-bot
Copy link
muniu-bot bot commented Nov 20, 2022

Welcome @cutecutecat! It looks like this is your first PR to tensorchord/envd 🎉

@cutecutecat
Copy link
Member Author
cutecutecat commented Nov 20, 2022

It seems worked.
The report for this PR is at https://coveralls.io/jobs/109861719

@gaocegege
Copy link
Member

The test coverage is reduced to 19% (from 46% to 19%)

https://coveralls.io/builds/54392418

@gaocegege
Copy link
Member

Is it expected?

@gaocegege
Copy link
Member

https://coveralls.io/builds/54392418/source?filename=pkg%2Fbuilder%2Fbuilder.go

I think the builder.New should be called in the test.

I am not sure if the merge is the intersection of these test coverage reports or the union set

@cutecutecat
Copy link
Member Author
cutecutecat commented Nov 21, 2022

Let we have a see. I have downloaded artifact from
https://github.com/tensorchord/envd/actions/runs/3508344790
and search lines about /pkg/builder/builder.go at all files
image

Is is reported that all lines about it only appeared in coverage.out, not e2e-cli-coverage.out or e2e-lang-coverage.out

and it is zero for most lines
image

I think there might be some neglect in previous coverage file generating procedure.

I will take some more time to trace the calling graph in testcases.

I am not sure if the merge is the intersection of these test coverage reports or the union set

Union it is
image

@cutecutecat
Copy link
Member Author

One of the caller of builder.New is

builder, err := builder.New(clicontext.Context, opt)

This line is traced in e2e-lang-coverage.out, but not step into the pkg/builder.

@cutecutecat
Copy link
Member Author
cutecutecat commented Nov 21, 2022

I suspect the problem is about -coverpkg=./pkg/app
at

envd/Makefile

Line 205 in 7f10440

-race -v -timeout 20m -coverpkg=./pkg/app -coverprofile=e2e-lang-coverage.out ./e2e/language

and

envd/Makefile

Line 196 in 7f10440

-race -v -timeout 20m -coverpkg=./pkg/app -coverprofile=e2e-cli-coverage.out ./e2e/cli

They restrict coverage trace scope inside pkg/app

Let me test this solution~

@gaocegege
Copy link
Member

Thanks for your time!

* pick go-cover-merge action to merge several coverage files
* upload merged file to coverall
* fix test coverpkg to whole pkg directory

Signed-off-by: cutecutecat <starkind1997@gmail.com>
@cutecutecat
Copy link
Member Author

https://coveralls.io/builds/54392418/source?filename=pkg%2Fbuilder%2Fbuilder.go

I think the builder.New should be called in the test.

I am not sure if the merge is the intersection of these test coverage reports or the union set

It might be solved now~

@gaocegege
Copy link
Member

Cool!

@gaocegege gaocegege merged commit e85f062 into tensorchord:main Nov 21, 2022
@gaocegege
Copy link
Member

@all-contributors Please add @cutecutecat for the code contribution!

@allcontributors
Copy link
Contributor

@gaocegege

I've put up a pull request to add @cutecutecat! 🎉

AlexXi19 pushed a commit to AlexXi19/envd that referenced this pull request Dec 12, 2022
feat: merge coverage file and report to coverall

* pick go-cover-merge action to merge several coverage files
* upload merged file to coverall
* fix test coverpkg to whole pkg directory

Signed-off-by: cutecutecat <starkind1997@gmail.com>

Signed-off-by: cutecutecat <starkind1997@gmail.com>
Signed-off-by: AlexXi19 <alex2001314jjj@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: No status
Development

Successfully merging this pull request may close these issues.

feat(CI): Merge the unit test and e2e test coverage report in CI.yaml
2 participants
0