Skip to content

Conversation

@davidfischer
Copy link
Collaborator

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
  • Only made changes to test code

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.

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
@davidfischer davidfischer requested a review from a team as a code owner January 12, 2026 18:44
Copy link
Member

@ericholscher ericholscher left a 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
Copy link
Member

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?

Copy link
Collaborator Author

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?

@ericholscher ericholscher requested a review from Copilot January 14, 2026 11:05
Copy link
Contributor

Copilot AI left a 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.

davidfischer and others added 2 commits January 14, 2026 09:01
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
@davidfischer davidfischer merged commit 8512577 into main Jan 14, 2026
1 check passed
@davidfischer davidfischer deleted the davidfischer/ai-assisted-test-coverage branch January 14, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants