Skip to content

Capture .test.gts in live-test#4342

Merged
tintinthong merged 3 commits intomainfrom
remove-colocated-module-test
Apr 8, 2026
Merged

Capture .test.gts in live-test#4342
tintinthong merged 3 commits intomainfrom
remove-colocated-module-test

Conversation

@tintinthong
Copy link
Copy Markdown
Contributor

No description provided.

@tintinthong tintinthong marked this pull request as draft April 7, 2026 09:40
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +8 to +9
if [ -n "$1" ]; then
REALM_URL="$1"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@tintinthong tintinthong changed the title Remove colocated module test Refine running of live test script Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Preview deployments

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Host Test Results

2 185 tests  +10   2 170 ✅ +10   2h 20m 50s ⏱️ - 1m 14s
    1 suites ± 0      15 💤 ± 0 
    1 files   ± 0       0 ❌ ± 0 

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.
Chrome ‑ Integration | operator-mode | card catalog > recents section: filters cards by type for "Find Instances" search
Chrome ‑ Integration | RichMarkdownField: cardReferenceUrls computes resolved URLs from markdown content
Chrome ‑ Integration | RichMarkdownField: cardReferenceUrls returns empty array for content without references
Chrome ‑ Integration | RichMarkdownField: edit template renders textarea for content
Chrome ‑ Integration | RichMarkdownField: linkedCards query resolves referenced cards from the realm
Chrome ‑ Integration | RichMarkdownField: renders block ::card references as BFM elements
Chrome ‑ Integration | RichMarkdownField: renders footnotes
Chrome ‑ Integration | RichMarkdownField: renders inline :card references as BFM elements
Chrome ‑ Integration | RichMarkdownField: renders markdown as HTML
Chrome ‑ Integration | RichMarkdownField: renders with null content without error
Chrome ‑ Integration | operator-mode | ui: search sheet expands to results when realm filter is changed
…

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Realm Server Test Results

  1 files  ±0    1 suites  ±0   13m 31s ⏱️ -19s
836 tests ±0  836 ✅ ±0  0 💤 ±0  0 ❌ ±0 
907 runs  ±0  907 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit a71063b. ± Comparison against base commit 42fecf7.

♻️ This comment has been updated with latest results.

@tintinthong tintinthong changed the title Refine running of live test script Capture .test.gts in live-test Apr 7, 2026
@tintinthong tintinthong requested a review from Copilot April 7, 2026 13:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.js to *.test.gts and add an explicit non-2xx _mtimes error.
  • Allow testem-live.js to target a realm via REALM_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://||')
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
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

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid comment, we can improve this

Comment on lines +8 to +16
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
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@tintinthong tintinthong force-pushed the remove-colocated-module-test branch from 7c588a0 to 5d19377 Compare April 8, 2026 01:46
@tintinthong tintinthong requested a review from richardhjtan April 8, 2026 08:19
@tintinthong tintinthong marked this pull request as ready for review April 8, 2026 08:19
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://||')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid comment, we can improve this

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +10 to +11
REALM_HOST=$(echo "$REALM_URL" | sed 's|http://||')
REALM_READY="http-get://${REALM_HOST}${READY_PATH}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@tintinthong tintinthong merged commit 6a2e5dc into main Apr 8, 2026
63 of 64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants