mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-08-07 03:38:06 +00:00
An enum property renders as a dropdown whose option text is derived from the value — underscores replaced, title case applied. That works when the value reads as its own label and fails when it does not: "vs" renders as "Vs", and "abbrev" tells the user nothing about the "Sep 19" it produces. Schemas had no way to say otherwise, so the label was whatever the config key happened to look like. Enum dropdowns now take their option text from x-options.labels when the schema supplies it. This is not a new convention: the checkbox-group widget has read x-options.labels since it was written, with the same humanised fallback. This extends it to plain enums and to array-table columns. Display only — the option value, and so the saved config, is unchanged. The map may be partial; unlabelled values keep the humanised fallback, so every existing schema renders exactly as before. Older cores ignore x-options entirely, which means a plugin can ship labels without requiring users to upgrade first. Array-table columns get the same lookup but keep the raw value as their fallback rather than the humanised one. Those columns hold values such as ticker symbols, where "aapl" -> "Aapl" would be wrong, and they were not being humanised before this change. Verified against the running web service: with labels the hockey plugin's date dropdown reads "Sep 19 / 9/19 / 19 Sep / 19/9 / Fri Sep 19"; with the pre-change template and the same schema it falls back to "Abbrev / Numeric / Day First / ...", confirming the degradation path.
91 lines
3.1 KiB
YAML
91 lines
3.1 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
|
|
# Both jobs only check out the repo and run pytest.
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
plugin-safety:
|
|
name: Plugin safety harness + unit tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
|
|
with:
|
|
python-version: "3.12"
|
|
cache: pip
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt -r requirements-test.txt
|
|
pip install RGBMatrixEmulator
|
|
|
|
- name: Run harness + visual rendering tests
|
|
run: |
|
|
pytest --no-cov \
|
|
test/plugins/test_harness.py \
|
|
test/plugins/test_visual_rendering.py \
|
|
test/plugins/test_plugin_matrix.py
|
|
|
|
unit-tests:
|
|
name: Core unit tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
|
|
with:
|
|
python-version: "3.12"
|
|
cache: pip
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt -r requirements-test.txt
|
|
pip install RGBMatrixEmulator
|
|
|
|
# Safety net for the shared sports/scroll/style infrastructure. These
|
|
# suites existed but were not enrolled in CI, so a refactor of
|
|
# src/base_classes or src/common could regress them silently. Enrolled
|
|
# explicitly (not `pytest test/`) so known hardware-only suites don't
|
|
# break CI; grow this list as more suites are made headless.
|
|
- name: Run core unit suites
|
|
run: |
|
|
pytest --no-cov \
|
|
test/test_skin_system.py \
|
|
test/test_font_manager.py \
|
|
test/test_data_sources.py \
|
|
test/test_api_extractors.py \
|
|
test/test_scroll_helper.py \
|
|
test/test_scroll_helper_continuous.py \
|
|
test/test_adaptive_layout.py \
|
|
test/test_loader_compat_warning.py \
|
|
test/test_sports_base_characterization.py \
|
|
test/test_element_style.py \
|
|
test/test_sports_core_promotions.py \
|
|
test/test_sports_modes_promotions.py \
|
|
test/test_sports_capabilities.py \
|
|
test/test_sports_scroll.py \
|
|
test/test_version_consistency.py \
|
|
test/test_plugin_compatibility_gate.py \
|
|
test/test_install_preserves_existing.py \
|
|
test/test_core_owned_config_keys.py \
|
|
test/test_async_plugin_updates.py \
|
|
test/test_plugin_update_reservation.py \
|
|
test/test_template_targets.py \
|
|
test/test_widget_scripts.py \
|
|
test/test_enum_option_labels.py \
|
|
test/test_doc_links.py \
|
|
test/web_interface/test_cache.py
|