Conversation
- Move inline Python from sync-tag-definitions.yml into scripts/fetch_tag_types.py and scripts/generate_tag_types.py for easier debugging and change tracking - Fix re.sub() crash on Unicode escape sequences (e.g. \u2010) by using string slicing instead of regex replacement - Fix string vs integer key type mismatch when comparing JSON data - Fix lexicographic sorting of type IDs - Use ensure_ascii=False to preserve Unicode characters in output - Add 28 tests covering all script functions Co-authored-by: Misiu <1741838+Misiu@users.noreply.github.com>
…e assertion Co-authored-by: Misiu <1741838+Misiu@users.noreply.github.com>
|
@copilot some tests are failing =================================== FAILURES =================================== image_gen = <custom_components.opendisplay.imagegen.core.ImageGen object at 0x7f6e1bde15b0>
E AssertionError: Overlapping elements drawing failed tests/drawcustom/common_test.py:101: AssertionError
|
... The |
|
@copilot please fix that pre-existing test. we should have all green situation |
The reference image overlapping_elements.png was saved as a real PNG while the image generator produces JPEG output. All other reference images are JPEG data (with .png extension). This mismatch caused the pixel-exact comparison to fail. Regenerated the reference from the current image generator output. Co-authored-by: Misiu <1741838+Misiu@users.noreply.github.com>
Fixed in 0d5e1db. The root cause: |
All 52 test reference images contain JPEG data (confirmed by FFD8FF magic bytes) but had incorrect .png extensions. The image generator (core.py:411) explicitly outputs JPEG format. - Rename all 52 reference images from .png to .jpg - Update all 15 test files to reference .jpg instead of .png - Verified all 82 tests pass Co-authored-by: Misiu <1741838+Misiu@users.noreply.github.com>
The
Sync Tag Type Definitionsworkflow crashes withre.error: bad escape \ubecausejson.dumps()produces\uXXXXsequences thatre.sub()interprets as invalid regex backreferences. Additional bugs: JSON string keys never match integer keys in the comparison dict, and string-based sorting orders IDs lexicographically. Separately, all 52 test reference images are JPEG data (confirmed viaFFD8FFmagic bytes) but had.pngextensions.Workflow script extraction & fixes
scripts/fetch_tag_types.pyandscripts/generate_tag_types.pyreplace ~160 lines of heredoc Python in the workflow YAMLre.sub()crash — Use string slicing instead of regex replacement:{int(k): v for k, v in raw.items()})ensure_ascii=Falseinjson.dumps()to avoid spurious diffsTest image extensions
.pngto.jpg— the image generator explicitly outputs JPEG (format='JPEG').jpgTests
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.