Repository navigation
Closed
Labels
sanitizedTitle, body and conversation screened; review text requires separate screening.
Description
Problem
The C++ host tests have only two tiers:
- every doctest file under
tests/(tests/fl/**,tests/misc/**,tests/platforms/**,tests/driver/**, top-leveltests/*.cpp), which is compiled, linked and run by everybash test; tests/profile/: standalone one-off benchmark binaries run withbash profile <name>. These are not doctest suites and not pass/fail.
There is nowhere to put heavy pass/fail suites that should run on request (or in a separate CI lane) rather than on every bash test. Example: the #3422 colorimetric strategy comparison table in tests/misc/colorimetric_strategy_table.cpp. It is ~11.4k lines and ~7.5 s CPU, and it kept tripping the 20 s runner watchdog on loaded hosts. #5368 gated it behind the FASTLED_COLORIMETRIC_TABLE=1 environment variable as a stopgap, but the file is still compiled and linked on every run.
Proposal
Three explicit tiers:
| tier | path | runs | purpose |
|---|---|---|---|
| unit | tests/unit/** |
every bash test (default) |
fast doctest suites; the current default set |
| integration | tests/integration/** |
on request (e.g. bash test --integration / bash test <name>), plus a CI lane where appropriate |
heavy or slow doctest suites with real pass/fail |
| profile | tests/profile/** |
bash profile <name> |
unchanged: standalone benchmark binaries |
Shared infrastructure (tests/shared/, tests/data/, test.h, test_pch.h, the doctest main, crash handlers, runner) stays shared.
Scope
- Move every current default unit-test source into
tests/unit/, keeping its relative layout (tests/fl/x/y.cpp->tests/unit/fl/x/y.cpp, and likewise for misc, platforms, driver and top-level). Usegit mvso history follows. - Keep test names stable.
fl_channels_spi_legacy_goldenetc. must not gain aunit_prefix:bash test <name>, CI inventories and docs depend on them. - Update discovery and build: the tests build files,
tests/discover_tests.py,tests/organize_tests.py,ci/meson/test_discovery.py, the runner and streaming helpers,ci/util/test_runner.py/test_args.py/smart_selector.py/fingerprint.py,ci/native_ci.pysmoke inventories,ci/run_tests.py,ci/early_exit_cache.py, and the IWYU script. - Update the lint path config:
ci/lint_cpp_rscheckers that special-casetests/(test_structure, cli_config_paths, prelude constants, …) andci/lint_cpp/run_all_checkers.py. Also update hooks underci/hooks/. - Add the integration tier: its own build target set, excluded from the default run, selectable with a
bash testflag and by name. Move the colorimetric comparison table there, and drop theFASTLED_COLORIMETRIC_TABLEgate. The production parity and monotonicity case stays in unit. - Docs:
agents/tests.md,agents/docs/testing-commands.md, CLAUDE.md, and the tests README files.
Acceptance
bash test --cppruns the same unit-test set, under the same names, as before the move (diff the test list).- The integration tier is not built or run by default;
bash test --integration(or the chosen flag) andbash test colorimetric_strategy_tablerun it. bash lintis clean, and native CI smoke inventories still resolve.bash profile <name>is unchanged.
Metadata
Metadata
Assignees
Labels
sanitizedTitle, body and conversation screened; review text requires separate screening.
Type
Projects
- StatusShow more project fieldsDone
Activity
refactor(tests): move host doctest sources into tests/unit (#5374)
refactor(tests): split host tests into unit/integration/profile tiers (…
fix(tests): harden the test tiers after review (#5374)
test(ci): give the streaming stale-recovery fake context the new runn…
refactor(tests): move host doctest sources into tests/unit (#5374)
refactor(tests): split host tests into unit/integration/profile tiers (…
fix(tests): harden the test tiers after review (#5374)
test(ci): give the streaming stale-recovery fake context the new runn…
refactor(tests): split host tests into unit/integration/profile tiers (…