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

tests: add coverage report and increase coverage #1089

Merged
merged 11 commits into from
Nov 26, 2024
Merged

Conversation

ffromani
Copy link
Member

add developer (not yet CI, if ever) facilities to see the test coverage, and improve unit test coverage for recently added packages

Useful for us to go chase where we can improve the unit test coverage.

Note the default top-level targets do NOT call the cover-variants
and, at this point in time, there's no reason why they ever should.

Signed-off-by: Francesco Romani <[email protected]>
add basic unit test coverage which was missing from the introducing PR

Signed-off-by: Francesco Romani <[email protected]>
add basic unit test coverage which was missing from the introducing PR

Signed-off-by: Francesco Romani <[email protected]>
add basic unit test coverage which was missing from the introducing PR

Signed-off-by: Francesco Romani <[email protected]>
Copy link
Contributor

openshift-ci bot commented Nov 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ffromani

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 21, 2024
@ffromani
Copy link
Member Author

/hold

more tests coming

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 21, 2024
@ffromani
Copy link
Member Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 22, 2024
@ffromani
Copy link
Member Author

 ERRO[2024-11-22T13:12:34Z] 
  * could not run steps: step ci-e2e-install-hypershift failed: "ci-e2e-install-hypershift" test steps failed: "ci-e2e-install-hypershift" pod "ci-e2e-install-hypershift-e2e-install-test" failed: could not watch pod: the pod ci-op-jv6b54pd/ci-e2e-install-hypershift-e2e-install-test failed after 2h0m22s (failed containers: test): ContainerFailed one or more containers exited 

infra issue (?!)

@shajmakh
Copy link
Member

Thanks for the valuable tests
/lgtm
/retest

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 22, 2024
@shajmakh
Copy link
Member

/hold
please unhold when you see fit

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 22, 2024
add basic unit test coverage which was missing from the introducing PR

Signed-off-by: Francesco Romani <[email protected]>
add missing (basic) test

Signed-off-by: Francesco Romani <[email protected]>
this code is obsolete since a good while.

Signed-off-by: Francesco Romani <[email protected]>
add explicit and basic test coverage for FindConditions

Signed-off-by: Francesco Romani <[email protected]>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 25, 2024
Copy link
Contributor

openshift-ci bot commented Nov 25, 2024

New changes are detected. LGTM label has been removed.

@ffromani
Copy link
Member Author

/hold cancel
LGTM gone anyway

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 25, 2024
more precise coverage run: let's focus on packages
we control, ignoring autogenerated functions (e.g. deepcopy)

Signed-off-by: Francesco Romani <[email protected]>
add initial base coverage for the only function
in the pkg which didn't had test coverage

Signed-off-by: Francesco Romani <[email protected]>
we have a dependency (govalidator) which we import for
exactly one function which is pretty simple to replace.
We do it in this patch.

Signed-off-by: Francesco Romani <[email protected]>
@ffromani
Copy link
Member Author

I think the problem is we lose events. This would explain the flakiness

/go/src/github.com/openshift-kni/numaresources-operator/test/e2e/install/install_test.go:281
  STEP: creating the KC object: kc-test @ 11/25/24 14:55:56.288
  STEP: creating the NRO object: numaresourcesoperator @ 11/25/24 14:55:56.305
  STEP: waiting for MCP to get updated @ 11/25/24 14:55:56.385
I1125 14:55:56.417562   36639 deploy.go:181] wait for mcp "worker" to meet condition "Updating"
I1125 14:55:58.431649   36639 machineconfig.go:71] mcp: "worker" condition type: "Updating" status is: "False" expected status: "True"
I1125 14:56:00.432313   36639 machineconfig.go:71] mcp: "worker" condition type: "Updating" status is: "False" expected status: "True"
I1125 14:56:02.433814   36639 machineconfig.go:71] mcp: "worker" condition type: "Updating" status is: "False" expected status: "True"
I1125 14:56:04.432292   36639 machineconfig.go:71] mcp: "worker" condition type: "Updating" status is: "False" expected status: "True" 

@ffromani
Copy link
Member Author

/retest-required

@ffromani
Copy link
Member Author

objects/pause likely needs to be updated and I'll likely have a pass in the coming future

@ffromani
Copy link
Member Author

/retest-required

@ffromani ffromani merged commit 4f38135 into main Nov 26, 2024
14 of 15 checks passed
@ffromani ffromani deleted the test-coverage-20241121 branch November 26, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants