From microshift-dev
Generate test cases for a Jira OCPSTRAT ticket and automate them using Robot Framework
How this skill is triggered — by the user, by Claude, or both
Slash command
/microshift-dev:generate-testsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
```bash
/microshift-dev:generate-tests JIRA-TICKET-ID
Generate comprehensive Robot Framework test coverage for MicroShift/OpenShift features based on Jira OCPSTRAT tickets.
NOTE: For other projects or to customize this workflow, see TEMPLATE.md alongside this skill for a generic template you can adapt.
Jira Access: This command requires access to Red Hat Jira (https://issues.redhat.com).
Fallback: If Jira access fails, you'll be prompted to manually provide:
https://issues.redhat.com/browse/<JIRA-TICKET-ID>VALIDATION - Check for sufficient information: After analyzing the ticket, verify:
If BOTH conditions fail (no detailed description AND no PR links):
Ask user for additional information: "The OCPSTRAT ticket lacks detailed information for test generation. It's missing:
Please provide ONE of the following to continue:
Or type 'skip' to proceed with limited information (may result in generic tests)."
Wait for user response:
If at least ONE condition passes, proceed to Step 2.
Create test case document in current working directory: test_cases_OCPSTRAT-XXXX.md
Focus ONLY on the 10 most impactful test scenarios NOT already covered:
For each test, provide:
BEFORE writing any tests:
Common keyword locations to check:
test/extended/util/*.robot - Utility keywordsresources/**/*.robot - Shared resource filesWhen creating tests:
Robot Framework Test File Creation Process:
test_cases_OCPSTRAT-XXXX.mdbackup-restore-on-reboot.robot, multi-nic.robot, isolated-network.robottest/suites/<category>/ subdirectory:
test/suites/network/<feature-name>.robot (e.g., coredns-hosts-file.robot)<feature-name>.robot (kebab-case, lowercase)CRITICAL Robot Framework Teardown Rules:
Run Keyword And Ignore ErrorRun Keyword And Ignore Error in ANY teardown section[Teardown], Suite Teardown, Test Teardown, and keyword teardownsRun Keyword And Ignore Error in test cases/setup when you need conditional logicCorrect Teardown Example:
Suite Teardown Cleanup Test Resources
Cleanup Test Resources
[Documentation] Clean up all test resources
Oc Delete pod --all -n ${NAMESPACE}
Remove Test Files
Restart MicroShift
Incorrect Teardown (DON'T DO THIS):
Suite Teardown Run Keyword And Ignore Error Cleanup Test Resources
Cleanup Test Resources
Run Keyword And Ignore Error Oc Delete pod --all -n ${NAMESPACE}
Run Keyword And Ignore Error Remove Test Files
Keyword Reuse Example:
# GOOD - Reusing existing keywords
*** Test Cases ***
Test CoreDNS Hosts File
[Documentation] Test hosts file resolution
Setup MicroShift Config dns.hostsFile=/etc/custom-hosts
Restart MicroShift
Wait For MicroShift Ready
Deploy Test Pod dns-test ${NAMESPACE}
${ip}= Resolve Hostname In Pod dns-test ${NAMESPACE} test.local
Should Be Equal ${ip} 192.168.1.100
# BAD - Creating duplicate keywords
*** Keywords ***
My Custom MicroShift Restart
[Documentation] Restart MicroShift (DON'T DO THIS - use existing keyword!)
Run Process systemctl restart microshift
Sleep 10s
IMPORTANT: Before creating git branch, WAIT for user confirmation.
Ask user for confirmation:
Prompt user: "Would you like me to create a new git branch in the microshift repository? The branch will be named test-OCPSTRAT-XXXX-YYYYMMDD. (yes/no)"
If user confirms (yes):
test-OCPSTRAT-XXXX-$(date +%Y%m%d)Prompt user: "Please provide the full path to your microshift repository (e.g., /home/username/microshift):"
Commands (use the path provided by user):
cd <user-provided-microshift-repo-path>
git status
git checkout -b test-OCPSTRAT-XXXX-$(date +%Y%m%d)
git branch --show-current
After branch is created, create Robot Framework test file directly in the microshift repository:
Determine appropriate test suite directory based on feature type
test/suites/network/test/suites/storage/test/suites/backup/Create the .robot file with kebab-case naming convention
test/suites/network/coredns-hosts-file.robotImplement the top 3-5 most critical tests from Step 3
Add file to git staging
Commands (use the user-provided microshift repository path):
# After file is created, stage it
cd <user-provided-microshift-repo-path>
git add test/suites/<category>/<feature-name>.robot
git status
Output to user:
<user-provided-microshift-repo-path>test/suites/<category>/<feature-name>.robotProvide:
npx claudepluginhub openshift-eng/edge-tooling --plugin microshift-devGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.