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
5 changes: 4 additions & 1 deletion src/test/access-write-back.property.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from "../config";
import { writeAccess } from "../service/connectionState";
import { writerCalls } from "./writerCalls";
import { LOADED_HOST_TIMEOUT_MS } from "./helpers/timeouts";

const original = getModuleConfig();
const SEED = Number(process.env.FC_SEED ?? 20261116);
Expand Down Expand Up @@ -77,7 +78,9 @@ const neighbours = fc.array(
{ maxLength: 6 },
);

describe("[property] external access write-back", () => {
describe("[property] external access write-back", function () {
this.timeout(LOADED_HOST_TIMEOUT_MS);

afterEach(() => setModuleConfig(original));

it("sends the configuration writer the input with only the target's access replaced, whatever the other entries hold, and never throws", async () => {
Expand Down
5 changes: 4 additions & 1 deletion src/test/config.journeys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { getModuleConfig, setModuleConfig } from "../config";
import { callDatabase } from "./helpers/http";
import { objectsAt, text } from "./helpers/pick";
import { createOwnerSession, type OwnerSession } from "./ownerSession";
import { LOADED_HOST_TIMEOUT_MS } from "./helpers/timeouts";

/**
* The schemas whose badge each journey reads, with the label and tone the Overview feed must give them under the
Expand Down Expand Up @@ -74,7 +75,9 @@ async function badges(
);
}

describe("[integration] config journeys", () => {
describe("[integration] config journeys", function () {
this.timeout(LOADED_HOST_TIMEOUT_MS);

let owner: OwnerSession;

before(async () => {
Expand Down
5 changes: 4 additions & 1 deletion src/test/connection-access.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { getModuleConfig, setModuleConfig } from "../config";
import { configuredAccess } from "../connectionAccess";
import { isObject } from "../utils/guards";
import { type OwnerSession, createOwnerSession } from "./ownerSession";
import { LOADED_HOST_TIMEOUT_MS } from "./helpers/timeouts";

const TABLE = "connection-access-countries";
const API = "http://127.0.0.1:5023/api/connection-access";
Expand Down Expand Up @@ -92,7 +93,9 @@ export class UnlistedCountries extends MappedCountries(
"/api/connection-access/unlisted",
) {}

describe("[integration] a table mapped from an external connection", () => {
describe("[integration] a table mapped from an external connection", function () {
this.timeout(LOADED_HOST_TIMEOUT_MS);

let owner: OwnerSession;

const send = (method: string, url: string, body?: { name: string }) =>
Expand Down
5 changes: 4 additions & 1 deletion src/test/data.journeys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { callDatabase } from "./helpers/http";
import { pick } from "./helpers/pick";
import { createMemberSession } from "./ownerSession";
import { LOADED_HOST_TIMEOUT_MS } from "./helpers/timeouts";

async function assertInstancePicker(api: DataApi): Promise<void> {
const instances = async (query: string) => {
Expand Down Expand Up @@ -332,7 +333,9 @@ async function assertOwnerOnly(api: DataApi): Promise<void> {
}
}

describe("[integration] data journeys", () => {
describe("[integration] data journeys", function () {
this.timeout(LOADED_HOST_TIMEOUT_MS);

const api = withDataFixture("data-journeys-owner@example.test");

it("the-instance-picker-lists-named-instances-with-a-search-and-a-limit", () =>
Expand Down
5 changes: 4 additions & 1 deletion src/test/diagram-routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { DatabaseDiagramController } from "../routes/diagram";
import { OWN_CONNECTION } from "../types/constants";
import type { JsonValue } from "../types/json";
import { refusal } from "./refusal";
import { LOADED_HOST_TIMEOUT_MS } from "./helpers/timeouts";

const SCHEMA_NAME = "diagram-routes-shop";
const OTHER_SCHEMA_NAME = "diagram-routes-other";
Expand Down Expand Up @@ -43,7 +44,9 @@ function withCleanTables(): void {
after(clearAll);
}

describe("[integration] diagram layout routes", () => {
describe("[integration] diagram layout routes", function () {
this.timeout(LOADED_HOST_TIMEOUT_MS);

withCleanTables();

it("answers an empty layout for a schema that has none", async () => {
Expand Down
5 changes: 4 additions & 1 deletion src/test/editing.journeys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { callDatabase, type HttpAnswer } from "./helpers/http";
import { pick } from "./helpers/pick";
import { createOwnerSession, type OwnerSession } from "./ownerSession";
import { LOADED_HOST_TIMEOUT_MS } from "./helpers/timeouts";

const SHOP = "editing-journeys-shop";
const ID = "eu_ord_10405";
Expand Down Expand Up @@ -176,7 +177,9 @@ async function assertRefusals(session: OwnerSession): Promise<void> {
assert.match(missing.text, /Row not found/);
}

describe("[integration] editing journeys", () => {
describe("[integration] editing journeys", function () {
this.timeout(LOADED_HOST_TIMEOUT_MS);

let owner: OwnerSession;

before(async () => {
Expand Down
5 changes: 4 additions & 1 deletion src/test/external-access.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { writeAccess } from "../service/connectionState";
import { keyedRefusal, refusal } from "./refusal";
import { queryContext } from "./requestContext";
import { answerNextWrite, writerCalls } from "./writerCalls";
import { LOADED_HOST_TIMEOUT_MS } from "./helpers/timeouts";

const controller = new DatabaseConnectionsController();
const browse = new DatabaseBrowseController();
Expand Down Expand Up @@ -43,7 +44,9 @@ async function accessOf(connection: string): Promise<string | undefined> {
return connections.find(({ id }) => id === connection)?.access;
}

describe("[integration] external connections: changing access", () => {
describe("[integration] external connections: changing access", function () {
this.timeout(LOADED_HOST_TIMEOUT_MS);

beforeEach(() => setModuleConfig({ ...original, externalConnections: {} }));
afterEach(() => setModuleConfig(original));

Expand Down
5 changes: 5 additions & 0 deletions src/test/helpers/timeouts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** Budget for a test or hook that talks to the in-memory MongoDB and the booted DMS on a host that is busy or slow. */
export const LOADED_HOST_TIMEOUT_MS = 30_000;

/** Budget for a hook that seeds a fixture, which also waits on the first DMS boot and MongoDB download on a slow runner. */
export const SEED_HOOK_TIMEOUT_MS = 120_000;
6 changes: 5 additions & 1 deletion src/test/redesign.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { listRowReferences } from "../service/references";
import { isObject, isRecord } from "../utils/guards";
import { queryContext } from "./requestContext";
import { encode } from "./stagedWire";
import { SEED_HOOK_TIMEOUT_MS } from "./helpers/timeouts";

const SCHEMA = "redesign-shop";
const INSTANCE = "eu";
Expand Down Expand Up @@ -118,7 +119,10 @@ async function cleanUp(): Promise<void> {
.run();
}

before(seed);
before(async function () {
this.timeout(SEED_HOOK_TIMEOUT_MS);
await seed();
});
after(cleanUp);

describe("[integration] v2 redesign: browsing", () => {
Expand Down
6 changes: 5 additions & 1 deletion src/test/schemas-page.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
parseHasFlags,
readSchemaFilters,
} from "../service/schemaFilters";
import { SEED_HOOK_TIMEOUT_MS } from "./helpers/timeouts";

/**
* The Schemas page: rows counted across instances (S-7), columns holding
Expand Down Expand Up @@ -84,7 +85,10 @@ async function cleanUp(): Promise<void> {
}

describe("[integration] Schemas page", () => {
before(seed);
before(async function () {
this.timeout(SEED_HOOK_TIMEOUT_MS);
await seed();
});
after(cleanUp);

/** The source as the table view calls it, with the bar's hidden filters. */
Expand Down
Loading