Skip to content

fix(test): make build-id HEAD test run without checkout .git - #698

Merged
danshapiro merged 1 commit into
mainfrom
fix/build-id-test-cloud-fix
Aug 29, 2026
Merged

fix(test): make build-id HEAD test run without checkout .git#698
danshapiro merged 1 commit into
mainfrom
fix/build-id-test-cloud-fix

Conversation

@danshapiro

Copy link
Copy Markdown
Owner

Summary

  • test/server/build-id.test.ts's computeBuildId test asserted against the checkout's own HEAD via git rev-parse HEAD. On cloud vitest images .git/ is excluded from the build context (.gcloudignore/".dockerignore"), so the test failed there deterministically — the only red in the full cloud suite at 6c541bec.
  • The test now builds a fixture git repo in a tmpdir and asserts computeBuildId(dir) against that repo's HEAD. Same coverage, works anywhere a git binary exists.

Verification

  • Focused local: npm run test:vitest -- run test/server/build-id.test.ts --config config/vitest/vitest.server.config.ts → 8/8 pass.
  • Coordinated full suite, cloud backend, on this branch commit (e49c2f66f): all shards green, including test/server/build-id.test.ts ✓ (8 tests) on cloud.

The computeBuildId test asserted against this checkout's HEAD, which is
impossible on the cloud vitest/backend images: .git/ is excluded from the
build context (.gcloudignore/.dockerignore), so 'git rev-parse HEAD' fails
there deterministically. Build a fixture git repo in a tmpdir instead —
same coverage, works everywhere a git binary exists.
@danshapiro
danshapiro merged commit 9737317 into main Aug 29, 2026
3 checks passed
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