Skip to content

feat(test): add integration test suite for CloudFormation template validation#745

Merged
zirkelc merged 1 commit intomasterfrom
feat-742-integration-tests
Apr 2, 2026
Merged

feat(test): add integration test suite for CloudFormation template validation#745
zirkelc merged 1 commit intomasterfrom
feat-742-integration-tests

Conversation

@VirtueMe
Copy link
Copy Markdown
Collaborator

@VirtueMe VirtueMe commented Apr 1, 2026

Summary

Adds an integration test suite that deploys real CloudFormation stacks to LocalStack on every PR. This catches a class of bugs that unit tests cannot — circular resource dependencies, invalid ARN references, and misconfigured IAM policies that only manifest when CloudFormation evaluates the full dependency graph.

Fixtures

9 fixtures covering all supported plugin features:

Fixture Features
basic-state-machine Standard workflow, Lambda invoke, tags
express-workflow type: EXPRESS, loggingConfig, tracingConfig
activities Step Functions activities
cloudwatch-alarms CloudWatch alarms (5 metrics, SNS topics)
notifications SNS + SQS execution event notification targets
schedule Rate-based EventBridge rule + EventBridge Scheduler
cloudwatch-event EventBridge event pattern rule
api-gateway HTTP endpoint → Step Functions direct integration
no-output noOutput: true (suppresses state machine ARN outputs)

Implementation notes

  • All fixtures share fixtures/package.json — CI requires only two npm install calls
  • fixtures/base.yml holds shared provider, plugins, package, and custom config; each fixture only declares what is unique to it
  • package.excludeDevDependencies: false is set in base.yml to prevent Serverless Framework v3 from scanning ~25k node_modules files before packaging, which would exhaust the JS heap
  • LocalStack runs in Docker via docker compose; the workflow waits for cloudformation, s3, and stepfunctions to be available before deploying

Status

All CI checks green. Currently validates that all fixtures deploy successfully. CloudFormation template assertion (validating specific generated resources) is out of scope for this PR and tracked separately.

Known broken issues (intentionally not covered)

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 1, 2026

Open in StackBlitz

npm i https://pkg.pr.new/serverless-operations/serverless-step-functions@745

commit: 67de367

Deploys 9 CloudFormation stacks against LocalStack on every PR to catch
issues that unit tests cannot — circular resource dependencies, invalid
ARN references, and misconfigured IAM policies.

Fixtures cover: standard workflow (with tags), express workflow (with
loggingConfig and tracingConfig), activities, CloudWatch alarms,
notifications (SNS/SQS), schedule events (rate rule and EventBridge
Scheduler), CloudWatch events, API Gateway, and noOutput.

All fixtures share fixtures/package.json so CI requires only two npm
install calls. A base.yml holds shared provider/plugin/package config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@VirtueMe VirtueMe force-pushed the feat-742-integration-tests branch from 25db9e1 to 67de367 Compare April 1, 2026 20:53
@VirtueMe VirtueMe marked this pull request as ready for review April 1, 2026 20:59
@zirkelc
Copy link
Copy Markdown
Collaborator

zirkelc commented Apr 2, 2026

This is really nice!

@zirkelc zirkelc merged commit 2c4117c into master Apr 2, 2026
4 checks passed
@zirkelc zirkelc deleted the feat-742-integration-tests branch April 2, 2026 06:18
@VirtueMe
Copy link
Copy Markdown
Collaborator Author

VirtueMe commented Apr 2, 2026

Note on the dependency changes in this PR

peerDependencies removed

The peerDependency on serverless has been dropped entirely. It was never necessary: this is a Serverless Framework plugin, so the framework is always present in the host project by definition — npm does not need to be told to require it. The practical effect is that users will no longer see spurious peer conflict warnings when their installed framework version drifts from the declared range.

serverlessosls in devDependencies

serverless is replaced with osls (oss-serverless) for two reasons:

  1. Node 22 compatibility — the commercial serverless v3 package does not support Node 22. Since chore: drop Node 20 support, bump minimum to Node 22 #737 bumped the minimum to Node 22, osls is a requirement to keep the dev toolchain working.
  2. Open-source licensing — the commercial package moved toward a paid/freemium model. oss-serverless is the community-maintained open-source fork of v3, a drop-in compatible replacement with no licensing concerns in CI.

@osls/compose added to dependencies

Used by the Serverless Compose orchestration (serverless-compose.js) to deploy all fixtures in a single command.

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.

2 participants