Files
cleveragents-core/features/coverage_threshold_config.feature
T
freemo 2eaf9362a3
CI / lint (pull_request) Successful in 26s
CI / typecheck (pull_request) Successful in 47s
CI / security (pull_request) Successful in 55s
CI / quality (pull_request) Successful in 40s
CI / build (pull_request) Successful in 17s
CI / helm (pull_request) Successful in 23s
CI / unit_tests (pull_request) Successful in 6m55s
CI / e2e_tests (pull_request) Successful in 17m13s
CI / integration_tests (pull_request) Successful in 23m21s
CI / coverage (pull_request) Successful in 11m3s
CI / docker (pull_request) Successful in 21s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 57m1s
fix(tests): add missing Behave feature file for coverage_threshold
- What was implemented
  - Created features/coverage_threshold_config.feature containing 11 BDD scenarios to exercise coverage threshold configurations.
  - All 15 step functions in features/steps/coverage_threshold_config_steps.py are now exercised by the new scenarios.
  - Scenarios cover:
    - pyproject.toml coverage config (7 scenarios)
    - noxfile.py coverage session (2 scenarios)
    - CI workflow (1 scenario)
    - nightly quality workflow (1 scenario)
  - All 11 scenarios verified to pass against actual project configuration values.

- Key design decisions
  - Used the exact step text from the step file to ensure proper Gherkin-to-step matching.
  - Nightly workflow threshold set to 85 (matching the actual --coverage-min 85 value in nightly-quality.yml).
  - Noxfile threshold set to 97 (matching COVERAGE_THRESHOLD = 97 constant).
  - Organized scenarios into logical groups with comments for readability.

- Modules/components affected
  - features/coverage_threshold_config.feature (new feature file)
  - features/steps/coverage_threshold_config_steps.py (all steps now exercised)

ISSUES CLOSED: #2767
2026-04-05 07:43:10 +00:00

58 lines
2.5 KiB
Gherkin

Feature: Coverage threshold configuration
The project enforces a minimum 97% code coverage threshold across multiple
configuration files. This feature validates that pyproject.toml, noxfile.py,
the CI workflow, and the nightly quality workflow are all correctly configured
to enforce and report coverage thresholds.
# -- pyproject.toml coverage configuration --
Scenario: Coverage run section exists in pyproject.toml
Given the pyproject toml file is loaded for coverage check
Then the coverage run section should exist
Scenario: Coverage source includes src directory
Given the pyproject toml file is loaded for coverage check
Then the coverage source should include "src"
Scenario: Coverage branch tracking is enabled
Given the pyproject toml file is loaded for coverage check
Then the coverage branch tracking should be enabled
Scenario: Coverage data file is stored under build directory
Given the pyproject toml file is loaded for coverage check
Then the coverage data file should be "build/.coverage"
Scenario: Coverage HTML report directory is under build
Given the pyproject toml file is loaded for coverage check
Then the coverage html directory should be "build/htmlcov"
Scenario: Coverage XML output is under build directory
Given the pyproject toml file is loaded for coverage check
Then the coverage xml output should be "build/coverage.xml"
Scenario: Coverage omit patterns exclude test directories
Given the pyproject toml file is loaded for coverage check
Then the coverage omit patterns should include "*/tests/*"
# -- noxfile.py coverage session --
Scenario: Noxfile defines a coverage_report session
Given the noxfile py is loaded for coverage check
Then the noxfile should define a coverage_report session
Scenario: Noxfile enforces fail-under threshold of at least 97
Given the noxfile py is loaded for coverage check
Then the noxfile should contain a fail-under threshold of at least 97
# -- CI workflow coverage enforcement --
Scenario: CI workflow references nox coverage_report session
Given the ci workflow file is loaded for coverage check
Then the ci workflow should reference nox coverage_report session
# -- Nightly quality workflow coverage enforcement --
Scenario: Nightly workflow enforces coverage threshold via --coverage-min
Given the nightly quality workflow file is loaded for coverage check
Then the nightly workflow should use a fail-under of at least 85