Align npm scripts and dev ports - #1341
Merged
Merged
Conversation
The four web apps had drifted apart on script names, and three of them served on port 3000, so only one could run at a time. This app keeps 3000 because it matches the CORS configuration; classroom, data and ml-trainer move to 3001-3003. Preview gets 4000. strictPort makes a clash fail rather than quietly move to the next free port. That matters because playwright.config.ts reuses an existing server on the dev port, so a silent fallback would point one app's e2e run at a sibling app. The e2e page objects build absolute URLs from E2E_PORT, whose default only worked because the dev and CI preview ports were both 3000. Splitting them breaks that, so playwright.config.ts now derives both its webServer and E2E_PORT from a single constant. Scripts: dev replaces start, preview replaces the hand-rolled serve, format and format:check are new, invalidate uses the shared invalidate-cloudfront-distribution rather than a raw aws call, and prepare becomes postinstall. ci runs typecheck, lint, test, i18n:tidy then build, matching the ui repo. Drop the npx serve and curl steps from the build workflow. They predate the move to Playwright, which starts its own server inside the test container, so nothing was reaching them. Exclude the generated typeshed JSON that the stubs script copies out of node_modules from prettier, mirroring how ml-trainer excludes its generated messages. That leaves one real formatting fix in chunk-util.ts.
The README said the app had to be running already. That dates from 2021 and predates the move to Playwright, whose webServer starts the dev server and reuses one already on the port. Also describe test:e2e as the Playwright UI rather than a watch mode, mention test:e2e:headless, and note that the browsers are a separate download.
|
Preview build will be at |
| - run: npm run ci | ||
| env: | ||
| VITE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | ||
| - run: mkdir -p /tmp/app${BASE_URL} && cp -r build/* /tmp/app${BASE_URL} && npx serve --no-clipboard -l 3000 /tmp/app & |
Collaborator
Author
There was a problem hiding this comment.
It is more than a little amusing that we've not been using this for some time.
The upload step pointed at reports/, but Playwright writes playwright-report/, so it never captured anything. The e2e step also had no timeout of its own, so a slow run took the whole job past its limit and the run was cancelled rather than failed, which skipped the upload too. Bound the step and leave the job room for the deploy that follows it.
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.
No description provided.