Repository navigation
fix(test): pin git commit in TestDirectoryName git-directory subtest - #13290
Merged
Merged
Conversation
The subtest used c.Git(url#sha).Head().Tree(), but the core git().head() API does not honor the URL #fragment: it resolves to the live default-branch HEAD. The test therefore always ran against live main instead of the pinned commit, and only passed because main happened to contain a .dagger directory. After .dagger was removed from main (dagger#13228), it began failing with "stat .dagger: no such file or directory". Pin the commit explicitly via .Commit(sha) so the test is deterministic and exercises the intended historical tree. Signed-off-by: Yves Brissaud <[email protected]>
grouville
approved these changes
May 30, 2026
shykes
pushed a commit
that referenced
this pull request
Jun 1, 2026
…13290) The subtest used c.Git(url#sha).Head().Tree(), but the core git().head() API does not honor the URL #fragment: it resolves to the live default-branch HEAD. The test therefore always ran against live main instead of the pinned commit, and only passed because main happened to contain a .dagger directory. After .dagger was removed from main (#13228), it began failing with "stat .dagger: no such file or directory". Pin the commit explicitly via .Commit(sha) so the test is deterministic and exercises the intended historical tree. Signed-off-by: Yves Brissaud <[email protected]>
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.
Problem
TestDirectoryName'sgit directorysubtest fetched the tree via:The core
git().head()API does not honor the URL#fragment— it resolves to the live default-branch (main) HEAD. So this subtest has always run against livemain, not the pinned commitee32df91. It passed only becausemainhappened to contain a.daggerdirectory.After
.daggerwas removed frommain(#13228), livemainno longer has it, so the subtest now fails:(
.entriesand.fileon.daggerfail the same way — it's simply absent from livemain; the content-hashing path is just the first consumer to notice.)Fix
Pin the commit explicitly with
.Commit(sha)(the idiom already used elsewhere in this suite) so the test is deterministic and exercises the intended historical tree regardless of whatmainpoints to.Verification
Against the pinned commit
ee32df91, all three assertions hold: root"/",.dagger→".dagger/",sdk/go→"go/".