You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add SNO/Compact skip, step verification, and helper ordering conventions
Address reviewer feedback:
- Convention #14: skip tests on SNO/Compact when multiple nodes needed
- Generation rule for IsCompactOrSNOCluster skip at test body start
- Post-generation verification to ensure 1:1 spec step coverage
- Helper functions must be appended at end of file, not inserted between existing ones
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Copy file name to clipboardExpand all lines: .claude/skills/mco-automate-test-workflow.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,7 @@ Before generating, read existing code to understand available utilities and patt
58
58
11.**Prefer Resource struct methods** over `oc.AsAdmin().Run`
59
59
12.**RemoteFile** with gomega checkers for verifying files inside nodes
60
60
13.**Concise comments** — one or two lines maximum
61
+
14.**Skip on SNO/Compact** when the test requires multiple nodes or a dedicated worker pool: `if IsCompactOrSNOCluster(oc.AsAdmin()) { g.Skip("...") }` or `exutil.SkipOnSingleNodeTopology(oc.AsAdmin())`
61
62
62
63
## New File Structure
63
64
@@ -93,6 +94,8 @@ var _ = g.Describe("[sig-mco][Suite:openshift/machine-config-operator/<suite-typ
93
94
94
95
Insert new `g.It` block inside the existing `g.Describe`, after the last test. Add new imports as needed. Do not modify existing code.
95
96
97
+
If the test requires new helper functions, append them **after all existing functions** at the end of the file — never insert between existing functions. Helper functions belong outside the `g.Describe` block, after its closing `})`.
- Platform labels: `g.Label("Platform:aws", "Platform:gce")` based on spec tags
123
126
- Feature gate labels: `g.Label("OCPFeatureGate:XXX")` if the spec requires it
124
127
- Skip functions for platform/architecture: `skipTestIfSupportedPlatformNotMatched(oc, AWSPlatform, GCPPlatform)`, `architecture.SkipNonAmd64SingleArch(oc)`
128
+
- Skip on SNO/Compact: if the test needs more than one node or a dedicated worker pool, add `if IsCompactOrSNOCluster(oc.AsAdmin()) { g.Skip("This test requires multiple nodes and cannot run on SNO/Compact clusters") }` at the start of the test body
125
129
- If the test requires new YAML templates, create them in `test/extended-priv/testdata/files/` and reference with `SetMCOTemplate("<name>.yaml")`
126
130
131
+
## Post-Generation Verification
132
+
133
+
After generating the test code, verify completeness:
134
+
135
+
1. Extract every numbered step, precondition check, and expected result from the specification
136
+
2. Map each to an `exutil.By()` block in the generated code
137
+
3. Confirm 1:1 coverage — every spec step must have a corresponding `exutil.By()` block
138
+
4. Report any missing steps and add the missing `exutil.By()` blocks before finalizing
0 commit comments