Follow-up from "test(managementapi): cover the container upstream associate refusals and update part 13/15 (S17 Phase 6 plan: 42/42)"
The following discussions from !2858 (merged) should be addressed:
-
@vespian_gl started a discussion:
non-blocking: This test does not build a foreign upstream. Both iterations set the same
associateErr(datastore.ErrVirtualUpstreamNotFound) under the default evaluator of the rig, which reads every upstream as readable. For an upstream in another namespace, the one input that differs at the handler is theupstreamReadableverdict, which runs beforearm.store.Associate. Thus, if the handler starts to answer an unreadable upstream differently, this test still passes.TestContainerUpstreams_Associate_OmitsAnUnreadableUpstreamsFieldscovers only part of that. Also, the doc comment says that the responses are "compared byte for byte past the per-request id", but the test compares onlycode|message.TestContainerUpstreams_Associate_RefusesSelfReferenceAndTombstonedUpstreamat line 788 has the same pattern. The fake returnsassociateErrbefore its splice, whatever id arrives, and the rig seeds no rows. Thusassert.Empty(tt, rig.store.Rows())at line 829 is true by construction.For the foreign iteration, you should install
readableUpstreamsEvaluator()with no readable ids. Then comparerec.Codeand the wholerec.Body, or change the comment to say that it compares the code and the message only. For the self-reference table, you can remove theRows()assertion, or say in the comment that the store owns the refusal and this table pins only the error mapping. The npm twins have the same shape, so the same edits apply there if you want the pair to stay the same.This is a bot message
🤖 — /mergeable -
@vespian_gl started a discussion:
non-blocking: This assertion cannot fail on any row of the table. The rig seeds one row, and a list of one row cannot show a move. On the rows that set
repositionErr, the fake returns before it changes the list. On the two400rows, a handler that skipped the400callsRepositionwith position 1. The fake computesmin(1, 1) - 1 = 0and leaves the row at position 1. The status assertion catches that regression, so this line adds no coverage of its own.On the rows that set no
err, you should assertassert.Empty(tt, rig.store.Repositions()), because the fake records each call. Another option is to seed two rows and send a position that moves row 1.TestNpmUpstreams_Update_RejectsBadRequestshas the same assertion on the same fixture, so the same change applies there if you want theduplpair to stay the same.This is a bot message
🤖 — /mergeable -
@vespian_gl started a discussion:
non-blocking: This test seeds the same two rows as
TestContainerUpstreams_List_ReturnsThePositionOrderedSetat line 135, and it sends the sameGET. The older test callsassertUpstreamResourceon both rows. That helper already comparessummary["format"]withwantSummaryFormats[want.UpstreamFormat]. Thus no handler change fails this test and passes the older one.You should remove this test, or give it a state that the older test does not build.
This is a bot message
🤖 — /mergeable