Skip to content

fix(test): pin git commit in TestDirectoryName git-directory subtest - #13290

Merged
eunomie merged 1 commit into
dagger:mainfrom
eunomie:fix-directoryname-git-commit-pin
May 30, 2026
Merged

eunomie merged 1 commit into
dagger:mainfrom
eunomie:fix-directoryname-git-commit-pin

Conversation

@eunomie

@eunomie eunomie commented May 30, 2026

Copy link
Copy Markdown
Member

Problem

TestDirectoryName's git directory subtest fetched the tree via:

c.Git("https://github.com/dagger/dagger#ee32df913f57c876e067bd5ecc159561510b6f50").Head().Tree()

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 live main, not the pinned commit ee32df91. It passed only because main happened to contain a .dagger directory.

After .dagger was removed from main (#13228), live main no longer has it, so the subtest now fails:

failed to make directory content hashed: stat .dagger: no such file or directory

(.entries and .file on .dagger fail the same way — it's simply absent from live main; 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 what main points to.

Verification

Against the pinned commit ee32df91, all three assertions hold: root "/", .dagger → ".dagger/", sdk/go → "go/".

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]>
@eunomie
eunomie merged commit 8df0a00 into dagger:main May 30, 2026
77 checks passed
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]>
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.

2 participants