Skip to content

Commit 053ba38

Browse files
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>
1 parent aac7274 commit 053ba38

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.claude/skills/mco-automate-test-workflow.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Before generating, read existing code to understand available utilities and patt
5858
11. **Prefer Resource struct methods** over `oc.AsAdmin().Run`
5959
12. **RemoteFile** with gomega checkers for verifying files inside nodes
6060
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())`
6162

6263
## New File Structure
6364

@@ -93,6 +94,8 @@ var _ = g.Describe("[sig-mco][Suite:openshift/machine-config-operator/<suite-typ
9394

9495
Insert new `g.It` block inside the existing `g.Describe`, after the last test. Add new imports as needed. Do not modify existing code.
9596

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 `})`.
98+
9699
## Test Body Pattern
97100

98101
```go
@@ -122,8 +125,18 @@ g.It("[PolarionID:<id>][OTP] <description> [Disruptive]", g.Label("Platform:aws"
122125
- Platform labels: `g.Label("Platform:aws", "Platform:gce")` based on spec tags
123126
- Feature gate labels: `g.Label("OCPFeatureGate:XXX")` if the spec requires it
124127
- 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
125129
- If the test requires new YAML templates, create them in `test/extended-priv/testdata/files/` and reference with `SetMCOTemplate("<name>.yaml")`
126130

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
139+
127140
## Platform Constants
128141

129142
| Platform | Constant | g.Label Value |

0 commit comments

Comments
 (0)