Repository navigation
test: wake 78 tests that had never run, and guard against it recurring (#4201) - #4232
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe change standardizes test harness inclusion, registers the ChangesTest registration coverage
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to This change activates previously dormant pin and xymap tests, corrects the xymap brightness fixture, and adds a CI check to prevent further unregistered test cases. No merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant TestRunner
participant TestEveryTestFileRegisters
participant TestSources
TestRunner->>TestEveryTestFileRegisters: run registration checks
TestEveryTestFileRegisters->>TestSources: collect_sources()
TestSources-->>TestEveryTestFileRegisters: sorted *.cpp files
TestEveryTestFileRegisters->>TestSources: inspect FL_TEST_CASE and test.h
TestSources-->>TestEveryTestFileRegisters: matching or offending files
TestEveryTestFileRegisters-->>TestRunner: test result
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…4234) The gate is red on master itself, so every open PR fails it -- including #4232, which touches only test files and CI Python. Master's own run measures total_flash=342,409 B against a pinned 342,407 B. No single PR regressed; the drift is the sum of six changes merged in one burst on 2026-09-09 16:57-16:59Z, each measured against a base that predated the others: #4204 342,393 B (baseline 342,393, headroom 0) #4206 342,391 B (baseline 342,393, headroom 2) #4213 342,391 B #4220 342,391 B #4221 342,391 B #4227 342,407 B (baseline 342,407 -- raised in that PR, headroom 0) Every one of them passed. Their combination is 2 B over. That is the known limit of measuring each PR against its own merge base, not a regression anyone shipped, so re-pinning to the measured value records what master is rather than hiding anything: a PR that adds flash on top of 342,409 B still fails. Claude-Session: https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9 Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
#4201) `FL_TEST_CASE` bodies compile whether or not anything runs them. What makes them run is `#include "test.h"`, which pulls in the registration harness; including `fl/test/fltest.h` directly compiles the same macros into a translation unit that registers nothing, and the suite reports success. Two of the three files in #4201 are fixed here: tests/fl/system/pin.cpp 61 cases, all passing once they run tests/fl/math/xymap.cpp 17 cases, one of which was failing `xymap.cpp` also needed the `FL_TEST_FILE` wrapper it never had. The failing one is worth stating, because it is the argument for the whole change. "Corner case: All max brightness buffer with addressing" wrote `CRGB input[4] = {CRGB::White}`, which initializes element 0 and value-initializes the other three to black, then asserted 255 on all four. It has been wrong since it was written and nothing could say so. The third file, `tests/fl/channels/channel.cpp`, stays dormant on purpose. Enabling it segfaults in `ScaledPixelIteratorRGB::advance()` via `writeAPA102` -- reproduced on a clean checkout with nothing changed but the include, so it predates the discovery and wants someone with context on that path. `ci/tests/test_every_test_file_registers.py` asserts the shape so this cannot drift back. The dormant file is a single named exemption rather than a pattern, and a second assertion pins that list at exactly one entry, so adding another has to be a visible edit a reviewer sees. Checked by mutation: removing the exemption fails the sweep on `channel.cpp`, which is the case the guard exists to catch. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9
33cc51c to
34df574
Compare
Fixes two of the three files in #4201 and stops the class of bug recurring.
FL_TEST_CASEbodies compile whether or not anything runs them. What makes them run is#include "test.h", which pulls in the registration harness; includingfl/test/fltest.hdirectly compiles the same macros into a translation unit that registers nothing — and the suite reports success.tests/fl/system/pin.cpptests/fl/math/xymap.cppxymap.cppalso needed theFL_TEST_FILEwrapper it never had.The failing one is the argument for the change
"Corner case: All max brightness buffer with addressing" wrote:
which initializes element 0 and value-initializes the other three to black — then asserted 255 on all four. It has been wrong since it was written, and nothing could say so.
One file stays dormant, deliberately
tests/fl/channels/channel.cppstill includes the wrong header. Enabling it segfaults inScaledPixelIteratorRGB::advance()viawriteAPA102, and I reproduced that on a clean checkout with nothing changed but the include — so it predates the discovery and wants someone with context on that path rather than a guess from me.The guard
ci/tests/test_every_test_file_registers.pyasserts every test file defining a case includestest.h. The dormant file is a single named exemption, not a pattern, and a second assertion pins that list at exactly one entry — so waving a new dormant file through has to be a visible edit a reviewer sees.Checked by mutation: removing the exemption fails the sweep on
channel.cpp, which is the case the guard exists to catch. It also asserts its own regexes match what they claim and don't fire on a case name inside a comment.Closes part of #4201; the segfault half stays open there.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9
Summary by CodeRabbit