mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-05-09 08:25:54 +02:00
[GH-ISSUE #1213] [Bug]: Locale dependant time formatting in automated tests #882
Labels
No labels
A1
automated
automated
bug
bug
Closed due to inactivity
contrib
dependencies
dependencies
duplicate
enhancement
feedback
hold
invalid
Notes
P1S
pull-request
security
ThumbsUp
user-report
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/bambuddy-maziggy-1#882
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @maugsburger on GitHub (May 5, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/1213
Originally assigned to: @maziggy on GitHub.
Component
Bambuddy
Bug Description
Followup to https://github.com/maziggy/bambuddy/pull/1205#issuecomment-4377328522
Got it. But allow me two questions:
How to tell these are "internal" files?
They are mentioned in https://github.com/maziggy/bambuddy/blob/dev/CONTRIBUTING.md#testing to be used for testing; the date and time format tests failed on my system as I have locale settings leading to the times times being output using
.instead of:, which lead to test failures infrontend/src/__tests__/utils/date.test.tsTests should not fail depending on system specific defaults, the tests must be system config agnostic.
To fix this, we could:
frontend/src/utils/date.tsto globally set other options (didn't check the implications in other parts of the code)Opened this case to discuss the best option prior to changing anything.
Expected Behavior
Tests should pass independently of the systems locales.
Steps to Reproduce
Run the tests with LC_ALL="en_DK.UTF-8":
Bambuddy Version
dev
Installation Method
Manual (git clone)
Operating System
Linux (Arch)
Checklist
@maziggy commented on GitHub (May 5, 2026):
You're right — option 4 is the right direction, and the answer to (1) is "these aren't internal files."
test_frontend.sh and test_backend.sh are the contributor-facing test runners documented in CONTRIBUTING.md (Testing section). I do keep some local tweaks in mine and reacted too sharply on #1205 — sorry about that.
The right fix is on my side (keeping personal modifications uncommitted), not asking contributors to avoid touching documented files. I'll add a note to CONTRIBUTING.md if there's anything that should genuinely be hands-off.
For the actual bug: option 4 with one tweak is the cleanest. Use \D+ (any non-digit, one or more) instead of [:.] so the regex covers any locale separator — en_DK.UTF-8 uses ".", some en_* locales use a narrow no-break space (U+202F), most use ":". Tests the actual contract ("hours and minutes, separated somehow") rather than coupling to a specific separator.
Patch:
I verified this passes under en_DK.UTF-8, en_US.UTF-8, and de_DE.UTF-8.
Thanks for opening the issue; appreciated.
Available/Fixed in branch dev and available with the next release or daily build. Please let me know if it works for you.
If you find Bambuddy useful, please consider giving it a ⭐ on GitHub — it helps others discover the project!