Finding
File: tests/test_report_html.py:4395
Severity: Minor
Description
The test helper _make_report_with_sparklines constructs rework_cycles SparklineData with direction='down' and delta=-0.3. However, rework_cycles is a lower-is-better metric, so a decrease (negative delta) represents an improvement and should have direction='up'. The current fixture has inverted semantics — it validates that ▼ (red/declining) appears, when the correct behavior for a rework_cycles decrease should be ▲ (green/improving).
Suggested Fix
- Change the
rework_cycles fixture to direction='up' (matching what build_sparkline_data would produce for a lower-is-better metric that decreases).
- Add a separate fixture with
direction='down' for a higher-is-better metric that decreases to test the ▼ rendering path, so both rendering branches (▲ and ▼) remain covered.
Impact
The test currently asserts the wrong rendered output for rework_cycles trend arrows. Any regression that accidentally renders ▲ for a declining higher-is-better metric (or vice-versa) would not be caught.
References
Finding
File:
tests/test_report_html.py:4395Severity: Minor
Description
The test helper
_make_report_with_sparklinesconstructsrework_cyclesSparklineDatawithdirection='down'anddelta=-0.3. However,rework_cyclesis a lower-is-better metric, so a decrease (negative delta) represents an improvement and should havedirection='up'. The current fixture has inverted semantics — it validates that ▼ (red/declining) appears, when the correct behavior for arework_cyclesdecrease should be ▲ (green/improving).Suggested Fix
rework_cyclesfixture todirection='up'(matching whatbuild_sparkline_datawould produce for a lower-is-better metric that decreases).direction='down'for a higher-is-better metric that decreases to test the ▼ rendering path, so both rendering branches (▲ and ▼) remain covered.Impact
The test currently asserts the wrong rendered output for
rework_cyclestrend arrows. Any regression that accidentally renders ▲ for a declining higher-is-better metric (or vice-versa) would not be caught.References