Repository navigation
refactor(tests): split host tests into unit/integration/profile tiers (#5374) - #5397
Conversation
|
Important Review skippedToo many files! This PR contains 632 files, which is 332 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 500 files.
|
Memory usage (this PR vs. its merge base)Change in
|
425d7a4 to
04ba983
Compare
|
Rebased onto master at 0df0973 to clear the conflicts. New test changes on master that used the old paths now live under
Discovery: 376 tests (374 unit + 2 integration). Branches that still add tests under |
Pure git mv, no content changes: tests/fl, tests/misc, tests/platforms and the top-level unit tests move under tests/unit/, keeping their relative layout. The colorimetric strategy table moves to tests/integration/misc/. The following commit updates discovery, tooling and paths.
- organize_tests fails configuration on a doctest source outside a tier, so a test added at the pre-tier layout cannot go silently dormant. - The streaming runner's outer kill timeout widens with the in-process watchdog, so macOS no longer kills 300 s integration suites at 90 s. - A path-spelled integration test skips the narrowed early-exit scan; it includes shared headers from tests/unit. - The integration_tests build alias always exists, so an empty tier is a no-op instead of an unknown-target error; suite runs name the suite. - mp3_cpu_audit runs fl_codec in release again, keeping the SIMD bit-exactness cases covered in an optimised build. - Platform-include lint and TDD hooks cover tests/integration too. - HOW_TO_PROFILE points at tests/profile and tests/unit/fl/fx.
3c7768f to
f68bc8a
Compare
Fixes #5374
What changes
Host C++ doctest suites now live in tier directories under
tests/:tests/unit/**bash test/bash test --cpp(default)tests/integration/**bash test --integrationorbash test <name>tests/profile/**bash profile)git mv, layout preserved): 493 files, including test(autoresearch): report instructions per show() from the RISC-V perf counter (#5376) #5389's new test.tests/fl/**,tests/misc/**,tests/platforms/**and the 7 root-level suites (cled_controller, fastled_core, lib8tion, noise, pixel_controller, pixelset, power_mgt) moved totests/unit/.tests/driver/(ESP-IDF stub headers on-I tests) stays put: it is shared infrastructure, not a suite.tests/unit/fl/stl/json.cppis stillfl_stl_json.--integrationworks:organize_tests.pyemits a tier field.tests/meson.buildbuilds integration DLLs withbuild_by_default: false, puts them in suiteintegrationwith a 300 s timeout, and collects them behind anintegration_testsalias.bash test --integrationcompiles that alias and runs--suite fastled:integration.--no-suite fastled:integration.bash test <name>builds and runs a single integration test directly, with a 300 s watchdog.organize_tests.pyfails configuration if a doctest source sits outside a tier. That way, a test added at the old layout (for example from a branch rebased across this change) cannot silently stop running.tests/integration/misc/colorimetric_strategy_table.cpp.FASTLED_COLORIMETRIC_TABLEgate is removed; being in the integration tier is now the opt-in.tests/unit/misc/colorimetric_strategy_checks.cpp.tests/unit/misc/colorimetric_strategies.hpp.FL_TEST_CASE("minimp3 fixed-point SIMD is not slower than scalar")was a benchmark insidefl_codec, and it kept tripping the 20 s runner watchdog on loaded hosts. It is now its own integration test,tests/integration/misc/mp3_simd_perf.cpp, with its assertions and[simd-perf]printf unchanged.fl_codec(unit). The shared decode helpers are intests/unit/fl/codec/mp3_variant_decode.hpp.mp3_cpu_audit.ymlnow runsmp3_simd_perfin release, and still runsfl_codecin release so SIMD bit-exactness stays covered in an optimised build.test.pyandci/util/{test_args,test_runner,smart_selector,test_types}.pyci/meson/{runner,streaming_runner,sequential_runner,test_execution,test_discovery}.pyci/early_exit_cache.pytests/{discover_tests,organize_tests,test_config,test_helpers,test_metadata_cache}.pytests/meson.buildci/lint_cpp_rs(tier-awaretests_relative_path, plus path constants)ci/hooks(test pairing, TDD guard, auto test suggest).github(CODEOWNERS, workflow path filters).claude/skills,agents/,docs/and.cursorrulesagents/tests.md("Test Tiers"),agents/docs/testing-commands.md("C++ Test Tiers"),tests/readmeCLAUDE.mdis unchanged because it references none of the moved paths.bash test tests/fl/stl/json,bash test tests/unit/fl/stl/jsonandbash test fl_stl_jsonall resolve to the same test.Evidence
colorimetric_strategy_checks(unit; the production cases split out of the table) andmp3_simd_perf(integration).colorimetric_strategy_tablekeeps its name and moves to the integration tier. Categories are unchanged.bash test --cpp:fl_codec,fl_gfx_gfx,power_mgt) were 20 s runner-watchdog timeouts at host load ~325 on 16 cores.FASTLED_TEST_TIMEOUT=300, all 3 pass: 4.6 s, 1.1 s and 4.0 s of user CPU.bash test <each> --debug(ASAN/LSAN/UBSAN) passes for all 3.fl_codecvs the watchdog: after rebasing onto test: keep host unit tests green on a heavily loaded machine #5390,fl_codecwithout the perf case runs in 7.4 s wall / 3.3 s user at load ~120 (FASTLED_TEST_TIMEOUT=300 time runner fl_codec.so), well under the 20 s watchdog.mp3_simd_perfon its own takes 0.7 s wall / 0.25 s user. Before test: keep host unit tests green on a heavily loaded machine #5390's trim it was 10.6 s wall.bash test fl_codec --debug: 6.2 s.tests/fl/system/instruction_counter.cpp, which is nowtests/unit/fl/system/instruction_counter.cpp. Its name,fl_system_instruction_counter, is unchanged, and it passes. On the old layout the new guard would have failed configuration on it.tests/unitfiles, confirmed by diff against master: only include-path rewrites differ.fl_codec.fl_codec,fl_gfx_gfx,power_mgt,fl_wdt_watchdog,fl_channels_spi_legacy_golden,--integration(2/2),test_esp32_forced_software_pinsandtest_esp32_lazy_serial0, andbash lint.bash test --integration: 2/2 pass (colorimetric_strategy_table,mp3_simd_perf) with 33 s of test execution.bash test colorimetric_strategy_tableby name passes.FASTLED_COLORIMETRIC_TABLE=1 bash test colorimetric_strategy_tableoutput with this branch's integration output. Both are 733 lines. All 245 differing cells are host-timing values (ns or x-ratio). The only other differences are the duration warning and the doctest case count (7 to 1, because the 6 checks moved to unit).bash lintpasses.soldr cargo testonci/lint_cpp_rsgives 186 passed. The affectedci/testsgive 163 passed, including the newci/tests/test_test_tiers.py.bash profile five_bit_hd_gammaworks./code-review mediumreported 9 findings.fl_codecstep, integration-aware lint/hooks, and the staleHOW_TO_PROFILEpaths.Not in this PR
bash test --integration; it is opt-in, matching master's env-gated table.