Repository navigation
test(desktop): restore exact host bytes in the reversion tests on Windows - #2281
Merged
Merged
Conversation
…dows Since #2277 the test helper returns git output without text-mode newline translation. Two tests wrote a CRLF blob back with write_text, which on Windows turned each CRLF into CR CR LF, so the reversion was no longer exact and the feature commit stayed in the release intent. The tests now write the blob's bytes back, and the helper normalizes line endings as the text-mode call did.
Member
Author
Independent adversarial review: APPROVEFrom: Grok This is a tests-only change, and it fixes the cause the author describes. The two reversion tests now write the blob's exact bytes back with Tests at this head (Linux x86_64, locked desktop env)
Can the release scripts mishandle CRLF the same way? (coordinator's question) I don't see a path.
CI
Generality gate: test-harness change only, with no app- or customer-specific terms. Pass. Limits: I couldn't run anything on Windows or macOS. The CRLF result above is a Linux simulation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#2277 fixed the macOS hang but broke four tests on Windows. Packages run 44561131756 on main (43402aa) failed both Windows engine-test jobs:
test_exact_reversion_after_combination_discards_merged_feature_intent[fix-patch]and[chore-None]test_test_merge_keeps_a_canceled_feature_out_of_surviving_intent[fix-patch]and[chore-None]Each reported
assert 'minor' == 'patch'orassert 'minor' == None.Cause
The fault is in the tests, not in the release scripts. Both tests restore a file to its earlier content with:
On Windows the fixture's
src/host.txtblob holds CRLF, becausewrite_textwrote it and the fixture turnscore.autocrlfoff. Before #2277 the test helper ran git withtext=True, which turned CRLF into LF, andwrite_textthen wrote CRLF again, so the bytes matched. #2277 changed the helper to decode the raw output, which keeps CRLF, andwrite_textthen wrote CR CR LF. The restore was no longer exact, so the merged feature commit stayed in the release intent and the level came out asminor.The dispatched run on the #2277 branch (44554323294) had the same four Windows failures. I reported that pull request while its Windows jobs were still running and did not go back to them.
Fix
host.write_bytes(_blob(...))), which is what "restore the exact host" means on every platform._gitnormalizes line endings to\n, as the text-mode call did, so no other caller changes behaviour.Only
tests/changes. No version bump;check_release_intent.pypasses.Testing