Repository navigation
Check DeleteCollection actions in reconciler table tests - #3430
knative-prow[bot] merged 7 commits into
Conversation
Signed-off-by: suntp <20786998+suntp@users.noreply.github.com>
|
Welcome @suntp! It looks like this is your first PR to knative/pkg 🎉 |
|
Hi @suntp. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
| return nil | ||
| } | ||
|
|
||
| func TestTableRowDeleteCollections(t *testing.T) { |
There was a problem hiding this comment.
You can probably just create your own TableTest/Row test and not require the invocation of a test binary.
I'm assuming there is a precedent already set here
There was a problem hiding this comment.
Updated in f1819e3. Matching cases now call TableRow.Test directly, and mismatch cases capture diagnostics from the same row runner in process. All 24 cases pass, and the regression tests catch five deliberate mutations.
I also reproduced the two net-contour failures with selector-only expectations and verified that its full test suite passes locally with this change.
|
/ok-to-test |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3430 +/- ##
==========================================
+ Coverage 75.37% 75.41% +0.04%
==========================================
Files 189 189
Lines 8368 8371 +3
==========================================
+ Hits 6307 6313 +6
+ Misses 1819 1816 -3
Partials 242 242 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: suntp <20786998+suntp@users.noreply.github.com>
Signed-off-by: Dave Protasowski <dprotaso@gmail.com>
Signed-off-by: Dave Protasowski <dprotaso@gmail.com>
Signed-off-by: Dave Protasowski <dprotaso@gmail.com>
Signed-off-by: Dave Protasowski <dprotaso@gmail.com>
Signed-off-by: Dave Protasowski <dprotaso@gmail.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dprotaso, suntp The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Problem
TableRow.Testreads the fake clients’ action log but skipsWantDeleteCollections. A row passes both when reconciliation omits an expected collection delete and when it deletes a collection unexpectedly.Fixes #2455.
Solution
Compare the expected and recorded collection deletes in order, including label/field selectors and available client-go options such as list limits and dry run. Expectations with action metadata check the resource, subresource and namespace. A selector-only expectation checks the row’s namespace and leaves the resource and subresource unspecified.
SkipNamespaceValidationapplies in both cases.Validation results
go test -race -count=1 ./reconciler/... ./webhook/...TableRowregressionsnet-contourat51fa035a-racewith the updated table codeLimitations & follow-ups
This checks the calls made by the reconciler. Simulating deletion of matching objects in the fake tracker is a separate Kubernetes issue. kubernetes/kubernetes#105357