vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.63k stars 2.1k forks source link

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

Closed maohong closed 1 year ago

maohong commented 1 year ago

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

mattlord commented 1 year ago

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: https://github.com/vitessio/vitess/commit/3e9f4c77f4d7800075dfda0e60d12a945f5d2eb5

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

mattlord commented 1 year ago

FWIW, you can generate this data as follows:

git checkout git@github.com:vitessio/vitess.git
cd vitess

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

make build
make unit_test_cover
mattlord commented 1 year ago

@maohong You can see results from my up-to-date fork in the description here: https://github.com/vitessio/vitess/pull/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 commented 1 year ago

Got it! Thanks @mattlord

mattlord commented 9 months ago

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).