fix(ci): add missing test deps to Moto workflow#6
Merged
Conversation
- Add freezegun to pip install (moto[all] doesn't include test deps) - Change --tb=no to --tb=short so collection errors are visible in logs Without freezegun, test files using @freeze_time fail to collect, causing entire services (STS, IAM, SQS, etc.) to report 0-1 tests instead of the actual test count.
a8b504e to
5189c2c
Compare
Only run Moto tests for services FakeCloud implements: sqs, sns, events, iam, sts, ssm Cuts CI time from ~5min (100+ services) to ~1min.
ericz7900
pushed a commit
to ericz7900/fakecloud
that referenced
this pull request
Jun 27, 2026
…a, lazy read Bug-hunt 2026-06-26 cycle 3, batch 2 — fixes three regressions from the cycle-3 AMI-seed work (faiscadev#1964/faiscadev#1965) plus a pre-existing stub. - faiscadev#2 (MEDIUM): DeregisterImage / ModifyImageAttribute had no owner guard, so a caller could remove or mutate the seeded amazon/Canonical-owned public AMIs in its own account — permanently breaking `data.aws_ami { owners=["amazon"] }` (the exact thing the catalogue exists for). Now reject ops on an AMI owned by another owner with AuthFailure, matching AWS. A user-registered AMI (owner_id == None) is still freely deregistered/modified. - faiscadev#5 (LOW): a snapshot written by a pre-faiscadev#1964 binary restored an account whose images map lacked the seeds, and the read-path fallback only seeds ABSENT accounts — so after upgrade+restart `aws_ami` returned empty. On restore, idempotently reseed the public catalogue into every restored account (deterministic ids -> no-op for already-seeded). - faiscadev#4 (LOW): ReplaceImageCriteriaInAllowedImagesSettings was a write-succeeds/ read-default stub. Now persist the ImageCriterion ImageProviders on state and emit them from GetAllowedImagesSettings (round-trips). - faiscadev#6 (LOW): DescribeImages eagerly built the (now seed-heavier) throwaway Ec2State on every read; use a deferred fallback so it's constructed only for a not-yet-created account. Tests: new e2e ec2_ami_catalogue (seed deregister/modify rejected + user AMI ok; ReplaceImageCriteria round-trip; catalogue survives restart). ec2 image conformance (register/modify/deregister/get-allowed/replace) green.
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
freezegunto pip install —moto[all]doesn't include test dependencies, causing@freeze_time-decorated test files to fail collection--tb=noto--tb=shortso collection errors are visible in logsWithout this fix, services like STS (28 tests), IAM (384 tests), and SQS (172 tests) report near-zero test counts because entire files fail to import.
Summary by cubic
Add
freezegunto the Moto CI workflow and switch pytest to--tb=shortto surface collection errors, fixing@freeze_timeimports and restoring accurate test counts (e.g., STS, IAM, SQS).Limit runs to services FakeCloud implements (
sqs,sns,events,iam,sts,ssm) to cut CI time from ~5min to ~1min.Written for commit 13e6b5c. Summary will update on new commits.