Finding
File: tests/test_report_html.py:4512
Source ticket: RAKI-305
test_rework_cycles_lower_is_better_direction_is_up is a tautological test — it constructs a fixture with direction='up' at line 4409 and then asserts direction=='up'. This validates only the fixture's self-consistency, not the production build_sparkline_data() polarity logic. While acceptable as a regression guard against fixture drift, it does not exercise the real production code path.
Suggested Fix
Add a dedicated unit test in test_sparkline.py that:
- Calls
build_sparkline_data() with metric_polarity={"rework_cycles": False} and decreasing values.
- Asserts the returned
direction="up" (i.e., lower values are better → trend going down is reported as improvement → direction up).
This would test the production code path directly rather than fixture self-consistency.
References
- PR: fix inverted SparklineData direction semantics for lower-is-better metrics in _make_report_with_sparklines (RAKI-305)
Finding
File: tests/test_report_html.py:4512
Source ticket: RAKI-305
test_rework_cycles_lower_is_better_direction_is_upis a tautological test — it constructs a fixture withdirection='up'at line 4409 and then assertsdirection=='up'. This validates only the fixture's self-consistency, not the productionbuild_sparkline_data()polarity logic. While acceptable as a regression guard against fixture drift, it does not exercise the real production code path.Suggested Fix
Add a dedicated unit test in
test_sparkline.pythat:build_sparkline_data()withmetric_polarity={"rework_cycles": False}and decreasing values.direction="up"(i.e., lower values are better → trend going down is reported as improvement → direction up).This would test the production code path directly rather than fixture self-consistency.
References