-
Notifications
You must be signed in to change notification settings - Fork 0
CI workflow with version-lockstep check #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
20ba772
chore: start ci-workflow
cb-jeeves c9168f2
fix(release): finish the 0.6.3 bump through set-version
cb-jeeves ced8a75
ci: add verify workflow and version-lockstep check
cb-jeeves a02fe0f
chore(release): v0.7.0 (minor)
cb-jeeves 79c5e2c
fix(release): finish the 0.7.0 bump through set-version
dantheuber 9213e16
build: fan out npm version through set-version and drop duplicate loc…
dantheuber 8e2b613
build: read npm_package_version in set-version and document npm version
dantheuber 7006e24
build: stage only tracked files in the version lifecycle and test the…
dantheuber c5b0ec1
build: stage the root manifest in the version lifecycle
dantheuber 3b3c80c
test(set-version): clean up fixtures with a tmpdir registry
dantheuber b98e4a3
Merge remote-tracking branch 'origin/main' into freight/feature-ci-wo…
cb-jeeves 7ea8cab
test(cdk): share one cloud-assembly outdir across construct tests and…
dantheuber cbc17b1
test(cli): wait for the container to start before cancelling the loca…
dantheuber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Mirrors the root package.json scripts step for step: keep the two in | ||
| # correspondence when adding a check to either side. | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| verify: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
|
|
||
| - run: npm ci | ||
|
|
||
| - run: npm run typecheck | ||
|
|
||
| - run: npm test | ||
|
|
||
| - run: npm run build | ||
|
|
||
| - name: Version lockstep | ||
| run: npm run check-version |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| --- | ||
| type: decision | ||
| title: CDK construct tests share one cloud-assembly outdir | ||
| description: Why construct tests build their App with test/support/test-app.ts | ||
| instead of new App(), and why vitest's timeout is 30 s. | ||
| tags: | ||
| - millwright | ||
| - testing | ||
| - cdk | ||
| timestamp: 2026-09-08T03:23:12.874Z | ||
| --- | ||
|
|
||
| Every `Template.fromStack(...)` over the `Millwright` construct synthesizes a full stack, and that | ||
| stack bundles **ten `NodejsFunction` Lambdas with esbuild** (poller, launcher, sweep, three synth-job | ||
| functions, two run-executor functions, reporter, step-events writer) plus the synth tooling bundle | ||
| from `millwright-cli`. One synth costs roughly 1.5 s on a fast workstation and 5–11 s on a loaded | ||
| GitHub Actions runner — past vitest's 5 s default per-test budget. That is what made the first CI | ||
| workflow run (PR #36) fail with timeouts in `data-stores`, `millwright` and `run-executor-construct`. | ||
|
|
||
| ## What was decided | ||
|
|
||
| - Construct tests build their App with `testApp()` from `packages/millwright-cdk/test/support/test-app.ts`, | ||
| never a bare `new App()`. The helper pins one cloud-assembly outdir per worker process. | ||
| - The root `vitest.config.ts` sets `testTimeout: 30_000`. | ||
|
|
||
| ## Why the shared outdir works | ||
|
|
||
| `aws-cdk-lib`'s `AssetStaging` keeps a **process-wide cache** keyed on (outdir, source path, bundling | ||
| options). A bare `new App()` picks a fresh temp outdir every time, so the cache never hits and every | ||
| test in a file re-runs all the esbuild bundles. With one outdir per process the first synth in a file | ||
| bundles and every later synth reuses it: `data-stores.test.ts` dropped from ~21 s to ~4.5 s locally. | ||
|
|
||
| The outdir must be **per process**, not shared across vitest workers: each App writes | ||
| `manifest.json` and `Test.template.json` into it, and concurrent workers would race on those files. | ||
|
|
||
| ## Why not `CDK_OUTDIR` | ||
|
|
||
| Setting the env var would reach every `new App()` without touching tests, but `App` treats a set | ||
| `CDK_OUTDIR` as a request for `autoSynth`, registering a `beforeExit` listener per App. Hundreds of | ||
| Apps per run means listener-leak warnings and exit-time synths of half-built trees from the | ||
| "throws at construct time" tests. | ||
|
|
||
| ## Why not disable bundling | ||
|
|
||
| The `aws:cdk:bundling-stacks` context can skip bundling entirely, but the tests would then stop | ||
| exercising the real bundling configuration (workspace aliases, entry points, formats). | ||
|
|
||
| ## Citations | ||
|
|
||
| [1] [test-app.ts](../../packages/millwright-cdk/test/support/test-app.ts) | ||
| [2] [vitest.config.ts](../../vitest.config.ts) |
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.