Skip to content

Make two script tests independent of the host language - #724

Open
luisleo526 wants to merge 1 commit into
mainfrom
fix-locale-independent-git-tests-v2
Open

luisleo526 wants to merge 1 commit into
mainfrom
fix-locale-independent-git-tests-v2

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

What

scripts/test_cmake_version_source.py and scripts/test_check_doc_reverts.py assert on git's own English messages (No names found, CONFLICT (content)). On a machine whose locale is not English, git answers in that language and both tests fail, although the code under test is fine.

This change pins the message language for the git subprocesses these two tests read:

  • test_cmake_version_source.py: LC_ALL=C in the shared git_env() helper (3 lines).
  • test_check_doc_reverts.py: LC_ALL=C in the merge helper conflict_with_main whose output is matched (3 lines).

No assertion is changed, loosened or skipped; only the language git speaks is fixed.

How it was found

A full Debug and Release ci_verify run on an arm64 machine with LANG=zh_TW.UTF-8 failed exactly these two tests (test_cmake_version_source, test_doc_reverts, five sub-cases) and nothing else. The same binaries pass under LC_ALL=C.

Proof (red first, then green)

Run on that arm64 machine (git 2.43.0, cmake 3.28.3), each script run directly with only LANG set (LC_ALL unset):

tree LANG test_cmake_version_source test_check_doc_reverts
base (before this change) zh_TW.UTF-8 FAILED (1 of 10): 'No names found' not found in 'fatal: 沒有發現名稱…' FAILED (5 of 24): 'CONFLICT (content)' not found in '…衝突(內容)…'
base en_US.UTF-8 OK, 10 tests OK, 24 tests
base C OK, 10 tests OK, 24 tests
this change zh_TW.UTF-8 OK, 10 tests OK, 24 tests
this change en_US.UTF-8 OK, 10 tests OK, 24 tests
this change C OK, 10 tests OK, 24 tests

Risk

Test-only; two scripts, six added lines, one changed line. Nothing under src/ or tests/ (C++) is touched.

🤖 Generated with Claude Code

test_cmake_version_source and test_check_doc_reverts compare git's own
English messages ("No names found", "CONFLICT (content)"). On a host whose
locale is not English, git answers in that language, so both tests failed
there (seen on an arm64 box running zh_TW.UTF-8) although the code under
test was fine and the same binaries pass under an English locale.

Each test now runs its git subprocesses with LC_ALL=C: the version-source
test through its shared git environment, the doc-reverts test in the merge
helper that reads the conflict message. No assertion changed or loosened;
only the language git speaks is pinned.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Graphify reviewed this change.

No issues found by static checks — no coupling regressions or blocking issues in the code graph. That is not the same as safe to merge: see what was not checked.

Not checked: tests were not run; no formal proof of the changed code.


Graphify review — findings

Pins LC_ALL=C for the git subprocesses in the doc-revert and CMake version-source tests, so they stop depending on the host locale. Both suites assert on git's English output (CONFLICT (content) and No names found), so a non-English locale would make them fail even when the code under test is fine.

No blocking issues surfaced.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 86 functions depend on the 86 functions this change touches.

Health — grade A; no new coupling hotspots.

Verification — 86 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 86 function(s) in the blast radius were not formally verified this run

This branch has not been deployed

No deployments
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.

1 participant