Repository navigation
test(#756): pin S3's bucket projection and record it - #1350
Merged
Merged
Conversation
S3Bucket declares account_id, region and ever_tagged, and none reaches a response: every bucket response is an XML struct declared for its operation, and the published members that sound alike (BucketRegion, LocationConstraint) are different names. emulator/s3_wire_test.go drives the operations that answer the bucket, tagging it and reading ever_tagged back before walking any response. GetBucketLocation is not driven: ?location is unrouted and falls through to ListObjects, which is how #1349 was found. check-wire-bookkeeping goes from 252 projected across 105 records to 255 across 106, and from 58 still reachable to 55. #756 stays open.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
This is the fourth of ten PRs in #756's 3-line block. It is citation only, and writing it
uncovered #1349.
S3 is already projected
S3Bucketdeclaresaccount_id,regionandever_tagged,omitempty. None of them reaches a body,because every bucket response is an XML struct declared for its operation. The published members that
sound alike are different names:
ListBuckets'BucketRegionandGetBucketLocation'sLocationConstraint. The walk is a case-folded equality, so neither collides.What the new test asserts
emulator/s3_wire_test.gouses the sharedwireAssertNoMemberXMLto drive the operations that answerthe bucket record: CreateBucket, PutBucketTagging, HeadBucket, ListBuckets, GetBucketTagging,
DeleteBucketTagging and DeleteBucket.
account_idandregionback from the stored record.ever_tagged: trueback first (fix(tagging): GetResources reports untagged resources, which AWS omits #938, fix(#756): render EFS responses from the published shape #1304).Two things this test caught
GetBucketLocationpresence anchor read aListBucketResult. The bucket router reaches its defaults by absence: any sub-resource it doesnot list falls through to
ListObjects,CreateBucketorDeleteBucket. A probe showedDeleteBucketCors,DeleteBucketEncryption,DeleteBucketWebsite,DeleteBucketOwnershipControlsand
DeleteBucketReplicationeach answer 204 and delete the bucket. That is S3: ?publicAccessBlock is unrouted; PUT hits CreateBucket and DELETE deletes the bucket #446's failureagain, for every sub-resource S3: ?publicAccessBlock is unrouted; PUT hits CreateBucket and DELETE deletes the bucket #446 did not enumerate.
GetBucketLocationis therefore not drivenhere, and a comment points at s3: an unrouted bucket sub-resource falls through to DeleteBucket, so DeleteBucketEncryption (and four others) delete the bucket #1349. The fix is the next PR.
CreateBucketandPutBucketTagginganswer empty bodies, sotheir held body was
nil, and the test, which keyed onbody == nil, re-issued them asGET /andwalked
ListBucketsin their place. The injection control exposed it. It now keys on the casehaving no method. The earlier wire tests' held bodies are all non-empty, so none of them had this
problem.
Negative controls (each run, then restored;
s3_plugin.goverified diff-free)account_idinto<Buckets>fails exactlyListBuckets. That is after fixing mytest; before the fix it also, misleadingly, failed the two held cases.
ever_taggedread-back.The ratchet
Verification
All of these pass:
make lint: 0 issues.make test: race,-count=1.docs-reference-check docs-versions version-check discarded-unmarshal-check wire-bookkeeping-check operation-catalog-check operation-docs-check.#756 and #1349 stay open. #1349 gets its own PR next.