-
Notifications
You must be signed in to change notification settings - Fork 323
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
Generate new tests that are focused on the pr changeset #211
Generate new tests that are focused on the pr changeset #211
Conversation
PR Reviewer Guide 🔍(Review updated until commit c8764b9)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Co-authored-by: codiumai-pr-agent-pro[bot] <151058649+codiumai-pr-agent-pro[bot]@users.noreply.github.com>
/review |
Persistent review updated to latest commit c8764b9 |
/ask Write a quick snippet in Markdown that I can add to our documentation that tells us above this PR's feature and how to run it. |
Ask❓Write a quick snippet in Markdown that I can add to our documentation that tells us above this PR's feature and how to run it. Answer:## Enhanced Test Generation with Diff Coverage
This update introduces a new feature that allows for generating tests based on the differences between branches, focusing on the changes in the codebase. This is particularly useful for ensuring that new changes are adequately tested without needing to run tests on the entire codebase.
### Key Features:
- **Diff Coverage Support**: The tool can now generate tests specifically for the code changes between branches using a JSON diff coverage report.
- **New Command-Line Options**:
- `--diff-coverage`: Enable this option to generate tests based on the diff between branches.
- `--branch`: Specify the branch to compare against when using `--diff-coverage`. The default is `main`.
- **Mutually Exclusive Flags**: The `--diff-coverage` option cannot be used simultaneously with `--use-report-coverage-feature-flag`.
### How to Run:
To utilize the diff coverage feature, run the tool with the following command-line options:
```bash
python cover_agent/main.py --diff-coverage --branch=<comparison_branch> Replace Example:python cover_agent/main.py --diff-coverage --branch=develop This command will generate tests for the differences between your current branch and the
|
PR Type
enhancement, tests
Description
CoverageProcessor
to parse JSON diff coverage reports, supporting a new coverage type 'diff_cover_json'.UnitTestGenerator
andUnitTestValidator
to handle additional parameters such as language and testing framework.diff-cover
dependency.Changes walkthrough 📝
5 files
CoverAgent.py
Add diff coverage support and enhance test generation
cover_agent/CoverAgent.py
CoverageProcessor.py
Support JSON diff coverage report parsing
cover_agent/CoverageProcessor.py
UnitTestGenerator.py
Enhance prompt building and test generation
cover_agent/UnitTestGenerator.py
UnitTestValidator.py
Implement diff coverage handling and reporting
cover_agent/UnitTestValidator.py
main.py
Add CLI options for diff coverage
cover_agent/main.py
3 files
test_CoverAgent.py
Add tests for diff coverage functionality
tests/test_CoverAgent.py
test_UnitTestGenerator.py
Update tests for enhanced prompt parameters
tests/test_UnitTestGenerator.py
test_UnitTestValidator.py
Add tests for diff coverage report processing
tests/test_UnitTestValidator.py
1 files
version.txt
Update version to 0.2.6
cover_agent/version.txt
1 files
pyproject.toml
Add diff-cover dependency
pyproject.toml
diff-cover
dependency.