Skip to content

test(e2e): fix all ignored tests, drop duplicates#367

Merged
vieiralucas merged 1 commit intomainfrom
worktree-fix-ignored-tests
Apr 14, 2026
Merged

test(e2e): fix all ignored tests, drop duplicates#367
vieiralucas merged 1 commit intomainfrom
worktree-fix-ignored-tests

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 14, 2026

Summary

  • A hunt for #[ignore] tests turned up 6 stale ones in crates/fakecloud-e2e/. Three were duplicates of working tests in lambda_integration.rs (the EventBridge/SNS/S3 → Lambda cases) — deleted. The other three were unique coverage that's now un-ignored and passing.
  • Fixed root causes for the un-ignored tests:
    • DynamoDB Streams → Lambda poller parsed \"/table/\" but stream ARNs use \":table/\" (colon prefix), so the table-name extraction silently dropped every mapping. One-character fix.
    • SecretsManager RotateSecret was pre-creating an AWSPENDING version with the rotation token, then the rotation Lambda's createSecret step would call PutSecretValue with the same token and hit ResourceExistsException. Real AWS leaves that creation to the Lambda. Removed the pre-creation; updated the no-op secretsmanager_rotation_invokes_lambda test (now asserts on rotation config, not on AWSPENDING existence); updated the rotation Lambda test code to DescribeSecret for RemoveFromVersionId on UpdateSecretVersionStage; and made the test poll for the rotated value (4 sequential cold-start invocations are slow). Two secretsmanager unit tests updated to match.
    • logs_subscription_filter_invokes_lambda baked 127.0.0.1 URLs into the inlined Python code, but the runtime only rewrites localhost in env vars (not in user code). Switched the test to use host.docker.internal explicitly and to poll instead of sleep(3).
  • Also replaced a silent pytest.skip in sdks/python/tests/test_client.py with a hard RuntimeError when the fakecloud binary is missing — CI builds it before running pytest, so the skip path was dead code that just masked broken local runs.

Test plan

  • cargo nextest run -p fakecloud-e2e for the 8 related Lambda tests, all green
  • cargo run -p fakecloud-e2e --bin e2e_nextest_partitions check — partition coverage clean (799 tests covered exactly once)
  • cargo test -p fakecloud-secretsmanager — 39/39 unit tests green
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo fmt --all
  • pytest sdks/python — 28/28 green
  • grep -rn '#\\[ignore' crates/ — no matches

Summary by cubic

Unignored and fixed the last Lambda e2e tests, and removed duplicate tests. Also corrected DynamoDB Streams → Lambda polling and SecretsManager rotation to match AWS behavior.

  • Bug Fixes

    • DynamoDB Streams → Lambda poller: parse stream ARNs using ":table/" (one-char fix) so table names resolve and mappings run.
    • SecretsManager RotateSecret: stop pre-creating AWSPENDING; aligns with AWS and avoids ResourceExistsException. Rotation test now calls DescribeSecret, passes RemoveFromVersionId on stage update, and polls until value flips.
    • CloudWatch Logs subscription test: replace hardcoded 127.0.0.1 with host.docker.internal and poll for SQS proof instead of a fixed sleep.
  • Refactors

    • Deleted 3 duplicate ignored tests in crates/fakecloud-e2e/tests/cross_service.rs (EventBridge/SNS/S3 → Lambda). Kept working versions in lambda_integration.rs.
    • Unignored 3 unique tests: dynamodb_streams_to_lambda_executes_code, secretsmanager_rotation_lambda_executes, logs_subscription_filter_invokes_lambda.
    • In sdks/python/tests/test_client.py, replace silent pytest.skip with a RuntimeError when the fakecloud binary is missing to surface broken local runs.

Written for commit 45d8a62. Summary will update on new commits.

- Delete 3 duplicate ignored Lambda tests from cross_service.rs
  (eventbridge/sns/s3 → Lambda), all superseded by working sibling
  tests in lambda_integration.rs that already run in CI.

- Un-ignore the 3 unique Lambda integration tests:
  - dynamodb_streams_to_lambda_executes_code
  - secretsmanager_rotation_lambda_executes
  - logs_subscription_filter_invokes_lambda

- Fix DynamoDB Streams → Lambda poller: ARN parsing used "/table/"
  but DynamoDB stream ARNs format the segment as ":table/" (colon
  prefix), so the poller never extracted a table name and silently
  skipped every mapping.

- Fix SecretsManager rotation flow to match real AWS: do NOT
  pre-create the AWSPENDING version inside RotateSecret. Real AWS
  leaves that to the rotation Lambda's createSecret step, and the
  pre-creation caused PutSecretValue to throw ResourceExistsException
  on the same ClientRequestToken. Update unit tests and the
  cross_service no-op rotation test to match. Update the rotation
  Lambda test code to DescribeSecret first and pass
  RemoveFromVersionId on UpdateSecretVersionStage, and to poll for
  the rotated value (4 sequential cold-start invocations are slow).

- Fix logs_subscription_filter_invokes_lambda: the inlined Python
  Lambda code baked 127.0.0.1 URLs into the source, which the
  runtime only rewrites in env vars. Use host.docker.internal
  explicitly and poll for the result instead of a fixed sleep.

- Replace the silent pytest.skip in sdks/python/tests/test_client.py
  with a hard RuntimeError when the fakecloud binary is missing.
  CI builds it before running pytest, so the skip path was dead
  code that masked broken local runs.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

@vieiralucas vieiralucas merged commit bdaf266 into main Apr 14, 2026
25 checks passed
@vieiralucas vieiralucas deleted the worktree-fix-ignored-tests branch April 14, 2026 03:14
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