Skip to content

Commit 89245a0

Browse files
Merge pull request #5879 from HarshwardhanPatil07/improve-migrate-tests-skill
MCO-2201: Improve /migrate-tests skill: default labels and ordering verification
2 parents d688ae2 + 544412a commit 89245a0

2 files changed

Lines changed: 10 additions & 13 deletions

File tree

.claude/commands/migrate-tests.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ Migrate MCO test files from `openshift-tests-private/test/extended/mco/` to `mac
88
Use the transformation rules in `.claude/skills/mco-migration-workflow.md` for all domain-specific mappings (imports, test names, qualifiers, paths).
99

1010
**Workflow:**
11-
1. Ask for source repo, destination repo, compat_otp path (optional), filename, and target suite (longduration or disruptive, default: longduration). Check memory (`migrate_tests_config.md`) for saved paths.
11+
1. Ask for source repo, destination repo, compat_otp path (optional), and filename. Check memory (`migrate_tests_config.md`) for saved paths.
1212
2. Analyze the source file — identify tests, helpers, templates, and compat_otp dependencies. Check what already exists in destination.
1313
3. Migrate — apply all transformations, copy templates, migrate helpers. Don't simplify or refactor code. Preserve function order from source.
1414
4. Build with `make machine-config-tests-ext` and verify migrated tests appear in listing. Fix build errors iteratively.
15-
5. Save paths to memory for next run.
15+
5. **Verify ordering** — compare the sequence of functions, test cases (g.It), and helpers in the destination file against the source file. Report any ordering mismatches and fix them.
16+
6. Save paths to memory for next run.

.claude/skills/mco-migration-workflow.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,13 @@ Source:
4040
g.Describe("[sig-mco] MCO <SuiteName>", func() {
4141
```
4242
43-
Destination (longduration — default):
43+
Destination:
4444
```go
4545
g.Describe("[sig-mco][Suite:openshift/machine-config-operator/longduration][Serial][Disruptive] MCO <SuiteName>", func() {
4646
```
4747
48-
Destination (disruptive):
49-
```go
50-
g.Describe("[sig-mco][Suite:openshift/machine-config-operator/disruptive][Serial][Disruptive] MCO <SuiteName>", func() {
51-
```
52-
53-
- Ask the user which suite to use: `longduration` (default) or `disruptive`
54-
- `[Serial][Disruptive]` is **always required** — in the new framework `[Disruptive]` no longer implies `[Serial]`
48+
- Both `[Serial]` and `[Disruptive]` are **always applied by default** — do not ask which suite to use
49+
- In the new framework `[Disruptive]` no longer implies `[Serial]`, so both must be present
5550
5651
## Test Name Transformation (g.It blocks)
5752
@@ -113,8 +108,9 @@ make machine-config-tests-ext
113108
114109
## Workflow
115110
116-
1. **Collect inputs** — source repo path, destination repo path, compat_otp path (optional), filename to migrate, and target suite (`longduration` default, or `disruptive`). Check memory (`migrate_tests_config.md`) for saved paths.
111+
1. **Collect inputs** — source repo path, destination repo path, compat_otp path (optional), and filename to migrate. Both `[Serial]` and `[Disruptive]` labels are always applied by default (do not ask). Check memory (`migrate_tests_config.md`) for saved paths.
117112
2. **Analyze** — read source file, identify tests/helpers/templates/compat_otp deps, check what already exists in destination.
118113
3. **Migrate** — apply all transformations above, copy templates, migrate helper functions and compat_otp utilities as needed.
119-
4. **Verify** — build and confirm migrated tests appear in listing. Fix any build errors iteratively.
120-
5. **Save paths** to memory for next run.
114+
4. **Verify build** — build and confirm migrated tests appear in listing. Fix any build errors iteratively.
115+
5. **Verify ordering** — compare the sequence of all functions (test case functions, helper functions, and `g.It` blocks) in the destination file against their order in the source file. List any mismatches and fix them before proceeding.
116+
6. **Save paths** to memory for next run.

0 commit comments

Comments
 (0)