-
Notifications
You must be signed in to change notification settings - Fork 68
Increase test coverage #1116
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
Increase test coverage #1116
Conversation
This was an AI assisted change purely to increase test coverage and test some edge cases. - Added an AGENTS.md file for AI code agents to read. Notably tells the AI agent how to run tests and to always run tests during the process. - Updated pyproject.toml to run formatters on test code
ericholscher
left a 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.
Seems like a solid improvement 💯
|
|
||
| ## 1. Project Overview | ||
|
|
||
| - **Language:** Python |
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.
Not sure the bold is needed?
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.
I mostly let AI generate this initially and it added this. Maybe it helps because it wanted it?
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.
Pull request overview
This PR increases test coverage from 90% to 94% through AI-assisted test additions, focusing exclusively on test code improvements and edge case coverage.
Changes:
- Added AGENTS.md file providing project standards and testing instructions for AI agents
- Updated pyproject.toml to apply formatters to test code and raise coverage threshold to 94%
- Expanded test coverage across multiple test files with new edge cases and validation tests
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Removed test exclusions from formatters and increased coverage threshold to 94% |
| adserver/tests/test_views.py | Fixed import ordering |
| adserver/tests/test_validators.py | Added tests for niche targeting, days validation, and additional edge cases |
| adserver/tests/test_utils.py | Added extensive utility function tests covering edge cases and error conditions |
| adserver/tests/test_tasks.py | Reformatted long lines for readability |
| adserver/tests/test_staff_actions.py | Fixed import ordering and added blank line |
| adserver/tests/test_reports.py | Added tests for report features including geo reports, filters, and index display |
| adserver/tests/test_publisher_dashboard.py | Fixed import ordering and reformatted long lines |
| adserver/tests/test_models.py | Removed unused variable assignments |
| adserver/tests/test_management_commands.py | Fixed import ordering and reformatted decorator usage |
| adserver/tests/test_decision_engine.py | Fixed import ordering and quote consistency |
| adserver/tests/test_api.py | Fixed import ordering and added comprehensive API tests for edge cases |
| adserver/tests/test_advertiser_dashboard.py | Added extensive dashboard tests and fixed import ordering |
| adserver/tests/test_admin.py | Reformatted long lines for readability |
| adserver/tests/test_account_extras.py | Fixed import ordering and added support view tests |
| adserver/analyzer/tests.py | Fixed import ordering and reformatted expressions |
| AGENTS.md | New file providing project standards and AI agent instructions |
| .coveragerc | Added metabase template exclusion from coverage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
This was an AI assisted change purely to increase test coverage and test some edge cases.
How
Basically I used Google Antigravity, informed the agent about the current test coverage and how to get the coverage levels. Then I increased the test coverage requirement to 94% and set the agent in a loop to add tests, run the tests and see if the coverage was >94%, and repeat until it is.
After 20 iterations (~1.5-2hrs), it hit the threshold. I had to do a small amount of cleanup to the PR but I have reviewed every line and believe this is a net positive.