Skip to content

test(#756): pin EC2's compute projections and record them - #1331

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

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

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

This is the third and last of the EC2 PRs in #756's AC3. It covers the compute records, which are
the remaining 10 of EC2's 30 baseline lines. After this, every EC2 record is cited. As with
#1329 and #1330, there are no production code changes.

What it adds

Four tests extend emulator/ec2_wire_test.go, driving 24 routed operations:

Record Operations
EC2Instance RunInstances, DescribeInstances, DescribeInstanceStatus, DescribeInstanceAttribute, ModifyInstanceAttribute, RebootInstances, StopInstances, StartInstances, CreateFleet, TerminateInstances
EC2KeyPair CreateKeyPair, ImportKeyPair, DescribeKeyPairs, DeleteKeyPair
EC2LaunchTemplate CreateLaunchTemplate, CreateLaunchTemplateVersion, ModifyLaunchTemplate, DescribeLaunchTemplates, DescribeLaunchTemplateVersions, DeleteLaunchTemplateVersions, DeleteLaunchTemplate
EC2PlacementGroup CreatePlacementGroup, DescribePlacementGroups, DeletePlacementGroup

CreateFleet is in the instance test because a fleet launches through the same path, so its
instances are EC2Instance records too.

The two ,omitempty members, which are where an assertion could be vacuous

Each record's account member is read under its own spelling: accountId for EC2KeyPair,
accountID for EC2LaunchTemplate, and account_id for the others.

Negative controls (each run, then restored)

  1. Per-record isolation. I injected ever_tagged into reservationSet, CreatedAt into
    keySet, accountID into launchTemplates and account_id into placementGroupSet. Exactly
    the four new tests failed, each on its Describe subtest, and none of the ten earlier tests did.
    ec2_plugin.go was verified diff-free afterwards.
  2. The vacuity guard works. With the CreateTags step removed, the instance test fails with
    instance:…/i-… must persist ever_tagged before an absence assertion on it means anything. It
    fails before any response is walked, not after passing on an absence.

One correction while writing this

I first wrote a "valid ed25519 key" for ImportKeyPair, with a comment saying the handler would
fingerprint it. The handler does not parse the material at all. The test now uses the short value
TestEC2_KeyPair_Import uses, and its comment says plainly that it asserts on the response, not on
import validation.

The ratchet

before: 319 declared, 191 projected across 78 records, 128 still reachable
after:  319 declared, 201 projected across 82 records, 118 still reachable

Across the three PRs, EC2 went from 148 to 118 reachable. All 14 EC2 records are cited, across 78
subtests.

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: 118 lines remain in AC3's tail.

EC2Instance, EC2KeyPair, EC2LaunchTemplate and EC2PlacementGroup are the last
four EC2 records, ten of the inventory's lines. Four tests extend
emulator/ec2_wire_test.go and drive twenty-four routed operations, CreateFleet
among them since a fleet's instances are EC2Instance records too.

Two of the four carry a third bookkeeping member under omitempty, and each is
read back from the record before any absence is asserted. EverTagged is set only
by a tag write (#938), so the instance test calls CreateTags first; a control
without it fails at the read-back rather than passing vacuously, which is the
trap #1304 fell into on EFS. CreatedAt is written on both key-pair create paths
and DescribeKeyPairs is anchored on the published createTime it feeds.

check-wire-bookkeeping goes from 191 projected across 78 records to 201 across
82, and from 128 still reachable to 118, of the same 319 declared. All thirty of
EC2's baseline lines are now cited.

#756 stays open: 118 lines remain in AC3's tail.
@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 5571218 into main Oct 2, 2026
20 of 21 checks passed
@scttfrdmn
scttfrdmn deleted the test/756-ec2-compute-projections branch October 2, 2026 04:21
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