Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c588a0239
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if [ -n "$1" ]; then | ||
| REALM_URL="$1" |
There was a problem hiding this comment.
Use REALM_URL env var when building readiness targets
The readiness selection only keys off $1, but the documented invocation is REALM_URL=... pnpm test:live. In that case, line 18 still forwards REALM_URL to the test runner, while this branch falls back to catalog readiness URLs, so live tests can begin before the requested realm is up and fail when _mtimes is fetched from that realm. Derive readiness URLs from the effective realm value (env var or arg) so wait-on tracks the same realm the tests will hit.
Useful? React with 👍 / 👎.
Preview deployments |
Host Test Results2 185 tests +10 2 170 ✅ +10 2h 20m 50s ⏱️ - 1m 14s Results for commit a71063b. ± Comparison against base commit 42fecf7. This pull request removes 1 and adds 11 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
This PR updates the host “live-test” runner to focus discovery on realm-hosted *.test.gts modules, adds better failure handling when _mtimes isn’t accessible, and introduces configuration/docs to make running live tests against different realms easier.
Changes:
- Narrow test module discovery in
live-test.jsto*.test.gtsand add an explicit non-2xx_mtimeserror. - Allow
testem-live.jsto target a realm viaREALM_URL(and lay groundwork for multiple pages). - Add live-test documentation and update virtual-network shims to provide non-crashing fallbacks for test-only imports.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/host/tests/live-test.js | Changes how realm test modules are discovered/loaded; adds _mtimes HTTP error handling. |
| packages/host/testem-live.js | Makes the live test page configurable via REALM_URL and supports generating multiple test pages. |
| packages/host/scripts/live-test-wait-for-servers.sh | Adds conditional waiting logic intended to support a targeted realm. |
| packages/host/docs/live-tests.md | Introduces documentation for running card-based live tests in browser/script mode. |
| packages/host/app/lib/externals.ts | Adjusts shims for test-only imports so realm cards co-locating test imports won’t crash outside test runs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| READY_URLS="$BASE_REALM_READY|$CATALOG_REALM_READY|$SYNAPSE_URL|$SMTP_4_DEV_URL" | ||
| if [ -n "$1" ]; then | ||
| REALM_URL="$1" | ||
| REALM_HOST=$(echo "$REALM_URL" | sed 's|http://||') |
There was a problem hiding this comment.
The readiness-check URL construction is fragile: it only strips http:// (so https://... becomes invalid), and it concatenates ${REALM_HOST}${READY_PATH} without ensuring a trailing / on the realm URL. If a user passes http://localhost:4201/catalog (no trailing slash), this produces .../catalog_readiness-check... and wait-on will never succeed. Consider parsing with a URL-aware approach (or at least handle both http/https and normalize to a trailing / before appending the readiness path).
| REALM_HOST=$(echo "$REALM_URL" | sed 's|http://||') | |
| REALM_HOST="$REALM_URL" | |
| case "$REALM_HOST" in | |
| http://*) REALM_HOST="${REALM_HOST#http://}" ;; | |
| https://*) REALM_HOST="${REALM_HOST#https://}" ;; | |
| esac | |
| case "$REALM_HOST" in | |
| */) ;; | |
| *) REALM_HOST="${REALM_HOST}/" ;; | |
| esac |
There was a problem hiding this comment.
Valid comment, we can improve this
| if [ -n "$1" ]; then | ||
| REALM_URL="$1" | ||
| REALM_HOST=$(echo "$REALM_URL" | sed 's|http://||') | ||
| REALM_READY="http-get://${REALM_HOST}${READY_PATH}" | ||
| READY_URLS="$BASE_REALM_READY|$REALM_READY|$SYNAPSE_URL|$SMTP_4_DEV_URL" | ||
| else | ||
| CATALOG_REALM_READY="http-get://localhost:4201/catalog/${READY_PATH}" | ||
| READY_URLS="$BASE_REALM_READY|$CATALOG_REALM_READY|$SYNAPSE_URL|$SMTP_4_DEV_URL" | ||
| fi |
There was a problem hiding this comment.
pnpm test:live supports targeting a realm via the REALM_URL environment variable (as used by testem-live.js), but this script only switches readiness-check URLs based on $1. Running REALM_URL=http://localhost:4201/experiments/ pnpm test:live will still wait on the catalog realm (not the experiments realm), which can make the live test run flaky if the targeted realm isn’t ready yet. Consider using ${REALM_URL:-$1} (or similar) to drive both the wait-on URLs and the env var passed to testem.
7c588a0 to
5d19377
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| READY_URLS="$BASE_REALM_READY|$CATALOG_REALM_READY|$SYNAPSE_URL|$SMTP_4_DEV_URL" | ||
| if [ -n "$1" ]; then | ||
| REALM_URL="$1" | ||
| REALM_HOST=$(echo "$REALM_URL" | sed 's|http://||') |
There was a problem hiding this comment.
Valid comment, we can improve this
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d193773d5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| REALM_HOST=$(echo "$REALM_URL" | sed 's|http://||') | ||
| REALM_READY="http-get://${REALM_HOST}${READY_PATH}" |
There was a problem hiding this comment.
Preserve scheme when deriving readiness URL
The custom-realm branch strips only http:// before constructing REALM_READY, so passing an HTTPS realm (for example https://...) produces a malformed wait target like http-get://https://... and start-server-and-test never observes readiness. This blocks pnpm test:live for any non-HTTP realm URL even though the new code path is meant to support arbitrary realm inputs.
Useful? React with 👍 / 👎.
No description provided.