Skip to content

Enforce area format for commit messages and enhance testing support#953

Draft
Mearman wants to merge 11 commits intocoredevices:mainfrom
Mearman:ci/docker-testing-infrastructure
Draft

Enforce area format for commit messages and enhance testing support#953
Mearman wants to merge 11 commits intocoredevices:mainfrom
Mearman:ci/docker-testing-infrastructure

Conversation

@Mearman
Copy link
Contributor

@Mearman Mearman commented Mar 9, 2026

This pull request introduces improvements to test fixture management, documentation, and platform-specific handling in the graphics test framework. It clarifies how test fixtures differ between Linux (CI) and macOS (local development), provides scripts for running tests and generating fixtures in Docker, and updates code to ensure fixture naming is platform-aware. The changes also improve the handling of Bluetooth whitelist entries in test fakes for correctness and consistency.

Test fixture management and documentation:

  • Added tests/README.md with comprehensive instructions for running tests, generating and updating fixtures, and troubleshooting platform-specific differences. It explains the fixture naming convention and how to ensure test results match CI using Docker.
  • Introduced tests/run-tests-docker.sh and tests/generate-linux-fixtures.sh scripts to run tests and generate Linux fixtures in Docker, ensuring consistency with CI and simplifying fixture updates. [1] [2]

Platform-specific fixture handling:

  • Updated tests/fw/graphics/util.h to append ~platform-os (e.g., ~spalding-linux.pbi, ~spalding-darwin.pbi) to fixture filenames, allowing the test framework to distinguish between Linux and macOS fixtures.

Bluetooth whitelist test fakes:

  • Refactored tests/fakes/fake_HCIAPI.c to use memcpy for copying Bluetooth addresses in whitelist entry structures, improving correctness and avoiding pointer aliasing issues. [1] [2] [3] [4] [5]

Git commit linting configuration:

  • Enhanced .gitlint configuration to clarify allowed commit title formats and enable regex-style search for improved enforcement.

Mearman added 4 commits March 9, 2026 21:53
Require commit messages to use path-based areas (e.g., fw/drivers/hrm)
or known short areas (e.g., ci, docs, treewide) rather than conventional
commit types like feat:, fix:, chore:.

Co-authored-by: Claude <claude@anthropic.com>

Signed-off-by: Joseph Mearman <joseph@mearman.co.uk>
Append -darwin suffix to fixture filenames on macOS to handle rendering
differences in font libraries. Linux (CI) uses standard ~platform naming
to match existing fixtures.

Co-authored-by: Claude <claude@anthropic.com>

Signed-off-by: Joseph Mearman <joseph@mearman.co.uk>
Use memcpy for BD_ADDR_t address fields instead of direct assignment,
which was causing incorrect address comparisons in whitelist operations.

Co-authored-by: Claude <claude@anthropic.com>

Signed-off-by: Joseph Mearman <joseph@mearman.co.uk>
Add run-tests-docker.sh to run tests in Docker matching CI environment,
and generate-linux-fixtures.sh to generate Linux-specific test fixtures.

Co-authored-by: Claude <claude@anthropic.com>

Signed-off-by: Joseph Mearman <joseph@mearman.co.uk>
@Mearman Mearman force-pushed the ci/docker-testing-infrastructure branch from 3cb6262 to 6fa318e Compare March 9, 2026 21:56
Document the cross-platform fixture naming scheme, Docker testing
workflow, and troubleshooting for CI vs local test discrepancies.

Co-authored-by: Claude <claude@anthropic.com>

Signed-off-by: Joseph Mearman <joseph@mearman.co.uk>
@Mearman Mearman force-pushed the ci/docker-testing-infrastructure branch from 6fa318e to a1e42b5 Compare March 9, 2026 22:55
Restore platform suffix on Linux (e.g. ~spalding) while keeping the
additional -darwin suffix for macOS local development. This matches
the naming convention of the PNG fixture files in the repository.

Co-authored-by: Claude <claude@anthropic.com>

Signed-off-by: Joseph Mearman <joseph@mearman.co.uk>
# docs, waftools, settings, libc, tests, notifications, build, wscript, fw,
# third_party, ancs, compositor, console, kernel, health
# Conventional commit types like feat:, fix:, chore: are NOT allowed.
regex=^([a-z0-9_]+/[a-z0-9_/]*|ci|treewide|platform|sdk|tools|resources|docs|waftools|settings|libc|tests|notifications|build|wscript|fw|third_party|ancs|compositor|console|kernel|health|gitlint|readme|requirements|python_libs|pbl-tool|pbl|moddable|libutil|iconography|gitignore|capabilities|asterix|activity|accel): .*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some are bogus, please, make sure to analyze what Claude does, or our PR review time will decrease. Only ask for review when you have manually checked LLM job.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah sorry I keep forgetting to keep them as draft.
for my reference which aren't suitable?
I just scanned through the git history to build the list

Mearman added 5 commits March 10, 2026 16:42
Replace sh.pip('freeze') with subprocess.check_output(['pip', 'freeze'])
to avoid OverflowError with sh library on Python 3.14+.

Co-authored-by: Claude <claude@anthropic.com>

Signed-off-by: Joseph Mearman <joseph@mearman.co.uk>
Replace sh.rm with subprocess.run to avoid Python 3.14 compatibility
issues with the sh library.

Co-authored-by: Claude <claude@anthropic.com>

Signed-off-by: Joseph Mearman <joseph@mearman.co.uk>
Remove test_action_menu_window.c from the exclusion list to enable
the test.

Co-authored-by: Claude <claude@anthropic.com>

Signed-off-by: Joseph Mearman <joseph@mearman.co.uk>
- Fix include path from settings_notifications_private.h to
  notifications_private.h
- Add stubs_vibes.h include to resolve linker errors

Co-authored-by: Claude <claude@anthropic.com>

Signed-off-by: Joseph Mearman <joseph@mearman.co.uk>
838 test fixture images had incorrectly escaped tildes in their
filenames (e.g., '\~silk.png' instead of '~silk.png'). This caused
tests to fail because the PBI conversion and test lookup logic
expected the correct platform suffix format.

Co-authored-by: Claude <noreply@anthropic.com>

Signed-off-by: Joseph Mearman <joseph@mearman.co.uk>
@Mearman Mearman marked this pull request as draft March 10, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants