-
Notifications
You must be signed in to change notification settings - Fork 111
Add testing plugin for comprehensive test case generation #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add testing plugin for comprehensive test case generation #106
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BhargaviGudi The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Hi @BhargaviGudi. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
7eb396c to
0e3b85e
Compare
|
/ok-to-test |
0e3b85e to
3cd0f46
Compare
|
@ngopalak-redhat: changing LGTM is restricted to collaborators In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
…priority filtering and DOCX export enhance: Add codebase analysis to make testing plugin context-aware and repository-specific Immediately proceed to generating test cases (no confirmation prompt) Renamed slash command from create-testcases to generate-test-case-doc
4b4f2a0 to
e620814
Compare
WalkthroughThis PR introduces a new Testing plugin that provides test case generation and QA automation capabilities. The plugin includes a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant Command
participant Generator
participant DOCX_Skill
participant Output
User->>CLI: /testing:generate-test-case-doc --priority high --format DOCX
CLI->>Command: Parse arguments & validate options
Command->>Generator: Analyze repo (docs, tests, code, config, deps)
Generator->>Generator: Create test cases (functional, regression, smoke, edge, security, performance)
Generator->>Generator: Filter by priority & component
Generator->>Output: Generate test_cases.md
alt Format == DOCX
Command->>DOCX_Skill: convert_markdown_to_docx(test_cases.md)
DOCX_Skill->>DOCX_Skill: Parse Markdown (headings, tables, code, lists)
DOCX_Skill->>DOCX_Skill: Apply document styling (fonts, colors)
DOCX_Skill->>Output: Generate test_cases.docx
end
Output-->>User: Returns output file paths & summary
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (6 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
plugins/testing/skills/testcase-doc-generator/generate_docx.py (1)
277-281: Consider more specific exception handling.The broad
Exceptioncatch is flagged by Ruff. While acceptable for a CLI tool, consider catching more specific exceptions for better error diagnosis.Apply this diff for more specific error handling:
# Convert try: convert_markdown_to_docx(args.input, args.output, args.title) - except Exception as e: + except (OSError, ValueError, UnicodeDecodeError) as e: print(f"Error converting markdown to DOCX: {e}", file=sys.stderr) sys.exit(1) + except Exception as e: + print(f"Unexpected error: {e}", file=sys.stderr) + sys.exit(1)Based on learnings
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (8)
.claude-plugin/marketplace.json(1 hunks)PLUGINS.md(2 hunks)docs/data.json(1 hunks)plugins/testing/.claude-plugin/plugin.json(1 hunks)plugins/testing/README.md(1 hunks)plugins/testing/commands/generate-test-case-doc.md(1 hunks)plugins/testing/skills/testcase-doc-generator/SKILL.md(1 hunks)plugins/testing/skills/testcase-doc-generator/generate_docx.py(1 hunks)
🧰 Additional context used
🪛 LanguageTool
plugins/testing/README.md
[uncategorized] ~183-~183: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ...rsion Control**: Maintain test cases in markdown format alongside code - **Test Manageme...
(MARKDOWN_NNP)
plugins/testing/commands/generate-test-case-doc.md
[uncategorized] ~93-~93: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ..., docx` - If invalid, default to markdown with warning 3. **Analyze Feature Cont...
(MARKDOWN_NNP)
[grammar] ~616-~616: Use a hyphen to join words.
Context: ...est summary section ### Example 2: High priority test cases only ``` /testing:ge...
(QB_NEW_EN_HYPHEN)
[uncategorized] ~622-~622: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... high ``` Output: - Generates only High priority test cases - Useful for critical path t...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
[uncategorized] ~660-~660: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...curity --format docx ``` Output: - High priority test cases only - Tagged with payment a...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
[grammar] ~665-~665: Use a hyphen to join words.
Context: ...ecurity scenarios ### Example 7: Medium priority test cases for regression suite...
(QB_NEW_EN_HYPHEN)
[uncategorized] ~671-~671: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...ium --component cart ``` Output: - Medium priority test cases - Suitable for extended regr...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
plugins/testing/skills/testcase-doc-generator/SKILL.md
[uncategorized] ~114-~114: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ...error message} ``` Solution: Check markdown formatting, ensure valid UTF-8 encoding...
(MARKDOWN_NNP)
[uncategorized] ~257-~257: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ...in DOCX Common causes: - Malformed markdown tables - Unclosed code blocks - Invalid...
(MARKDOWN_NNP)
[uncategorized] ~261-~261: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ...haracters Solution: Review and fix markdown formatting ### Issue: Script not found...
(MARKDOWN_NNP)
🪛 markdownlint-cli2 (0.18.1)
plugins/testing/commands/generate-test-case-doc.md
16-16: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
337-337: Bare URL used
(MD034, no-bare-urls)
338-338: Bare URL used
(MD034, no-bare-urls)
339-339: Bare URL used
(MD034, no-bare-urls)
plugins/testing/skills/testcase-doc-generator/SKILL.md
16-16: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🪛 Ruff (0.14.3)
plugins/testing/skills/testcase-doc-generator/generate_docx.py
279-279: Do not catch blind exception: Exception
(BLE001)
🔇 Additional comments (12)
plugins/testing/.claude-plugin/plugin.json (1)
1-8: LGTM! Clean plugin manifest.The plugin manifest follows the established structure with appropriate metadata for a new plugin release (v0.0.1).
PLUGINS.md (2)
18-18: LGTM! TOC entry added correctly.The Testing plugin is properly added to the table of contents in alphabetical order.
176-183: LGTM! Plugin documentation section is well-structured.The Testing plugin section follows the established documentation pattern with clear command description and synopsis.
.claude-plugin/marketplace.json (1)
82-86: LGTM! Marketplace entry is correct.The testing plugin is properly registered in the marketplace with consistent metadata.
plugins/testing/skills/testcase-doc-generator/SKILL.md (1)
1-280: LGTM! Comprehensive skill documentation.The skill documentation clearly explains the DOCX generation workflow, prerequisites, usage examples, and troubleshooting steps. The integration with the main command is well documented.
plugins/testing/README.md (1)
1-358: LGTM! Excellent plugin README.The README provides comprehensive documentation covering all aspects of the plugin: overview, installation, usage examples, prerequisites, use cases for different roles, output formats, best practices, and troubleshooting. This will greatly help users adopt the plugin.
docs/data.json (1)
607-627: LGTM! Plugin registry entry is correct.The testing plugin is properly registered in the data.json with complete metadata including commands, skills, and version information.
plugins/testing/skills/testcase-doc-generator/generate_docx.py (5)
27-35: LGTM! Proper dependency check with helpful error message.The ImportError handling provides clear guidance to users on how to install the required python-docx library.
64-86: LGTM! Comprehensive document styling.The styling setup creates a professional document appearance with consistent fonts, colors, and sizes for all heading levels and normal text.
88-99: LGTM! Robust markdown table parsing.The table parser correctly handles markdown table syntax and filters out separator rows. Good use of set comparison to identify separator lines.
102-131: LGTM! Well-formatted table generation.The table creation applies professional styling with bold headers, blue header background, and proper table formatting using the Light Grid Accent 1 style.
133-263: LGTM! Comprehensive markdown-to-DOCX conversion.The conversion function handles all common markdown elements: frontmatter, code blocks, tables, headings, lists, bold text, and horizontal rules. The state machine approach with flags for code blocks and tables ensures proper processing.
What this PR does / why we need it:
This PR adds a new
testingplugin that automates comprehensive test case generation for features.Key capabilities:
--priority high|medium|low) for focused test suites--component name) for test organizationWhy we need it:
Command:
Which issue(s) this PR fixes:
N/A - New feature addition
Special notes for your reviewer:
Plugin Structure
Key Files
File Location Behavior
Dependencies
Usage Examples
Basic usage - creates testcases-user-authentication.md in current directory
/testing:generate-test-case-doc "User Authentication"High priority tests with DOCX format
/testing:generate-test-case-doc "Payment Gateway" --priority high --format docxWith component tagging
/testing:generate-test-case-doc "API Gateway" --component api,securityReal-world example in specific project
Testing details:
Test case document created by slash command
testcases-json-enricher.md
Checklist:
Summary by CodeRabbit