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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ jobs:
wait-for: 3m
wait-on: http-get://localhost:4200
- name: Start realm servers
run: pnpm start:skip-experiments | tee -a /tmp/server.log &
run: pnpm start:skip-optional-realms | tee -a /tmp/server.log &
working-directory: packages/realm-server
- name: create realm users
run: pnpm register-realm-users
Expand Down
6 changes: 3 additions & 3 deletions packages/host/app/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ export function urlForRealmLookup(card: CardDef) {
}

// usage example for realm url: `catalogRealm.url`, `skillsRealm.url`
export const catalogRealm = new RealmPaths(
new URL(ENV.resolvedCatalogRealmURL),
);
export const catalogRealm = ENV.resolvedCatalogRealmURL
? new RealmPaths(new URL(ENV.resolvedCatalogRealmURL))
: null;
export const skillsRealm = new RealmPaths(new URL(ENV.resolvedSkillsRealmURL));

/**
Expand Down
18 changes: 12 additions & 6 deletions packages/host/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ module.exports = function (environment) {
realmServerURL: process.env.REALM_SERVER_DOMAIN || 'http://localhost:4201/',
resolvedBaseRealmURL:
process.env.RESOLVED_BASE_REALM_URL || 'http://localhost:4201/base/',
resolvedCatalogRealmURL:
process.env.RESOLVED_CATALOG_REALM_URL ||
'http://localhost:4201/catalog/',
resolvedCatalogRealmURL: process.env.SKIP_CATALOG
? undefined
: process.env.RESOLVED_CATALOG_REALM_URL ||
'http://localhost:4201/catalog/',
resolvedSkillsRealmURL:
process.env.RESOLVED_SKILLS_REALM_URL || 'http://localhost:4201/skills/',
featureFlags: {
Expand All @@ -71,9 +72,11 @@ module.exports = function (environment) {
// ENV.APP.LOG_TRANSITIONS = true;
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
// ENV.APP.LOG_VIEW_LOOKUPS = true;
ENV.defaultSystemCardId =
process.env.DEFAULT_SYSTEM_CARD_ID ??
'http://localhost:4201/catalog/SystemCard/default';
ENV.defaultSystemCardId = process.env.DEFAULT_SYSTEM_CARD_ID;
if (!ENV.defaultSystemCardId && !process.env.SKIP_CATALOG) {
ENV.defaultSystemCardId =
'http://localhost:4201/catalog/SystemCard/default';
}
}

if (environment === 'test') {
Expand All @@ -98,6 +101,9 @@ module.exports = function (environment) {
SHOW_ASK_AI: true,
};

// Catalog realm is not available in test environment
ENV.resolvedCatalogRealmURL = undefined;

ENV.defaultSystemCardId =
process.env.DEFAULT_SYSTEM_CARD_ID ??
'http://test-realm/test/SystemCard/default';
Expand Down
3 changes: 1 addition & 2 deletions packages/host/scripts/test-wait-for-servers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ 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"
Expand All @@ -39,5 +38,5 @@ 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" \
"$BASE_REALM_READY|$NODE_TEST_REALM_READY|$SKILLS_REALM_READY|$TEST_REALM_READY|$SYNAPSE_URL|$SMTP_4_DEV_URL" \
'ember-test-pre-built'
4 changes: 2 additions & 2 deletions packages/host/tests/acceptance/ai-assistant-test.gts
Original file line number Diff line number Diff line change
Expand Up @@ -2011,7 +2011,7 @@ module('Acceptance | AI Assistant tests', function (hooks) {
type: 'user-workspace',
url: testRealmURL,
},
{
catalogRealm && {
name: 'Cardstack Catalog',
type: 'catalog-workspace',
url: catalogRealm.url,
Expand All @@ -2021,7 +2021,7 @@ module('Acceptance | AI Assistant tests', function (hooks) {
type: 'catalog-workspace',
url: skillsRealm.url,
},
],
].filter(Boolean),
'Context sent with message contains correct workspaces',
);
});
Expand Down
Loading
Loading