fix(test-apps): resolve comprehensive E2E against workspace source (#257)#263
Open
sarayev wants to merge 1 commit into
Open
fix(test-apps): resolve comprehensive E2E against workspace source (#257)#263sarayev wants to merge 1 commit into
sarayev wants to merge 1 commit into
Conversation
|
svidgen
approved these changes
Jul 24, 2026
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.
Closes #257
Problem
On
main, the comprehensive local E2E suite (test-apps/comprehensive) could type-check its backend against nested published@aws-blocks/*packages undertest-apps/comprehensive/node_modules/@aws-blocks/*instead of the workspace source underpackages/*. This makes the suite unable to validate unreleased API changes.Symptom: after #38 added
AuthCognito.adminto source (and the comprehensive backend started callingauthC.admin.*),npm run test:e2e:localfails the backend type check with:because the nested published
@aws-blocks/bb-auth-cognito@0.1.5predates theadmingetter.Root cause
@aws-blocks/*as direct deps via"*". Critically,@aws-blocks/bb-auth-cognitowas not a direct dependency — it was pulled in transitively through@aws-blocks/blocks.@aws-blocks/blocksdeclares its building-block deps with published semver ranges (e.g."@aws-blocks/bb-auth-cognito": "^0.1.5").packages/bb-auth-cognitoversion (0.1.5) equals the published version, so npm treats the registry tarball as an equally-valid satisfier of^0.1.5and — depending on tree state — can nest the published copy under the test app.admingetter) without a version bump, so source drifted ahead of the published0.1.5. When resolution lands on the nested published copy, theadmingetter is missing → type error.Fix
Declare all
@aws-blocks/*packages that@aws-blocks/blocksre-exports as direct"*"dependencies oftest-apps/comprehensive(matching the repo's existing npm-workspaces convention; npm 10 here does not support theworkspace:protocol). This pins the entire re-exported surface — includingbb-auth-cognito— to workspace links, so npm can never nest a published copy. Only the test app'spackage.jsonand the regeneratedpackage-lock.jsonchange; no source underpackages/*and no version bumps.Verification
@aws-blocks/bb-auth-cognito→packages/bb-auth-cognito/dist/index.d.ts(was the nested published copy).node_modules/@aws-blocks/bb-auth-cognito -> ../../packages/bb-auth-cognito; no nested published copy exists anywhere undertest-apps/comprehensive/node_modules.npm run build:packages→ exit 0. Backendtsc --noEmit→ exit 0; theadminerror is gone.npm run test:e2e:localruns to completion — 373 tests, 351 pass, 1 skipped. The only failures (Realtime,Agent BB) are environmental: Node 20 lacks a globalWebSocket, and the agent streams over that same realtime transport.npm run test:e2e:localis fully green — 373 tests, 372 pass, 0 fail, 0 cancelled, 1 skipped (+ the vendorize step: 8/8 pass).Realtime,AuthCognito, andAgent BBall pass once Node provides a globalWebSocket. The remaining skip is a sandbox-only test requiring a deployed AWS environment.Changeset
Not needed —
bb-test-comprehensiveis in the.changeset/config.jsonignorelist, and this is a test-infra-only change (no publishable package modified).