Skip to content

Commit 816425a

Browse files
committed
test(cli): retarget the runtime-inventory rejection to a training recipe
TestRecipeCommandRejectsRuntimeInventoryWithoutComponent hardcoded gke/h100/cos/inference, which this branch makes declare k8s-aibom. The command now succeeds there, so the test failed asserting a rejection that no longer applies to those criteria. Retargeted to a training recipe, which does not declare the component, so the fail-closed path it covers is still exercised. The nil-error message now says to pick different criteria rather than relax the assertion, which is the same precondition pkg/client/v1's TestResolveRecipeRuntimeInventoryMode already pins explicitly. Signed-off-by: Mark Chmarny <mark@chmarny.com>
1 parent f225cc4 commit 816425a

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

pkg/cli/query_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,21 @@ func TestRecipeAndQueryCommandsRejectInvalidRuntimeInventoryMode(t *testing.T) {
342342
// TestRecipeCommandRejectsRuntimeInventoryWithoutComponent covers the flag-set
343343
// branch reaching a successful parse and then failing closed at build time,
344344
// which is the path an operator hits after a typo in --service.
345+
//
346+
// The criteria must name a recipe that does not declare k8s-aibom. Inference on
347+
// gke/h100/cos is the stock-adoption target under ADR-019's amendment and now
348+
// declares it, so this asserts against a training recipe instead. Mirrors the
349+
// same precondition in pkg/client/v1's TestResolveRecipeRuntimeInventoryMode.
345350
func TestRecipeCommandRejectsRuntimeInventoryWithoutComponent(t *testing.T) {
346351
err := recipeCmd().Run(t.Context(), []string{
347352
"recipe", "--service", "gke", "--accelerator", "h100",
348-
"--os", "cos", "--intent", "inference",
353+
"--os", "cos", "--intent", "training",
349354
"--runtime-inventory", "disabled",
350355
})
351356
if err == nil {
352-
t.Fatal("command error = nil, want rejection for a recipe that does not declare the component")
357+
t.Fatal("command error = nil, want rejection for a recipe that does not declare " +
358+
"the component; if these criteria now declare k8s-aibom, pick criteria that " +
359+
"do not rather than relaxing this assertion")
353360
}
354361
if !stderrors.Is(err, errors.New(errors.ErrCodeInvalidRequest, "")) {
355362
t.Errorf("command error = %v, want ErrCodeInvalidRequest", err)

0 commit comments

Comments
 (0)