Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the CI setup for the catalog repo by switching from the previous catalog acceptance/integration test execution to a new “live test” workflow in the Boxel monorepo, and introduces a sample card + live-test module alongside a shared copy script.
Changes:
- Removed the existing catalog acceptance tests and the
listing-update-specsintegration test from this repo. - Added a reusable
copy-catalog-to-monorepo.shscript and updated CI workflows to use it. - Added
sample-command-card.gtsandsample-command-card-test.gtsfor live-test coverage.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/listing-update-specs-test.gts | Deletes the listing-update-specs integration test. |
| tests/acceptance/real-catalog-app-test.gts | Deletes the “real catalog app” acceptance test. |
| tests/acceptance/catalog-app-test.gts | Deletes the large catalog acceptance suite. |
| scripts/copy-catalog-to-monorepo.sh | Adds a shared script to wipe/sync catalog files into the Boxel monorepo. |
| sample-command-card.gts | Adds a sample realm card, but currently includes embedded test-only imports/code. |
| sample-command-card-test.gts | Adds a live-test module that exercises saving + search indexing for the sample card. |
| .github/workflows/ci-test.yaml | Renames job and switches CI to run pnpm test:live plus uploads a junit artifact. |
| .github/workflows/ci-lint.yaml | Switches the copy step to use the new script. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| echo "[copy-catalog] Syncing catalog source into monorepo..." | ||
| rsync -av \ | ||
| --exclude='.git/' \ | ||
| --include='index.json' \ | ||
| --exclude='*.json' \ | ||
| --exclude='.gitignore' \ | ||
| --exclude='tests/' \ | ||
| --exclude='scripts/' \ | ||
| --exclude='system-card/' \ | ||
| "$CATALOG_SRC/" "$CATALOG_REALM/" |
There was a problem hiding this comment.
The rsync excludes all *.json files (except index.json) after the script has removed most of packages/catalog-realm. That combination will wipe out the catalog realm’s JSON card content (e.g. Category/Tag/Theme/Listing instances) in the Boxel checkout and not restore it, which will likely break the realm and any tests that depend on those cards. Consider either (a) copying JSON cards from boxel-catalog-src (remove --exclude='*.json' and instead exclude only the config JSONs you don’t want to overwrite), or (b) if JSON content should remain from the monorepo, update the find keep-list to preserve those directories so they aren’t deleted.
| // ── Tests (imports resolved via loader.shimModule in live-test.js) ──────────── | ||
| import { on } from '@ember/modifier'; import { service } from '@ember/service'; | ||
| import { click, render, waitUntil } from '@ember/test-helpers'; | ||
| import GlimmerComponent from '@glimmer/component'; | ||
| import { module, test } from 'qunit'; | ||
|
|
||
| import { type Store } from '@cardstack/runtime-common'; | ||
| import { | ||
| setupCardTest, | ||
| setupIntegrationTestRealm, | ||
| testRealmURL, | ||
| withCachedRealmSetup, | ||
| type TestContextWithSave, | ||
| } from '@cardstack/host/tests/helpers'; | ||
| import { TestRealmAdapter } from '@cardstack/host/tests/helpers/adapter'; | ||
|
|
There was a problem hiding this comment.
sample-command-card.gts mixes a realm card module with test-only dependencies (@ember/test-helpers, qunit, @cardstack/host/tests/helpers, etc.). Outside the live-test harness these imports won’t resolve for a normal realm loader/indexer, so this card module can fail to load (and it also pulls test-only code into the realm bundle). Suggest splitting this so sample-command-card.gts contains only the card definition (and any runtime UI), and keep all QUnit/Ember-test code in sample-command-card-test.gts (or another test-only file that won’t be shipped/loaded by the realm).
| } from 'https://cardstack.com/base/card-api'; | ||
| import StringField from 'https://cardstack.com/base/string'; | ||
| // ── Tests (imports resolved via loader.shimModule in live-test.js) ──────────── | ||
| import { on } from '@ember/modifier'; import { service } from '@ember/service'; |
There was a problem hiding this comment.
Two separate import statements are on the same line, which is likely to fail formatting/lint rules and makes diffs harder to read. Please split these into separate lines (and let the formatter handle ordering).
| import { on } from '@ember/modifier'; import { service } from '@ember/service'; | |
| import { on } from '@ember/modifier'; | |
| import { service } from '@ember/service'; |
| static isolated = class Isolated extends Component<typeof SampleCommandCard> { | ||
| <template> | ||
| <h1><@fields.title /></h1> | ||
| <button type='button'>Create Card</button> |
There was a problem hiding this comment.
The card’s isolated template renders a “Create Card” button, but it isn’t wired to any action (the click handler exists only in the separate CreateCardButton test component). If this button is meant to demonstrate the command behavior, consider rendering CreateCardButton (or adding an {{on 'click' ...}} handler) in the isolated template; otherwise remove the button to avoid a misleading UI.
| <button type='button'>Create Card</button> |
| await render(<template><CreateCardButton /></template>); | ||
| await click('button'); | ||
|
|
||
| assert.ok(savedUrl, 'card was saved to realm'); | ||
| let relativePath = `${savedUrl!.href.substring(testRealmURL.length)}.json`; | ||
| let file = await testRealmAdapter.openFile(relativePath); | ||
| assert.ok(file, 'card JSON file exists in the realm adapter'); | ||
| }); |
There was a problem hiding this comment.
This test asserts savedUrl immediately after click('button'), but the save callback can run asynchronously depending on how store.add flushes writes. That can make the test flaky and can lead to savedUrl still being undefined when computing relativePath. Suggest waiting until savedUrl is set (as you already do in the next test) before the assertions and file lookup.
| await render(<template><CreateCardButton /></template>); | ||
| await click('button'); | ||
|
|
There was a problem hiding this comment.
Using click('button') is brittle if additional buttons get introduced by the test harness or template changes. Prefer targeting a specific button via a data-test-* attribute (or a more specific selector) so the test intent stays stable.
| live-test: | ||
| name: Live Tests (realm) | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
The PR title says "Add listing tests", but this change set removes the existing catalog acceptance/integration test suites and switches CI to a different pnpm test:live workflow. If the intent is to migrate away from the previous listing tests, consider updating the PR title/description to match, or reintroducing the listing-specific coverage in the new live test suite so coverage doesn’t regress.
No description provided.