Skip to content

test(#756): pin EC2's storage and image projections and record them - #1330

Merged
scttfrdmn merged 1 commit into
mainfrom
test/756-ec2-storage-projections
Oct 2, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
test/756-ec2-storage-projections

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

This is the second of three PRs for EC2 in #756's AC3. It covers the storage and image records, 6
of EC2's 30 baseline lines. As with #1329, no production code changes: EC2 is already projected
in code, and this adds the citations.

What it adds

Three tests extend emulator/ec2_wire_test.go, driving 17 routed operations with the harness
#1329 introduced:

Record Operations
EC2Volume CreateVolume, AttachVolume, DescribeVolumes (while attached), DetachVolume, DeleteVolume
EC2Snapshot CreateSnapshot, CreateSnapshots, CopySnapshot, DescribeSnapshots, ModifySnapshotAttribute, DescribeSnapshotAttribute (after a grant), ResetSnapshotAttribute, DeleteSnapshot
EC2Image CreateImage, RegisterImage, DescribeImages, DeregisterImage
  • CreateSnapshots, CopySnapshot and RegisterImage each write a record of their own. Each of
    those records is read back from state and proved to carry both scope members, so a body built
    from it is anchored as well.
  • The image test starts from CreateImage, not a bundled catalog AMI, because a catalog entry is
    not a record this account wrote.

Negative control (run, then restored; ec2_plugin.go verified diff-free)

I injected account_id into volumeSet, Region into snapshotSet and AccountID into
imagesSet. Exactly the three new tests failed, and none of #1329's seven:

  • Volume/DescribeVolumes
  • Image/DescribeImages
  • Snapshot/DescribeSnapshots and Snapshot/CreateSnapshots

The fourth failure is correct, not noise: CreateSnapshots' published response renders its own
<snapshotSet> of the records it wrote.

The ratchet

before: 319 declared, 185 projected across 75 records, 134 still reachable
after:  319 declared, 191 projected across 78 records, 128 still reachable

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 stays open. PR 3 covers the compute records: EC2Instance, including its EverTagged
vacuity trap, EC2KeyPair with CreatedAt, EC2LaunchTemplate and EC2PlacementGroup.

EC2Volume, EC2Snapshot and EC2Image each declare AccountID and Region under
wire-visible json tags, six of the inventory's lines, and none reaches a
response, for the reason the networking set's PR gives. Three tests extend
emulator/ec2_wire_test.go and drive seventeen routed operations. CreateSnapshots,
CopySnapshot and RegisterImage each write a record of their own, and each of
those is read back from state too.

check-wire-bookkeeping goes from 185 projected across 75 records to 191 across
78, and from 134 still reachable to 128, of the same 319 declared.

#756 stays open: EC2's compute records follow.
@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 6e036fd into main Oct 2, 2026
18 checks passed
@scttfrdmn
scttfrdmn deleted the test/756-ec2-storage-projections branch October 2, 2026 04:15
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