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

Question: Is there a unit test coverage metric for vitess? #14326

Closed
maohong opened this issue Oct 21, 2023 · 5 comments · Fixed by #14333
Closed

Question: Is there a unit test coverage metric for vitess? #14326

maohong opened this issue Oct 21, 2023 · 5 comments · Fixed by #14333

Comments

@maohong
Copy link

maohong commented Oct 21, 2023

Question

Hi,
We are investigating Vitess and considering using Vitess in live, just wondering what is the current test coverage of the code base? I tried to find this data but could't find it.

Thanks

@maohong maohong added Needs Triage This issue needs to be correctly labelled and triaged Type: Question labels Oct 21, 2023
@mattlord
Copy link
Contributor

We don't have any automated coverage report setup on the repo ATM that I'm aware of. We did at one point but I believe it had stopped working and thus we removed it: 3e9f4c7

This is something that we'd have to get setup and working.

@mattlord
Copy link
Contributor

FWIW, you can generate this data as follows:

git checkout [email protected]:vitessio/vitess.git
cd vitess

git apply https://gist.github.com/mattlord/41bab0464840a95808dde509b81150d5

make build
make unit_test_cover

@mattlord mattlord self-assigned this Oct 22, 2023
@mattlord mattlord added Type: Feature Component: General Changes throughout the code base and removed Needs Triage This issue needs to be correctly labelled and triaged labels Oct 22, 2023
@mattlord mattlord added Component: Build/CI and removed Component: General Changes throughout the code base labels Oct 22, 2023
@mattlord
Copy link
Contributor

mattlord commented Oct 22, 2023

@maohong You can see results from my up-to-date fork in the description here: #14333

A couple of notes:

  1. That is not excluding a lot of things which aren't part of vitess production usage (various tools etc). That may change.
  2. This is for unit tests only. We also have extensive endtoend tests (which make up all but a few of the GitHub Actions workflows on PRs): https://github.com/vitessio/vitess/tree/main/go/test/endtoend

@maohong
Copy link
Author

maohong commented Oct 23, 2023

Got it! Thanks @mattlord

@maohong maohong closed this as completed Nov 5, 2023
@mattlord
Copy link
Contributor

mattlord commented Feb 2, 2024

Just an update that we finally got things setup and working as we'd like (e.g. enabling cross package coverage) and the number is now at 71% as you can see in the badge and its link: https://github.com/vitessio/vitess/blob/main/README.md

That's still without including the endtoend tests, which we still want to do (will be more involved, however).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants