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

🐛 Ensure all ownerRef assertions for some Kind are evaluated #10590

Merged
merged 1 commit into from
May 13, 2024

Conversation

dlipovetsky
Copy link
Contributor

What this PR does / why we need it:
The assertFuncs are passed as a list*. Previously, if two assertFuncs were defined for the same Kind, the assertFunc that appeared later in the list would overwrite the one that appeared earlier.

If someone introduced a second assertFunc for a given Kind, they would receive no signal that the first assertFunc was overwritten. A test relying on the first assertion would give a false positive.

With this change, if two or more assertFuncs are defined for the same Kind, both are evaluated.

* Example:

framework.CoreOwnerReferenceAssertion,
framework.ExpOwnerReferenceAssertions,
framework.DockerInfraOwnerReferenceAssertions,
framework.KubeadmBootstrapOwnerReferenceAssertions,
framework.KubeadmControlPlaneOwnerReferenceAssertions,
framework.KubernetesReferenceAssertions,

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

/area e2e-testing

The assertFuncs are passed as a list. Previously, if two assertFuncs
were defined for the same Kind, the assertFunc that appeared later
in the list would overwrite the one that appeared earlier.

If someone introduced a second assertFunc for a given Kind, they would
receive no signal that the first assertFunc was overwritten. That would
result in missed assertions.

With this change, if two or more assertFuncs are defined for the same
Kind, both are evaluated.
@k8s-ci-robot k8s-ci-robot added area/e2e-testing Issues or PRs related to e2e testing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 11, 2024
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 11, 2024
@dlipovetsky dlipovetsky changed the title test: Ensure ownerRef assertions for all Kinds are evaluated 🐛 test: Ensure ownerRef assertions for all Kinds are evaluated May 11, 2024
@dlipovetsky dlipovetsky changed the title 🐛 test: Ensure ownerRef assertions for all Kinds are evaluated 🐛 test: Ensure all ownerRef assertions for some Kind are evaluated May 11, 2024
@enxebre
Copy link
Member

enxebre commented May 13, 2024

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 13, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: f5c3cea91b7fbd6c514ec7120a2f3c549bce81b9

@chrischdi
Copy link
Member

/approve

@chrischdi
Copy link
Member

/cherry-pick release-1.7

@k8s-infra-cherrypick-robot

@chrischdi: once the present PR merges, I will cherry-pick it on top of release-1.7 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.7

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrischdi

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 13, 2024
@chrischdi
Copy link
Member

/cherry-pick release-1.6

@k8s-infra-cherrypick-robot

@chrischdi: once the present PR merges, I will cherry-pick it on top of release-1.6 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot merged commit 7335ac4 into kubernetes-sigs:main May 13, 2024
31 of 32 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.8 milestone May 13, 2024
@k8s-infra-cherrypick-robot

@chrischdi: new pull request created: #10592

In response to this:

/cherry-pick release-1.7

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-infra-cherrypick-robot

@chrischdi: #10590 failed to apply on top of branch "release-1.6":

Applying: test: Ensure ownerRef assertions for all Kinds are evaluated
Using index info to reconstruct a base tree...
M	test/framework/ownerreference_helpers.go
Falling back to patching base and 3-way merge...
Auto-merging test/framework/ownerreference_helpers.go
CONFLICT (content): Merge conflict in test/framework/ownerreference_helpers.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 test: Ensure ownerRef assertions for all Kinds are evaluated
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@sbueringer sbueringer changed the title 🐛 test: Ensure all ownerRef assertions for some Kind are evaluated 🐛 Ensure all ownerRef assertions for some Kind are evaluated Jul 19, 2024
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. area/e2e-testing Issues or PRs related to e2e testing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants