Skip to content

tests: split into tests/unit, tests/integration and tests/profile tiers #5374

Closed

Description

@zackees

Problem

The C++ host tests have only two tiers:

  • every doctest file under tests/ (tests/fl/**, tests/misc/**, tests/platforms/**, tests/driver/**, top-level tests/*.cpp), which is compiled, linked and run by every bash test;
  • tests/profile/: standalone one-off benchmark binaries run with bash 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

  1. 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). Use git mv so history follows.
  2. Keep test names stable. fl_channels_spi_legacy_golden etc. must not gain a unit_ prefix: bash test <name>, CI inventories and docs depend on them.
  3. 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.py smoke inventories, ci/run_tests.py, ci/early_exit_cache.py, and the IWYU script.
  4. Update the lint path config: ci/lint_cpp_rs checkers that special-case tests/ (test_structure, cli_config_paths, prelude constants, …) and ci/lint_cpp/run_all_checkers.py. Also update hooks under ci/hooks/.
  5. Add the integration tier: its own build target set, excluded from the default run, selectable with a bash test flag and by name. Move the colorimetric comparison table there, and drop the FASTLED_COLORIMETRIC_TABLE gate. The production parity and monotonicity case stays in unit.
  6. Docs: agents/tests.md, agents/docs/testing-commands.md, CLAUDE.md, and the tests README files.

Acceptance

  • bash test --cpp runs 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) and bash test colorimetric_strategy_table run it.
  • bash lint is clean, and native CI smoke inventories still resolve.
  • bash profile <name> is unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    sanitized

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions