From 2eaf9362a3bea80504924b8ed0b875fad8156cc3 Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman Date: Sun, 5 Apr 2026 07:43:10 +0000 Subject: [PATCH] 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 --- features/coverage_threshold_config.feature | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 features/coverage_threshold_config.feature diff --git a/features/coverage_threshold_config.feature b/features/coverage_threshold_config.feature new file mode 100644 index 000000000..c518aa1f4 --- /dev/null +++ b/features/coverage_threshold_config.feature @@ -0,0 +1,57 @@ +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 -- 2.52.0