fix(tests): strengthen UAT recipe and validation assertions#537
Open
ayuskauskas wants to merge 1 commit intomainfrom
Open
fix(tests): strengthen UAT recipe and validation assertions#537ayuskauskas wants to merge 1 commit intomainfrom
ayuskauskas wants to merge 1 commit intomainfrom
Conversation
Contributor
|
/lgtm |
yuanchen8911
approved these changes
Apr 10, 2026
Contributor
yuanchen8911
left a comment
There was a problem hiding this comment.
Cross-reviewed by Claude Code, Codex, and CodeRabbit — all 3 independently verified component lists, constraints, and deployment orders against overlay chains for all 4 CUJs. CTRF assertion structure validated. No findings.
Coverage Report ✅
Coverage BadgeNo Go source files changed in this PR. |
Replace trivially-passing UAT assertions with full structural checks. Recipe assertions now verify every expected component by name (aligned with existing golden files), and validation assertions use Chainsaw to check CTRF report structure instead of weak grep patterns. Closes #498 Made-with: Cursor
20ed45c to
2ef4464
Compare
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace trivially-passing UAT assertions with full structural checks. Recipe assertions now verify every expected component by name (aligned with existing golden files), and validation assertions use Chainsaw to check CTRF report structure instead of weak grep patterns.
Closes #498
Summary
Strengthen UAT
assert-recipe.yamland validation assertions to verify expected component names, constraints, and deployment order instead of just checkingcomponentRefscount > 0 and grepping for CTRF.Motivation / Context
UAT assertions were trivially passing — a recipe with a single wrong component would pass, and
|| trueon validate steps masked real failures. As new cloud/accelerator variants are added, every new UAT suite inherits these gaps.Fixes: #498
Related: N/A
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/api,pkg/server)pkg/recipe)pkg/bundler,pkg/component/*)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/)tests/uat/)Implementation Notes
Recipe assertions (4 files rewritten):
(length(componentRefs) > 0): truewith full structural match:componentRefs(every component by name, alphabetically sorted),constraints, anddeploymentOrdertests/chainsaw/cli/cuj1-training/andtests/chainsaw/ai-conformance/offline/)aicr recipeoutput — 11 training / 14 inference components includingprometheus-adapterfrom the cross-cuttingmonitoring-hpaoverlayValidation assertions (4 files rewritten + 4 new):
assert-validate-multiphase.yamlwith Chainsaw-compatible assertions: structural match forfailed: 0,pending: 0,other: 0; JMESPath for(results.summary.tests > 0)and(results.summary.skipped == results.summary.tests)(the--no-clustercontract)assert-validate-deployment.yamlfiles (same assertions)== `0`JMESPath comparisons, so zero-value fields use direct structural match insteadChainsaw test flow (4 files updated):
|| truefrom bothvalidate-deploymentandvalidate-multiphasesteps — failures are now surfaced instead of silently swallowedgrep-based assertion steps withpython3JSON wrapper (injectsapiVersion/kindfor Chainsaw) +chainsaw assertagainst the assertion filestests/chainsaw/cli/bundle-scheduling/which prepends synthetic headers for non-Kubernetes resourcesTesting
Risk Assessment
Rollout notes: YAML-only changes to UAT test assertions. No Go code, no runtime behavior changes. UAT environments need
python3on PATH (standard on GitHub-hosted runners). If overlay changes add/remove components, the correspondingassert-recipe.yamlmust be updated — this is intentional to catch stale UAT tests.Checklist
make testwith-race)make lint) — yamllint clean; Go lint failures are pre-existing intests/chainsaw/ai-conformance/main.gogit commit -S)