test(context_engine): skip the chmod attachment case when the runner is root - #313
Open
Handsome-wzw wants to merge 1 commit into
Open
test(context_engine): skip the chmod attachment case when the runner is root#313Handsome-wzw wants to merge 1 commit into
Handsome-wzw wants to merge 1 commit into
Conversation
…is root The case chmods a file to 000 and expects `build_user_content` to report an unreadable attachment as a note. Root ignores the mode bits, so the read succeeds, the picture is inlined, and the assertion sees content blocks where it wanted a string. Our runner is root; GitHub's is not, which is why the case arrived green from upstream and failed here on its first run. Guarded rather than rewritten: the behaviour under test is worth pinning where permissions actually apply. Same spelling as the existing guard in tests/test_importer_hermes_skills.py. `os` moves to module scope because the decorator is evaluated there. Co-authored-by: Claude (claude-opus-5) <noreply@anthropic.com>
Collaborator
|
@claude review |
|
Claude finished @0xKT's task in 2m 19s —— View job Review:
|
12 tasks
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.
Summary
test_an_attachment_that_cannot_be_read_costs_a_note_not_the_turnmakes a fileunreadable with
chmod 000and asserts the renderer notes the failed attachmentinstead of failing the whole turn.
chmod 000does not block a root user, sothe file stays readable, the error path is never entered, and the case fails for
anyone running the suite as root. It passes in CI, which does not run as root,
so the failure is invisible there and shows up only on a developer's machine.
Skipped for root rather than reworked: the behaviour under test is what happens
when a read raises, and making that happen without permissions means faking the
error, which would test the mock. The case is worth keeping for the runs that
can exercise it honestly.
The commit is
0xKT's, cherry-picked from the GitLab trunk where it alreadylanded. Authorship is preserved.
Type
Test-only.
Verification
Before this, the same command as root gave
1 failed, 105 passed, with thefailure on this case. The skip reason names the cause, so a reader is not left
guessing why it is absent.
Risk
None to the product: no source file is touched. Non-root runs, CI included,
execute the case exactly as before.
Related Issues
N/A