fix(test): enable snapshots --json on a fresh bucket#114
Merged
Conversation
The --json enable-snapshots test re-enabled the same bucket the previous test had already turned into a snapshot bucket. Setting the bucket type to Snapshot when it is already Snapshot is rejected, so the CLI exited 1. Give the --json test its own fresh regular bucket, matching how the storage SDK's own tests always enable on a newly-created bucket. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
garrensmith
approved these changes
Jun 22, 2026
|
🎉 This PR is included in version 3.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
The
bucket snapshot toggle > should output JSON with --json on enable-snapshotsintegration test fails withexpected 1 to be +0— the CLI exits1instead of0.The test before it (
should enable snapshots on an existing regular bucket) already turnstoggleBucketinto a snapshot bucket. The--jsontest then re-enables the same bucket. Setting the bucket type to Snapshot when it's already Snapshot is rejected by the server, so the CLI exits1.The bug is pre-existing on
main(from #111). It only surfaces onpush/workflow_dispatchruns, since the integration job doesn't run on PR events.Fix
Give the
--jsontest its own fresh regular bucket, matching how the storage SDK's ownsetBucketType/enableSnapshottests always enable on a newly-created bucket.Verification
tsc --noEmit,npm run lint,npm run format:checkall pass.mainintegration run (not PR CI).🤖 Generated with Claude Code
Note
Low Risk
Test-only change in
test/cli.test.ts; no production CLI or API behavior is modified.Overview
Fixes a flaky bucket snapshot toggle integration test where
buckets enable-snapshots … --jsonran on the same bucket as the prior “enable snapshots” case. After that first test, the bucket is already snapshot-enabled; enabling again is rejected by the API and the CLI exits 1, so the JSON assertion failed.The PR adds a dedicated regular bucket (
toggleJsonBucket) for the--jsontest, created and torn down alongside the existing toggle bucket, so enable-snapshots runs on a fresh bucket and can succeed withaction: 'snapshots-enabled'in stdout.Reviewed by Cursor Bugbot for commit 8e64e10. Bugbot is set up for automated code reviews on this repo. Configure here.