openshift/migrate-e2e-to-integration
Migrate an oc-mirror e2e test case to the integration test suite, translating framework, registry, invocation, and assertion patterns
npx skills add https://github.com/openshift/oc-mirror --skill migrate-e2e-to-integration
Convert an existing e2e test case from tests/e2e/test/e2e/oc_mirror_v2.go into an integration test under tests/integration/.
The user provides one of:
Read AGENTS.md at the project root, and the documents at docs/testing for architecture, conventions, and pitfalls.
Search tests/e2e/test/e2e/oc_mirror_v2.go for the case number or description. Extract:
tests/e2e/test/e2e/testdata/)Do not attempt a 1:1 translation of the test case, consider if it makes sense at a high level, if it's already covered at the integration or unit levels, if the assertions are sound, if it could be made more efficient, etc.
Read integration test files in tests/integration/ to verify the scenario isn't already covered. If it is, tell the user and suggest what additional value the e2e case provides, if any.
Before writing any code, present a detailed plan to the user and wait for approval. The plan must include:
Do not proceed to implementation until the user approves the plan. If the user requests changes, revise and re-present.
Apply these conversions:
createregistry(), TLS trust via trustCert(), pull secret extraction.testRegistry global — it's started in BeforeEach and stopped in AfterEach automatically. No TLS or pull secret setup needed.oc.WithoutNamespace().WithoutKubeconf().Run("mirror").Args(...) with manual flag construction.runner methods from tests/integration/pkg/ocmirror/:runner.MirrorToMirror(ctx, iscPath, workDir, registryEndpoint, ...extraFlags)runner.MirrorToDisk(ctx, iscPath, workDir, ...extraFlags)runner.DiskToMirror(ctx, iscPath, workDir, registryEndpoint, ...extraFlags)runner.DeletePhaseOne(ctx, discPath, workDir, registryEndpoint, ...extraFlags)runner.DeletePhaseTwo(ctx, deleteYaml, registryEndpoint, ...extraFlags)runner.ListOperators(ctx, ...args)runner.ListReleases(ctx, ...args)wait.Poll() and manual retry loops.o.Expect(...) on command output, manual image inspection.tests/integration/helpers_test.go:expectOcMirrorCommandSuccess(result, err)expectSuccessfulMirrorInRegistry(iscPath, registry)expectCorrectIDMS(workDir, iscPath)expectValidDeleteImagesFiles(workDir, deleteID)expectEmptyRegistry(registry)expect* naming pattern for any new helpers.quay.io/oc-mirror/oc-mirror-dev:test-catalog-latestquay.io/oc-mirror/release/test-release-index:v0.0.1quay.io/openshifttest/hello-openshift@sha256:61b8f5...tests/integration/testdata/imagesetconfigs/ first.Follow the automate-integration-test skill for the writing conventions:
tests/integration/integration_suite_test.go and tests/integration/helpers_test.go for current patternsDescribe / Context / It / ByBefore running, verify:
Ask permission, then run:
PATH=$PATH:<path-to-registry-bin> go test -v ./tests/integration/ --ginkgo.focus "<test label>"
After the integration test passes, advise the user:
Take openshift/migrate-e2e-to-integration from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.