Skip to content
Draft
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
4 changes: 2 additions & 2 deletions .github/workflows/ci-host.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
shardTotal: [16]
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
shardTotal: [8]
concurrency:
group: boxel-host-test${{ github.head_ref || github.run_id }}-shard${{ matrix.shardIndex }}
cancel-in-progress: true
Expand Down
10 changes: 7 additions & 3 deletions packages/host/app/lib/browser-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@ export class BrowserQueue implements QueuePublisher, QueueRunner {
return job;
}

private debouncedDrainJobs = debounce(() => {
this.drainJobs();
}, 250);
private debouncedDrainJobs = debounce(
() => {
this.drainJobs();
},
1,
{ leading: true },
);

private async drainJobs() {
await this.flush();
Expand Down
14 changes: 14 additions & 0 deletions packages/host/app/lib/sqlite-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,20 @@ export default class SQLiteAdapter implements DBAdapter {
return alias;
}

async deleteSnapshot(snapshotName: string) {
this.assertNotClosed();
await this.started;
let snapshotInfo = this.snapshotInfos.get(snapshotName);
if (!snapshotInfo) {
throw new Error(`Unknown snapshot database '${snapshotName}'`);
}
await this.sqlite('exec', {
dbId: this.dbId,
sql: `DETACH DATABASE ${snapshotName};`,
});
this.snapshotInfos.delete(snapshotName);
}

async importSnapshot(snapshotName: string) {
this.assertNotClosed();
await this.started;
Expand Down
12 changes: 11 additions & 1 deletion packages/host/app/services/loader-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Service, { service } from '@ember/service';
import { tracked } from '@glimmer/tracking';

import type { FetcherMiddlewareHandler } from '@cardstack/runtime-common';
import { baseRealm } from '@cardstack/runtime-common';
import {
fetcher,
maybeHandleScopedCSSRequest,
Expand All @@ -22,6 +23,7 @@ import type NetworkService from './network';
import type RealmService from './realm';
import type RealmInfoService from './realm-info-service';
import type ResetService from './reset';
import { isTesting } from '@embroider/macros';

const log = logger('loader-service');

Expand Down Expand Up @@ -68,7 +70,15 @@ export default class LoaderService extends Service {
// by default we keep the fetch cache so we can take advantage of HTTP
// caching when rebuilding the loader state
if (this.loader) {
this.loader = Loader.cloneLoader(this.loader);
// If we're testing, we can keep the base realm modules cached to speed
// up tests
if (isTesting()) {
this.loader = Loader.cloneLoader(this.loader, {
includeEvaluatedModules: `${baseRealm.url}.*`,
});
} else {
this.loader = Loader.cloneLoader(this.loader);
}
} else {
this.loader = this.makeInstance();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/host/tests/acceptance/ai-assistant-test.gts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function modelNameFor(llmId: string): string {

module('Acceptance | AI Assistant tests', function (hooks) {
setupApplicationTest(hooks);
setupLocalIndexing(hooks);

setupOnSave(hooks);

let mockMatrixUtils = setupMockMatrix(hooks, {
Expand Down
1 change: 0 additions & 1 deletion packages/host/tests/acceptance/basic-test.gts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { setupApplicationTest } from '../helpers/setup';

module('Acceptance | basic tests', function (hooks) {
setupApplicationTest(hooks);
setupLocalIndexing(hooks);

let mockMatrixUtils = setupMockMatrix(hooks, {
loggedInAs: '@testuser:localhost',
Expand Down
4 changes: 2 additions & 2 deletions packages/host/tests/acceptance/catalog-app-test.gts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const cardWithUnrecognisedImports = `

module('Acceptance | Catalog | catalog app tests', function (hooks) {
setupApplicationTest(hooks);
setupLocalIndexing(hooks);

setupOnSave(hooks);

let mockMatrixUtils = setupMockMatrix(hooks, {
Expand Down Expand Up @@ -792,7 +792,7 @@ module('Acceptance | Catalog | catalog app tests', function (hooks) {
snapshot.get();
});

/**
/**
* Selects a tab by name within the catalog app
*/
async function selectTab(tabName: string) {
Expand Down
2 changes: 1 addition & 1 deletion packages/host/tests/acceptance/code-patches-test.gts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class TestCard extends CardDef {

module('Acceptance | Code patches tests', function (hooks) {
setupApplicationTest(hooks);
setupLocalIndexing(hooks);

setupOnSave(hooks);

let mockMatrixUtils = setupMockMatrix(hooks, {
Expand Down
Loading
Loading