Skip to content

fix(test): use a real snapshot version in presign integration tests#113

Merged
designcode merged 1 commit into
mainfrom
fix/presign-snapshot-test
Jun 22, 2026
Merged

fix(test): use a real snapshot version in presign integration tests#113
designcode merged 1 commit into
mainfrom
fix/presign-snapshot-test

Conversation

@designcode

@designcode designcode commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Problem

The two presign --snapshot-version integration tests fail on the push-triggered CI run (example) with expected 1 to be +0 — the CLI exits 1 instead of 0.

They hardcoded a snapshot version 1765889000501544464 (= 2025-12-16T12:43:20Z), but presign-test.txt is created fresh in beforeAll at test runtime. The storage SDK resolves --snapshot-version by finding an object version with versionId <= snapshotVersion; the freshly-created object's version always post-dates the hardcoded timestamp, so no version qualifies and the SDK returns Object "presign-test.txt" did not exist at snapshot version ....

It went unnoticed until now because the integration job only runs on push/workflow_dispatch (not pull_request), so the test had never actually executed before.

Fix

Take a real snapshot of testBucket after creating the object and presign against its version, mirroring the existing ls/stat snapshot tests. The snapshot version now post-dates the object, so resolution succeeds.

Verification

  • tsc --noEmit, npm run lint, npm run format:check all pass.
  • Integration behavior validated by the push-triggered CI job.

🤖 Generated with Claude Code


Note

Low Risk
Test-only change in integration setup; no production CLI or SDK behavior is modified.

Overview
Fixes flaky/failing presign integration tests that passed a hardcoded --snapshot-version while presign-test.txt is created at runtime. Snapshot resolution needs an object version the snapshot version, so the fixed timestamp could never match a fresh object and the CLI exited with an error.

The presign beforeAll now takes a snapshot after creating the object and reads the version from snapshots list --format json, then uses that value in the --snapshot-version, --snapshot, and PUT-rejection cases—same pattern as other snapshot integration tests.

Reviewed by Cursor Bugbot for commit c5e4aef. Bugbot is set up for automated code reviews on this repo. Configure here.

The presign --snapshot-version tests hardcoded a snapshot timestamp
(2025-12-16) that predates the freshly-created test object. The storage
SDK resolves --snapshot-version by finding an object version <= the
snapshot version, so no version qualified and the CLI exited 1.

Take a real snapshot after creating the object and presign against its
version, mirroring the existing ls/stat snapshot tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@designcode designcode merged commit 6454d0d into main Jun 22, 2026
3 checks passed
@designcode designcode deleted the fix/presign-snapshot-test branch June 22, 2026 16:58
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants