Background
The Phase 2 + Phase 3 acceptance gate of #434. Captures the integration
test from the meta verbatim.
What to do
Add crates/fbuild-cli/tests/bloat_esp32s3_fastled_master.rs:
#[test]#[ignore = \"network: fetches FastLED master + downloads esp-idf toolchain\"]fnbloat_esp32s3_blink_fastled_master_end_to_end(){// 1. Materialise a fbuild project skeleton in a temp dir:// - platformio.ini selecting board=esp32s3// - src/main.cpp that #include <FastLED.h> + a NEOPIXEL blink loop// - lib_deps = \"https://github.com/FastLED/FastLED#master\"let project = TempProject::scaffold_esp32s3_blink_fastled_master();// 2. fbuild build . (uses fbuild's native esp32 orchestrator; no PIO)run_fbuild(&[\"build\", project.path()]).expect(\"fbuild build succeeded\");// 3. Verify build_info.json has the four toolchain paths (#428).let build_info = project.read_build_info(\"esp32s3\");assert!(!build_info[\"nm_path\"].as_str().unwrap().is_empty());assert!(!build_info[\"cppfilt_path\"].as_str().unwrap().is_empty());assert!(!build_info[\"readelf_path\"].as_str().unwrap().is_empty());assert!(!build_info[\"objdump_path\"].as_str().unwrap().is_empty());// 4. fbuild bloat . (no flags, no --nm)let bloat_stdout = run_fbuild(&[\"bloat\", project.path()]).expect(\"fbuild bloat succeeded\");// 5. Report files exist at the documented path.let report_dir = project.path().join(\".fbuild/build/esp32s3/bloat-report\");assert!(report_dir.join(\"report.json\").is_file());assert!(report_dir.join(\"report.md\").is_file());// 6. stdout prints both absolute paths on exit.assert!(bloat_stdout.contains(\"report.json\"));assert!(bloat_stdout.contains(\"report.md\"));// 7. Content invariants — bounds generous so FastLED master drift// doesn't flake the test.let report: serde_json::Value = serde_json::from_str(&std::fs::read_to_string(report_dir.join(\"report.json\")).unwrap()).unwrap();let total_flash = report[\"total_flash\"].as_u64().unwrap();let total_ram = report[\"total_ram\"].as_u64().unwrap();let symbols = report[\"symbols\"].as_array().unwrap();let sections = report[\"sections\"].as_array().unwrap();assert!((300_000..500_000).contains(&total_flash));assert!((25_000..60_000).contains(&total_ram));assert!(symbols.len() > 2_000);assert!(sections.len() > 100);// 8. Map-derived synthesis covered (#427 invariant).let synth_count = symbols.iter().filter(|s| s[\"source\"].as_str() == Some(\"map-derived\")).count();assert!(synth_count > 100);// 9. Markdown report renders a top-flash table.let md = std::fs::read_to_string(report_dir.join(\"report.md\")).unwrap();assert!(md.contains(\"# Symbol analysis\"));assert!(md.contains(\"## Top\"));assert!(md.contains(\"flash symbols\"));assert!(md.contains(\"| Bytes |\"));assert!(md.contains(\"fl::\"));}Infra
#[ignore] by default so ordinary cargo test runs aren't
network-dependent.- Add a nightly CI matrix entry (
workflow_dispatch + scheduled
weekly) so FastLED master regressions surface here. - Cache the esp-idf toolchain via the existing
setup-soldr zccache
flow — second run should be < 30 s.
Why pin FastLED master
Exercises the realistic case (latest FastLED, biggest binary, most
complex symbol graph). The >2000 symbols / >100 map-derived
invariants pin the shape of the report, not exact bytes.
Acceptance
Related
Background
The Phase 2 + Phase 3 acceptance gate of #434. Captures the integration
test from the meta verbatim.
What to do
Add
crates/fbuild-cli/tests/bloat_esp32s3_fastled_master.rs:Infra
#[ignore]by default so ordinarycargo testruns aren'tnetwork-dependent.
workflow_dispatch+ scheduledweekly) so FastLED master regressions surface here.
setup-soldrzccacheflow — second run should be < 30 s.
Why pin FastLED master
Exercises the realistic case (latest FastLED, biggest binary, most
complex symbol graph). The
>2000 symbols/>100 map-derivedinvariants pin the shape of the report, not exact bytes.
Acceptance
cargo test --ignored bloat_esp32s3once the network is available.consecutive weeks (the meta closes when this holds, per Meta:
fbuild bloat— first-class, end-to-end bloat analysis with build_info-driven toolchain resolution (no manual nm/c++filt, no PlatformIO, no side scripts) #434).Related
fbuild bloat— first-class, end-to-end bloat analysis with build_info-driven toolchain resolution (no manual nm/c++filt, no PlatformIO, no side scripts) #434 (meta).bloatsubcommand).