Repository navigation
Conversation
|
Thanks for this @bfs2021 . The C.UTF-8 fallback works: the Alpine job goes from 32 skips to 5, and the 1. Keep the Turkish locale test skipped on musl The test checks the 2. Add the skip-count guard With item 1 done, the Alpine job should skip 10 tests (the current 5 plus 5 Turkish). A 3. Use one shared locale lookup The PR adds the musl fallback to each copy separately. 4. Drop the musl version floor, or give a source for it As far as I can tell, C.UTF-8 has been musl's default since 1.1.11 in 2015 5. Commit and PR title |
|
All five points are addressed in 5e23c83:
With these in, all four proposed fix steps from #152 are covered by this PR, so |
Problem
In the Alpine (
test-alpine) CI job and in the officialbash:*images, every UTF-8 test skips: the summary shows 26 locale skips pluscheck-posix-compat.sh ...skipping because ShellCheck isn't installed, so CI reports 0 failures without having run the coverage that matters most on musl (the 3.0 BusyBox script-name bug appeared exactly there).Fixes #152 (all four proposed fix steps from the issue are covered here)
Root cause
The test helpers discover a UTF-8 locale with
locale -a. musl ships nolocaleutility, so the lookup returns nothing even though musl supportsC.UTF-8(and accepts every other locale name) without installed locale files — musl's default since 1.1.11 in 2015. The Alpine job also never installs ShellCheck.Fix
musl_c_utf8intests/test_helpers.sh: returns 0 on any musl system, by matching theldd --versionbanner. musl'slddprints the banner on stderr and exits 1, andrun_tests.shruns withpipefail, so the banner is captured first and the probe's status comes fromgrepalone (a plain pipeline always returns 1 under pipefail). No version floor: C.UTF-8 has been musl's default since 1.1.11 (2015), and a banner without aVersionline can no longer change the result.utf8_locale_nameintests/test_helpers.shholds the candidate loop plus the muslC.UTF-8fallback; the copies intest_posix_compat.share gone.equivalence_utf8_locale(test_validator_equivalence.sh) keeps only the Linux-only check at the equivalence call site and delegates to the shared helper.compat_locale_available(test_shell_compat.sh) routes itsC.UTF-8case through the shared helper; other names stay unavailable since musl only speaks UTF-8.test_posix_levels_in_turkish_localestays skipped on musl, with a reason: musl has no locale-specific case mapping, sotr_TR.UTF-8behaves likeC.UTF-8and the test would pass even with theLC_ALL=Cguard around thetrcase mapping inlogging.shremoved. Other systems keep thelocale -acheck.TEST_MAX_SKIPPEDguard inrun_tests.sh: when set, a run that skips more tests than the threshold fails. Thetest-alpinejob setsTEST_MAX_SKIPPED=10(the 5 intentional skips plus 5 Turkish-locale skips), so a future change cannot silently skip coverage again.test-alpinejob installsshellchecksocheck-posix-compat.shruns there too.Testing
In
alpine:latest, non-root like CI, with thetest-alpinejob's command (TEST_SHELLS="bash,bash --posix,zsh,dash,busybox sh" TEST_REQUIRE_SHELLS="zsh dash busybox"plusTEST_MAX_SKIPPED=10):Total Tests: 907, Passed: 875, Failed: 0, Skipped: 32— 26 locale skips (no UTF-8 locale installed,locale C.UTF-8 is not installed,tr_TR.UTF-8 locale not installed, ...), plusshellcheck not installed.Total Tests: 907, Passed: 897, Failed: 0, Skipped: 10— every UTF-8 test runs and passes on musl, includingvalidators match validators_utf8.tsvandutf8_messages.sh matches bash. The 10 remaining skips are the 5 intentional ones plus the Turkish-locale test, now skipped on musl with its reason;TEST_MAX_SKIPPED=10passes exactly at the threshold.TEST_MAX_SKIPPED=0on a suite with skips exits 1 withError: 2 tests skipped, exceeding TEST_MAX_SKIPPED=0; a non-integer value is rejected the same way.locale -astill drives detection andmusl_c_utf8returns 1 (verified on Git Bash/MSYS, wherelocale -alistsC.utf8).