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

Improve unit test coverage of services repository #59

Open
yogeshbdeshpande opened this issue Nov 14, 2022 · 2 comments
Open

Improve unit test coverage of services repository #59

yogeshbdeshpande opened this issue Nov 14, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@yogeshbdeshpande
Copy link
Collaborator

Current test coverage is only 57%. Aim is to achieve >= 80%

@thomas-fossati
Copy link
Contributor

I am not sure where the 80% figure comes from, but it seems rather arbitrary to me: once a minimal threshold is reached (60%?) we should aim at good tests rather than abstract coverage figures.

Anyway, as a data point, the packages falling below the 80% threshold as of today 08/15/2024 are:

	github.com/veraison/services/config: 72.4%
	github.com/veraison/services/log: 63.9%
	github.com/veraison/services/policy: 75.9%
	github.com/veraison/services/scheme/arm-cca: 71.6%
	github.com/veraison/services/scheme/parsec-cca: 78.5%
	github.com/veraison/services/scheme/psa-iot: 77.2%
	github.com/veraison/services/scheme/riot: 63.7%
	github.com/veraison/services/scheme/tpm-enacttrust: 71.3%

Note that the coverage is at least 63.7%, which means it increased by nearly 7 points since this issue was created, which is a good sign.

We also have #252 to look at currently excluded sub-packages.

@setrofim
Copy link
Collaborator

It should also be noted that the stats we're looking at right now are per-subpackage unit tests. That is not always meaningful. It might be useful to get a picture of our actual, overall coverage of the code base.
This would involve a couple of things:

  • Getting absolude code path covereage counts (perhaps by parsing coveprofile's?), rather than percentanges, so that we can meaningfully combine them.
  • Including integration tests in coverage analysis, by running them with intrumented binaries (see https://go.dev/doc/build-cover#running).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants