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

✨ Single test target / workflow #471

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

akutz
Copy link
Collaborator

@akutz akutz commented Apr 16, 2024

What does this PR do, and why is it needed?

This patch simplifies the Makefile test targets so there is now a single test target named "test". There is also a single test workflow in GitHub, reducing the duplicate tests that would run as part of the old unit/integration test division.

This patch also updates the code coverage workflow to warn if coverage falls below the minimum instead of failing the job.

Which issue(s) is/are addressed by this PR? (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Fixes NA

Are there any special notes for your reviewer:

Please add a release note if necessary:

Simplify testing with a single Makefile target named "test"

@github-actions github-actions bot added the size/M Denotes a PR that changes 30-99 lines. label Apr 16, 2024
@akutz akutz force-pushed the feature/single-test-target branch 2 times, most recently from 94b58b9 to 30580d5 Compare April 16, 2024 14:53
This patch simplifies the Makefile test targets so there
is now a single test target named "test". There is also
a single test workflow in GitHub, reducing the duplicate
tests that would run as part of the old unit/integration
test division.
@akutz akutz force-pushed the feature/single-test-target branch from 30580d5 to f371a90 Compare April 16, 2024 14:54
Copy link

Code Coverage

Package Line Rate Health
github.com/vmware-tanzu/vm-operator/api/v1alpha1 42%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/clustercontentlibraryitem 82%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/contentlibraryitem 86%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils 32%
github.com/vmware-tanzu/vm-operator/controllers/infra/configmap 71%
github.com/vmware-tanzu/vm-operator/controllers/infra/node 77%
github.com/vmware-tanzu/vm-operator/controllers/infra/secret 77%
github.com/vmware-tanzu/vm-operator/controllers/util/encoding 73%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine 70%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineclass 21%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest 81%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice 83%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/providers 92%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesetresourcepolicy 81%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1 72%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions 88%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1/patch 78%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha2 73%
github.com/vmware-tanzu/vm-operator/controllers/volume 85%
github.com/vmware-tanzu/vm-operator/pkg/conditions 88%
github.com/vmware-tanzu/vm-operator/pkg/config 100%
github.com/vmware-tanzu/vm-operator/pkg/config/env 100%
github.com/vmware-tanzu/vm-operator/pkg/patch 16%
github.com/vmware-tanzu/vm-operator/pkg/prober 54%
github.com/vmware-tanzu/vm-operator/pkg/prober/probe 90%
github.com/vmware-tanzu/vm-operator/pkg/prober/worker 77%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere 70%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/client 57%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/clustermodules 71%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/config 72%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/contentlibrary 72%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/credentials 100%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/network 80%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/placement 77%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/session 36%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/sysprep 100%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/vcenter 79%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/virtualmachine 77%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/vmlifecycle 65%
github.com/vmware-tanzu/vm-operator/pkg/record 78%
github.com/vmware-tanzu/vm-operator/pkg/topology 55%
github.com/vmware-tanzu/vm-operator/pkg/util 78%
github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit 89%
github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit/validate 91%
github.com/vmware-tanzu/vm-operator/pkg/util/image 100%
github.com/vmware-tanzu/vm-operator/pkg/util/kube 90%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/client 68%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/vm 78%
github.com/vmware-tanzu/vm-operator/pkg/webconsolevalidation 51%
github.com/vmware-tanzu/vm-operator/webhooks/common 100%
github.com/vmware-tanzu/vm-operator/webhooks/persistentvolumeclaim/validation 95%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/mutation 84%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/validation 95%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/mutation 62%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinepublishrequest/validation 92%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/mutation 67%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/validation 92%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesetresourcepolicy/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation 92%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation 92%
Summary 68% (7668 / 11346)

@akutz akutz merged commit 85382b7 into vmware-tanzu:main Apr 16, 2024
12 checks passed
@akutz akutz deleted the feature/single-test-target branch April 16, 2024 15:19
@aruneshpa
Copy link
Contributor

This patch also updates the code coverage workflow to warn if coverage falls below the minimum instead of failing the job.

Why are we not failing the job if coverage drops below a threshold?

@akutz
Copy link
Collaborator Author

akutz commented Apr 16, 2024

This patch also updates the code coverage workflow to warn if coverage falls below the minimum instead of failing the job.

Why are we not failing the job if coverage drops below a threshold?

Because adding a single test to v1a2 means the package is now covered, dropping our percentage from 70 to ~50. We had no tests in v1a2 before, but I added two for the two differences from v1a2 to v1a3.

The right thing to do would be to add tests to cover all of v1a2 conversion, but since it's a 1-to-1 with v1a3 except for those two differences, it was a tall order for that reason.

FWIW, on the topic of ignoring bits of a project for coverage, see:

Unfortunately there is no good way to exclude a single package from coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-not-required size/M Denotes a PR that changes 30-99 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants