Skip to content

test(esp32): assert weak app_main sits inside the library guard (#5365) - #5392

Merged
zackees merged 1 commit into
masterfrom
test/5365-lazy-serial0-guard-assert
Nov 22, 2026
Merged

zackees merged 1 commit into
masterfrom
test/5365-lazy-serial0-guard-assert

Conversation

@zackees

@zackees zackees commented Nov 22, 2026

Copy link
Copy Markdown
Member

Follow-up to #5385 (refs #5365). Fixes the one CodeRabbit nit left after that PR merged.

test_sketch_startup_header_honors_library_marker checked code.index("app_main(void)") > guard. That first matches the fl_esp32_arduino_app_main(void) declaration, so the weak app_main definition was never checked, and moving it below the guard's #endif went unnoticed. The test now matches void app_main(void) and requires it to sit between the guard and its #endif.

Evidence:

  • uv run pytest ci/tests/test_esp32_lazy_serial0.py: 4 passed.
  • Mutation check: I moved the weak app_main below the #endif in esp32_lazy_serial0_main.h, and the test fails (1 failed, 3 passed). The header was then restored.
  • bash lint on the file: clean.

Test-only change.

The guard test used code.index("app_main(void)"), which first matched the
fl_esp32_arduino_app_main declaration, so it never checked the weak
definition. It would also miss the definition moving below the guard's
#endif. Match "void app_main(void)" and bound it by the #endif (CodeRabbit
nit on #5385). A mutation that moves app_main past the #endif now fails the
test.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9ae863e and 8d61852.

Files selected for processing: 1

  • ci/tests/test_esp32_lazy_serial0.py

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 22, 2026
@github-actions github-actions Bot added sanitized Title, body and conversation screened; review text requires separate screening. and removed sanitized Title, body and conversation screened; review text requires separate screening. labels Nov 22, 2026
@zackees
zackees added this pull request to the merge queue Nov 22, 2026
Merged via the queue into master with commit 6c86667 Nov 22, 2026
128 of 129 checks passed
@zackees
zackees deleted the test/5365-lazy-serial0-guard-assert branch November 22, 2026 02:34
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanitized Title, body and conversation screened; review text requires separate screening.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant