Skip to content

test(integ): add s3-asset-deploy integ (S3 zip asset upload + Lambda from local dir) - #832

Merged
go-to-k merged 3 commits into
mainfrom
test/s3-asset-deploy
Jun 13, 2026
Merged

test(integ): add s3-asset-deploy integ (S3 zip asset upload + Lambda from local dir)#832
go-to-k merged 3 commits into
mainfrom
test/s3-asset-deploy

Conversation

@go-to-k

@go-to-k go-to-k commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

Adds the missing real-AWS integ for the S3 ZIP asset-upload deploy path. No existing fixture uses a generic s3_assets.Asset and no verify.sh asserts the Lambda-code-from-local-dir upload (most lambda fixtures use inline code) — this fills the asset-layer gap (.claude/rules/assets.md S3 file upload).

Fixture (cheap, no VPC)

CdkdS3AssetDeployExample:

  • Lambda AssetHandler (Python 3.12) from lambda.Code.fromAsset('../lambda') — a real multi-file dir (handler + helpers/ + vendored/), forcing a genuine zip+upload (not inline). Synth confirms Code.S3Bucket: {Fn::Sub: cdk-hnb659fds-assets-...} + Code.S3Key: <hash>.zip.
  • Generic s3assets.Asset (ConfigAsset) uploaded to the same bootstrap bucket; its resolved bucket/key threaded into the Lambda as env vars (exercises the intrinsic resolver) + grantRead.

verify.sh asserts

deploy → CodeSize > 500 (proves uploaded zip, not inline) → invoke asserts the handler marker (the uploaded zip is the running code) + non-zero configBytes from the generic-asset S3 read-back (both uploads reached AWS + bucket/key env wiring resolved) → destroy → Lambda + state gone. (Asset objects live in the shared CDK bootstrap bucket which cdkd does not own/delete — verify.sh notes this and does not assert their absence.)

Real-AWS result

PASS — 0 errors, 0 orphans (44s).

Coverage matrices regenerated (union with the just-merged update-replace scenario).

go-to-k added 3 commits June 13, 2026 19:50
…ublishing

Adds a new integration test that exercises cdkd's asset-publishing layer
(FileAssetPublisher) during a real `cdkd deploy`, a path most existing
Lambda fixtures skip (they use inline code or never assert the upload
itself).

The CdkdS3AssetDeployExample stack covers two asset paths:

- A Lambda whose code comes from a local multi-file directory
  (lambda/ with handler + helpers/ + vendored/ Python sub-packages) so
  the synthesized asset is a genuine multi-file ZIP, forcing cdkd to zip
  the directory and upload it to the CDK bootstrap asset bucket, then
  wire the function Code.S3Bucket / Code.S3Key to the uploaded object.
- A generic s3_assets.Asset (asset-data/) uploaded to the same bucket,
  with its resolved bucket/key threaded into the Lambda as CONFIG_BUCKET
  / CONFIG_KEY env vars (exercising cdkd's intrinsic resolver).

verify.sh (BSD/macOS-portable, real rc + explicit "[verify] PASS"):
- deploy, then assert CodeSize > 500 bytes (proves the function runs from
  the uploaded ZIP, not inline).
- invoke the Lambda and assert the handler marker plus a non-zero
  configBytes from the generic-asset S3 read-back (proves both uploads
  reached AWS and the bucket/key env wiring resolved).
- destroy and assert the Lambda + state file are gone with 0 errors. The
  bootstrap-bucket asset OBJECTS persist by design (cdkd does not own the
  CDK bootstrap bucket), so the script does not assert their absence.

Adds the s3-asset-deploy scenario tag to the canonical taxonomy and
regenerates the integ + scenario coverage matrices. Documents the new
fixture in docs/changelog-cdkd.md.

Not yet run against real AWS; needs /run-integ s3-asset-deploy before
merge.
The changelog entry was missed in the fixture commit; add it here.
@go-to-k
go-to-k merged commit 18d84ae into main Jun 13, 2026
5 checks passed
@go-to-k
go-to-k deleted the test/s3-asset-deploy branch June 13, 2026 10:55
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.221.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant