test(coverage): drive common to >=95% coverage#31
Merged
Conversation
Caps the cross-repo 95% coverage push for `common`. After PRs #25-#30 landed for crypto/nats/plans/readiness/r2/logctx, the two remaining storage backends sat at 63.6% (dospaces) and 72.2% (s3). dospaces -> 100.0% via accessor + customerEndpointURL fallback coverage: all simple getters (MasterAccessKey, MasterSecretKey, Endpoint, PublicURL, Bucket, Region, UseTLS) plus the scheme-prefix and already-schemed endpoint branches inside customerEndpointURL(). s3 -> 97.2% via accessor + IssueTenantCredentials default-fallback + safeSessionName branch coverage: digits/dashes/underscores retained, RoleSessionName truncation at 56, customerEndpointURL passthrough for already-schemed endpoints, RevokeTenantCredentials no-op confirmation, and AssumeRole error propagation through IssueTenantCredentials. Total: 94.5% -> 98.0%. Every package now >=95%. Coverage block (rule 17): Symptom: common total 94.5% < 95% target; per-pkg dospaces/s3 below floor Enumeration: go tool cover -func | sort | grep "<100" Sites found: 2 (storageprovider/dospaces, storageprovider/s3) Sites touched: both Coverage test: TestRegistry_AllProvidersSatisfyContract + per-backend registry-walk tests already in place; new coverage files add accessor + edge-branch assertions. Live verified: go test ./... -short -coverprofile cov.out; total = 98.0% Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Caps the cross-repo 95% coverage push for
common. After PRs #25-#30 landedfor crypto/nats/plans/readiness/r2/logctx, two storage backends remained
below the floor:
storageprovider/dospaces63.6% -> 100.0%storageprovider/s372.2% -> 97.2%Total: 94.5% -> 98.0%. Every package is now >=95%.
What's covered
dospaces: accessor methods (MasterAccessKey, MasterSecretKey, Endpoint,
PublicURL, Bucket, Region, UseTLS) plus the scheme-prefix and
already-schemed endpoint branches inside
customerEndpointURL().s3: accessor methods,
IssueTenantCredentialsdefault-fallbackbranches (empty Prefix/Bucket/TTL),
safeSessionNamebranch coverage(digits/dashes/underscores retained, truncation at 56),
customerEndpointURLpassthrough for already-schemed endpoints,RevokeTenantCredentialsno-op confirmation, and AssumeRole errorpropagation.
Approach
No production code changes. The two storage providers don't talk to AWS
SDK directly — dospaces returns the master key verbatim; s3 already
exposes
SetAssumeRoleFuncfor test injection. Coverage gains come fromexercising existing branches via the public API.
Test plan
go test ./... -short -coverprofile=cov.out -covermode=atomicgo vet ./...cd ../api && go build ./...(no break)cd ../worker && go build ./...(no break)cd ../provisioner && go build ./...(no break)_test.gofiles added)Coverage block (rule 17)
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
🤖 Generated with Claude Code