base red (macOS): the non-UTF-8 secret-name tests accept APFS's EILSEQ, as #32091 does

Merged
LA
15h ago
+14-2

Summary

Base red on macOS: cmux-tui link::seed::tests::a_secret_with_a_non_utf8_name_is_left_out (#30923) and cmux-tui-core git_seed::tests::export::a_secret_with_a_non_utf8_name_never_goes (#30633) fail on every macOS run (feat tip 036f8aa5 job 856e771816456834927eabfa; 78ee0e108e1 too): Os { code: 92, ... "Illegal byte sequence" } at the test's own fs::write. They pass on Linux.

Cause: the tests create a file named b".env-\xff". APFS refuses a name that is not valid UTF-8 (EILSEQ), so the setup fails before the product code runs. No folder on macOS can hold such a secret, so the product path the tests check cannot meet one there. Side: test. The same case was fixed the same way for git_seed/secrets.rs in #32091 (reviewed).

Fix: both tests accept EILSEQ on macOS only and stop there; any other error still fails, and on Linux (ext4 takes raw bytes) the assertions run unchanged. Not deterministic-red work needed: the red is deterministic on every macOS run.

Testing

  • Red at feat tip 00655a404302 on macOS (job e7ace611cf651cd47f870932): 2 of 2 fail; Linux (job of key b3-utf8-linux): 2 of 2 pass.
  • Green at head c74c1d6c08b: macOS all (job b2aafbea47347a0e66eb2972): fmt, clippy pass, 2 of 2; Linux all (job 48c34fa024a8fa722da5b07b): fmt, clippy pass, 2 of 2.
  • python3 scripts/cmux-next/prepush-gate.py: no new violations.

Observed / Not run

  • Observed: the results above.
  • Not run: nothing else.

Changelog

none


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes two tests that fail on every macOS run because APFS refuses non-UTF-8 filenames (EILSEQ), so the tests couldn't set up their fixture. Both tests now accept EILSEQ on macOS only and stop there; on Linux they run unchanged. This mirrors the same fix applied to git_seed/secrets.rs in #32091.