Skip to content

Increase test coverage threshold to 100% for security-sensitive validators#94

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/increase-test-coverage-threshold
Draft

Increase test coverage threshold to 100% for security-sensitive validators#94
Copilot wants to merge 2 commits intomainfrom
copilot/increase-test-coverage-threshold

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

The global 80% coverage threshold in the root pyproject.toml is insufficient for security-sensitive validators/ modules where edge cases (None, empty strings, whitespace, non-string types) are security boundaries.

Changes

agents/agent1/pyproject.toml

  • Added [tool.coverage.report] fail_under = 100 — enforces 100% at the coverage.py level independent of pytest invocation flags
  • Added test-validators Poe task: a dedicated pytest-cov run scoped to python_agent_template.agents.agent1.validators with --cov-fail-under=100, per the issue's "separate scoped run" suggestion; runs all tests (not filtered to a single file) to automatically cover future validator additions
  • Extended agent1 check sequence to include test-validators, so the validators-specific threshold is part of every quality gate run

Testing

  • uv run poe check
  • Other: uv run poe -C agents/agent1 test and uv run poe -C agents/agent1 test-validators — both report 100% coverage

Checklist

  • Linked issue or task reference
  • Added/updated tests where relevant
  • Updated docs/README if needed
  • No secrets or sensitive data added
  • Considered backward compatibility and deployment impact

Additional context

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: /usr/bin/curl curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Increase test coverage threshold for security-sensitive validators</issue_title>
<issue_description>The global pytest coverage threshold is currently set to 80% (--cov-fail-under=80 in pyproject.toml). For security-sensitive modules like the validators/ package (e.g., blank_string_validator.py), this threshold may be insufficient — edge cases such as None, empty strings, whitespace-only values, and non-string types are security boundaries that should be fully exercised.

Suggested improvement: Raise the coverage requirement for validators/ modules to 95% or 100%, either via per-file coverage configuration or a separate pytest-cov run scoped to that package.

File: pyproject.toml, line 150

Review comment:

The coverage threshold of 80% may be insufficient for security-sensitive validation utilities like this blank string validator. Consider a higher threshold (e.g., 95% or 100%) for modules in the validators/ package, where comprehensive test coverage is critical to ensure all edge cases (None, empty strings, whitespace-only, valid strings) are exercised. Security boundaries should have near-complete test coverage.

Related PR: #51

Generated by PR Review Comment Handler for issue #51

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Add [tool.coverage.report] fail_under = 100 to agents/agent1/pyproject.toml
  so coverage.py enforces 100% regardless of how tests are invoked
- Add test-validators Poe task scoped to validators subpackage with
  --cov-fail-under=100, as a separate pytest-cov run per the issue suggestion
- Update agent1 check sequence to include test-validators

Co-authored-by: pmalarme <686568+pmalarme@users.noreply.github.com>
Copilot AI changed the title [WIP] Raise test coverage threshold for security-sensitive validators Increase test coverage threshold to 100% for security-sensitive validators Feb 19, 2026
Copilot AI requested a review from pmalarme February 19, 2026 22:32
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.

Increase test coverage threshold for security-sensitive validators

2 participants