ci(boards): register nano, add memory-tier drift test (#4847) (#4852) · FastLED/FastLED@1f48de3 · GitHub
Skip to content

Commit 1f48de3

Browse files
authored
ci(boards): register nano, add memory-tier drift test (#4847) (#4852)
* ci(boards): register nano, lift memory tiers to constants with a drift test (#4847) LOW_MEMORY_BOARDS listed nano and uno_r4_minima with no Board definition, so the tier never applied and 'bash compile nano' failed (unsupported platform). Add NANO (nanoatmega328; Blink builds locally). uno_r4_minima is dropped from the list: fbuild's Renesas core fails on its variant (bsp_api.h missing) and its renesas-ra platform already makes it low memory. The tier sets are now module constants, and test_board_memory_tiers.py fails on any tier name without a Board. * test(boards): cover the renesas-ra low-memory fallback (#4847 review)
1 parent 50542f0 commit 1f48de3

3 files changed

Lines changed: 98 additions & 36 deletions

File tree

‎ci/boards.py‎

Lines changed: 55 additions & 36 deletions
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
"""Memory-tier board lists must name real boards (FastLED#4847).
2+
3+
A tier entry with no Board definition is silently dead: `bash compile <name>`
4+
fails with "unsupported platform" and the tier never applies.
5+
"""
6+
7+
from ci.boards import (
8+
ALL,
9+
HUGE_MEMORY_BOARDS,
10+
LOW_MEMORY_BOARDS,
11+
TINY_MEMORY_BOARDS,
12+
Board,
13+
)
14+
15+
16+
# Host pseudo-boards that are classified by name but are not fbuild targets.
17+
HOST_PSEUDO_BOARDS = {"native"}
18+
19+
20+
def test_every_memory_tier_name_is_a_registered_board() -> None:
21+
registered = {board.board_name.lower() for board in ALL}
22+
tiers = TINY_MEMORY_BOARDS | LOW_MEMORY_BOARDS | HUGE_MEMORY_BOARDS
23+
missing = {
24+
name for name in tiers if name.lower() not in registered
25+
} - HOST_PSEUDO_BOARDS
26+
assert not missing, f"memory-tier names with no Board definition: {sorted(missing)}"
27+
28+
29+
def test_new_avr_and_renesas_boards_are_low_memory() -> None:
30+
by_name = {board.board_name: board for board in ALL}
31+
for name in ("nano", "uno", "mega"):
32+
assert by_name[name].memory_class == "low", name
33+
34+
35+
def test_renesas_platform_fallback_is_low_memory() -> None:
36+
# uno_r4_minima is deliberately not in LOW_MEMORY_BOARDS: the renesas-ra
37+
# platform fallback is what classifies it.
38+
assert "uno_r4_minima" not in LOW_MEMORY_BOARDS
39+
board = Board(
40+
board_name="uno_r4_minima", platform="renesas-ra", add_board_to_all=False
41+
)
42+
assert board.memory_class == "low"

‎ci/tests/test_readme_badge_wall.py‎

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)