Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ jobs:

# Copy catalog integration tests to host tests directory
rm -rf packages/host/tests/integration
rm -rf packages/host/tests/acceptance
mkdir -p packages/host/tests/integration
mkdir -p packages/host/tests/acceptance
cp -r boxel-catalog-src/tests/acceptance/* packages/host/tests/acceptance
cp -r boxel-catalog-src/tests/integration/* packages/host/tests/integration
cp -r boxel-catalog-src/tests/helpers/* packages/host/tests/helpers

Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/ci-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,19 @@ jobs:
# Copy catalog source files (exclude config files that should stay from monorepo)
rsync -av --exclude='tsconfig.json' --exclude='package.json' --exclude='.realm.json' --exclude='.gitignore' --exclude='tests/' boxel-catalog-src/ packages/catalog-realm/

# Copy catalog integration tests to host tests directory
# Copy catalog acceptance and integration tests to host tests directory
rm -rf packages/host/tests/integration
rm -rf packages/host/tests/acceptance
mkdir -p packages/host/tests/integration
mkdir -p packages/host/tests/acceptance
cp -r boxel-catalog-src/tests/acceptance/* packages/host/tests/acceptance
cp -r boxel-catalog-src/tests/integration/* packages/host/tests/integration
cp -r boxel-catalog-src/tests/helpers/* packages/host/tests/helpers



# Overwrite the test-wait-for-server script to include catalog server start
cp boxel-catalog-src/scripts/test-wait-for-servers.sh packages/host/scripts/test-wait-for-servers.sh

Comment on lines +73 to +75
Copy link
Contributor

Choose a reason for hiding this comment

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

why doesn't this just use the script provided?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In monorepo PR we remove to wait catalog realm to be ready before test.

For boxel-catalog, we should wait catalog realm ready before test hence we overwrite with this file

- uses: ./.github/actions/init

- name: Build common dependencies
Expand Down Expand Up @@ -105,6 +112,14 @@ jobs:
sudo service dbus restart
sudo service upower restart

- name: Run Catalog Acceptance Tests
run: dbus-run-session -- pnpm exec ember exam --path ./dist --filter="Acceptance | "
env:
PERCY_GZIP: true
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_HOST }}
DBUS_SYSTEM_BUS_ADDRESS: unix:path=/run/dbus/system_bus_socket
working-directory: packages/host

- name: Run Catalog Integration Tests
run: dbus-run-session -- pnpm exec ember exam --path ./dist --filter="Integration | "
env:
Expand Down
4 changes: 2 additions & 2 deletions catalog-app/listing/listing.gts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ export class Listing extends CardDef {
return undefined;
}
return {
label: 'Generate example with AI',
label: 'Generate Example with AI',
action: async () => {
const command = new ListingGenerateExampleCommand(
params.commandContext,
Expand Down Expand Up @@ -677,7 +677,7 @@ export class Listing extends CardDef {
label: 'Make a PR',
action: async () => {
await new CreateListingPRCommand(commandContext).execute({
listing: this,
listingId: this.id,
realm: this[realmURL]!.href,
});
},
Expand Down
43 changes: 43 additions & 0 deletions scripts/test-wait-for-servers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#! /bin/sh

ensure_trailing_slash() {
case "$1" in
*/) printf '%s' "$1" ;;
*) printf '%s/' "$1" ;;
esac
}

to_wait_url() {
case "$1" in
http://*) printf 'http-get://%s' "${1#http://}" ;;
https://*) printf 'https-get://%s' "${1#https://}" ;;
*) printf '%s' "$1" ;;
esac
}

DEFAULT_BASE_REALM_URL='http://localhost:4201/base/'
DEFAULT_CATALOG_REALM_URL='http://localhost:4201/catalog/'
DEFAULT_SKILLS_REALM_URL='http://localhost:4201/skills/'

BASE_REALM_URL=$(ensure_trailing_slash "${RESOLVED_BASE_REALM_URL:-$DEFAULT_BASE_REALM_URL}")
CATALOG_REALM_URL=$(ensure_trailing_slash "${RESOLVED_CATALOG_REALM_URL:-$DEFAULT_CATALOG_REALM_URL}")
SKILLS_REALM_URL=$(ensure_trailing_slash "${RESOLVED_SKILLS_REALM_URL:-$DEFAULT_SKILLS_REALM_URL}")

NODE_TEST_REALM="http-get://localhost:4202/node-test/"
TEST_REALM="http-get://localhost:4202/test/"

READY_PATH="_readiness-check?acceptHeader=application%2Fvnd.api%2Bjson"

BASE_REALM_READY="$(to_wait_url "${BASE_REALM_URL}")${READY_PATH}"
CATALOG_REALM_READY="$(to_wait_url "${CATALOG_REALM_URL}")${READY_PATH}"
NODE_TEST_REALM_READY="$NODE_TEST_REALM$READY_PATH"
SKILLS_REALM_READY="$(to_wait_url "${SKILLS_REALM_URL}")${READY_PATH}"
TEST_REALM_READY="$TEST_REALM$READY_PATH"

SYNAPSE_URL="http://localhost:8008"
SMTP_4_DEV_URL="http://localhost:5001"

WAIT_ON_TIMEOUT=600000 NODE_NO_WARNINGS=1 start-server-and-test \
'pnpm run wait' \
"$BASE_REALM_READY|$CATALOG_REALM_READY|$NODE_TEST_REALM_READY|$SKILLS_REALM_READY|$TEST_REALM_READY|$SYNAPSE_URL|$SMTP_4_DEV_URL" \
'ember-test-pre-built'
Loading