@jskit-ai/jskit-catalog 0.2.112 → 0.2.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/catalog/packages.json +156 -156
- package/package.json +1 -1
- package/scripts/browser-test-server.mjs +2 -1
- package/scripts/browser-test-servers.mjs +52 -2
- package/scripts/browser-tests.mjs +118 -22
- package/scripts/jskit.mjs +2 -1
package/package.json
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
// database patterns, prepared once for every worker), the test-only `env` and APP_ENV=test, on the host's address in
|
|
6
6
|
// place of the run's own ports. The host's suite then runs against them as a managed target (PLAYWRIGHT_BASE_URL, and
|
|
7
7
|
// PLAYWRIGHT_WORKER_TARGETS for several), signed in with the login state its host supplies, so these servers sign
|
|
8
|
-
// nothing in
|
|
8
|
+
// nothing in; with the port in PLAYWRIGHT_PORT, each of its workers takes its own server's prepared environment, its
|
|
9
|
+
// DB_NAME among them, from the worker environments these servers leave in the app (browserTestConfig()). The host and port come from the arguments, else HOST and PORT; workers, from 1 to 64, from the third
|
|
9
10
|
// argument, else 1. The servers' output also reaches this command's own; stopping the command stops them.
|
|
10
11
|
import { existsSync } from "node:fs";
|
|
11
12
|
import path from "node:path";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
// when it stops, so they never pile up in the cache, nor outlive the sessions they hold.
|
|
17
17
|
import { spawn } from "node:child_process";
|
|
18
18
|
import { once } from "node:events";
|
|
19
|
-
import { createWriteStream, fstatSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
19
|
+
import { createWriteStream, fstatSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
20
20
|
import { createRequire } from "node:module";
|
|
21
21
|
import net from "node:net";
|
|
22
22
|
import path from "node:path";
|
|
@@ -36,6 +36,10 @@ const DROP_WAIT_MS = 5_000;
|
|
|
36
36
|
// drop: the app's prepare module loads the app's own copy of that package, so the launcher reads them here.
|
|
37
37
|
const PREPARED_COPIES = Symbol.for("@jskit-ai/database-runtime/preparedTestDatabaseCopies");
|
|
38
38
|
|
|
39
|
+
// The peak resident memory of the largest app server of a run, beside its worker environments, for the next run's
|
|
40
|
+
// worker count (browserTestWorkers()).
|
|
41
|
+
const SERVER_MEMORY = "server-memory.json";
|
|
42
|
+
|
|
39
43
|
const seconds = (since) => `${((performance.now() - since) / 1000).toFixed(1)}s`;
|
|
40
44
|
const words = (command) => String(command).trim().split(/\s+/u).filter(Boolean);
|
|
41
45
|
|
|
@@ -108,11 +112,54 @@ const servers = [];
|
|
|
108
112
|
let stopping = false;
|
|
109
113
|
// The files this run leaves for its workers, which it removes when it stops.
|
|
110
114
|
let runFiles = [];
|
|
115
|
+
// Where this run records its servers' peak memory as they stop.
|
|
116
|
+
let serverMemoryFile = "";
|
|
111
117
|
// The prepare module's work, which a stop waits for (within DROP_WAIT_MS) so the copies it is making are dropped too.
|
|
112
118
|
let preparing = Promise.resolve();
|
|
113
119
|
const running = (server) => server.exitCode === null && server.signalCode === null;
|
|
114
120
|
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms, false));
|
|
121
|
+
/** The peak resident memory (VmHWM) of process `pid` and each process under it, added up, in bytes (Linux's /proc). */
|
|
122
|
+
function treePeakBytes(pid) {
|
|
123
|
+
const children = new Map();
|
|
124
|
+
for (const entry of readdirSync("/proc").filter((name) => /^\d+$/u.test(name))) {
|
|
125
|
+
let stat;
|
|
126
|
+
try {
|
|
127
|
+
stat = readFileSync(`/proc/${entry}/stat`, "utf8");
|
|
128
|
+
} catch {
|
|
129
|
+
continue; // It ended while the others were read.
|
|
130
|
+
}
|
|
131
|
+
// "pid (name) state ppid ...", where the name may hold spaces and parentheses.
|
|
132
|
+
const parent = Number(stat.slice(stat.lastIndexOf(")") + 2).split(" ")[1]);
|
|
133
|
+
children.set(parent, [...(children.get(parent) ?? []), Number(entry)]);
|
|
134
|
+
}
|
|
135
|
+
let total = 0;
|
|
136
|
+
for (const queue = [pid]; queue.length > 0;) {
|
|
137
|
+
const current = queue.pop();
|
|
138
|
+
try {
|
|
139
|
+
total += Number(readFileSync(`/proc/${current}/status`, "utf8").match(/^VmHWM:\s+(\d+) kB$/mu)?.[1] ?? 0) * 1024;
|
|
140
|
+
} catch {
|
|
141
|
+
// It ended while the others were read.
|
|
142
|
+
}
|
|
143
|
+
queue.push(...(children.get(current) ?? []));
|
|
144
|
+
}
|
|
145
|
+
return total;
|
|
146
|
+
}
|
|
147
|
+
/** Records the peak memory of the largest of the run's app servers as they stop, for the next run's worker count. */
|
|
148
|
+
function recordServerMemory() {
|
|
149
|
+
if (process.platform !== "linux" || !serverMemoryFile) return;
|
|
150
|
+
try {
|
|
151
|
+
const peak = Math.max(0, ...servers.filter(running).map((server) => treePeakBytes(server.pid)));
|
|
152
|
+
if (peak < 1) return;
|
|
153
|
+
// Written whole, then renamed, so a run starting beside this one never reads half of it.
|
|
154
|
+
writeFileSync(`${serverMemoryFile}.${process.pid}`, JSON.stringify({ serverPeakBytes: peak }));
|
|
155
|
+
renameSync(`${serverMemoryFile}.${process.pid}`, serverMemoryFile);
|
|
156
|
+
} catch (error) {
|
|
157
|
+
console.error(`[browser-tests] The servers' peak memory was not recorded (${error.message}); the next run goes by the ` +
|
|
158
|
+
"peak an earlier run recorded, if any.");
|
|
159
|
+
}
|
|
160
|
+
}
|
|
115
161
|
function stopServers() {
|
|
162
|
+
if (!stopping) recordServerMemory();
|
|
116
163
|
stopping = true;
|
|
117
164
|
for (const server of servers) if (running(server)) server.kill("SIGTERM");
|
|
118
165
|
}
|
|
@@ -158,8 +205,11 @@ const started = performance.now();
|
|
|
158
205
|
const appRoot = process.cwd();
|
|
159
206
|
const {
|
|
160
207
|
workers, host, basePort, server, build, prepare, env, health, workerEnvironments: workerEnvironmentsFile, signIn,
|
|
161
|
-
signedInStates, terminal
|
|
208
|
+
signedInStates, terminal, memory
|
|
162
209
|
} = JSON.parse(process.env[SETTINGS_VARIABLE] || "{}");
|
|
210
|
+
serverMemoryFile = workerEnvironmentsFile ? path.join(path.dirname(workerEnvironmentsFile), SERVER_MEMORY) : "";
|
|
211
|
+
// Fewer workers than the test budget allows, for the memory available: said before anything starts.
|
|
212
|
+
if (memory) console.log(`[browser-tests] ${memory}.`);
|
|
163
213
|
// The servers, and the databases prepared for them, are APP_ENV=test.
|
|
164
214
|
useTestAppEnvironment(process.env, "jskit browser tests");
|
|
165
215
|
const baseEnvironment = { ...process.env };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import os from "node:os";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import process from "node:process";
|
|
5
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -34,6 +35,15 @@ const NAVIGATION_TIMEOUT_MS = 30_000;
|
|
|
34
35
|
const SERVERS_TIMEOUT_MS = 180_000;
|
|
35
36
|
// Where the servers' launcher leaves each worker's server environment, for that worker's own process.
|
|
36
37
|
const WORKER_ENVIRONMENTS = path.join("node_modules", ".cache", "jskit-browser-tests");
|
|
38
|
+
// The peak resident memory of the largest app server of the last local run, which its launcher records as its servers
|
|
39
|
+
// stop (browser-test-servers.mjs).
|
|
40
|
+
const SERVER_MEMORY = "server-memory.json";
|
|
41
|
+
const GIB = 1024 ** 3;
|
|
42
|
+
// The variables that name a worker's own test database, which its tests may open.
|
|
43
|
+
const DATABASE_VARIABLES = Object.freeze(["DB_NAME", "TEST_DB_NAME", "BROWSER_TEST_DB_NAME"]);
|
|
44
|
+
// The databases a test process may open, and how it reaches one: @jskit-ai/database-runtime's testDatabaseGuard.js
|
|
45
|
+
// reads it, and the app's knexfile settings and runtime refuse any other database.
|
|
46
|
+
const TEST_DATABASE_GUARD = "JSKIT_TEST_DATABASE_GUARD";
|
|
37
47
|
|
|
38
48
|
const positiveInteger = (value) => (/^[1-9]\d*$/u.test(String(value ?? "").trim()) ? Number(String(value).trim()) : 0);
|
|
39
49
|
|
|
@@ -91,22 +101,76 @@ function commandLineWorkers(argv) {
|
|
|
91
101
|
return 0;
|
|
92
102
|
}
|
|
93
103
|
|
|
104
|
+
/** The memory this process may still take: its cgroup's limit where one applies, else the machine's. */
|
|
105
|
+
function systemAvailableMemory() {
|
|
106
|
+
return process.availableMemory?.() || os.freemem();
|
|
107
|
+
}
|
|
108
|
+
|
|
94
109
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
|
|
110
|
+
* The peak resident memory, in bytes, the largest app server of the last browser run in `cwd` reached, or 0 when none
|
|
111
|
+
* is recorded. Its launcher records it as its servers stop (on Linux), a local run's and `jskit browser-test-server`'s
|
|
112
|
+
* alike, so a host sizing a managed run by its servers' memory reads it here.
|
|
113
|
+
* @param {{ cwd?: string }} [options]
|
|
114
|
+
* @returns {number}
|
|
115
|
+
*/
|
|
116
|
+
function browserTestServerPeakBytes({ cwd = process.cwd() } = {}) {
|
|
117
|
+
const file = path.resolve(cwd, WORKER_ENVIRONMENTS, SERVER_MEMORY);
|
|
118
|
+
if (!existsSync(file)) return 0;
|
|
119
|
+
const peak = Number(JSON.parse(readFileSync(file, "utf8")).serverPeakBytes);
|
|
120
|
+
return peak > 0 ? peak : 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The local workers the available memory holds at the peak the last run's largest app server reached, at most
|
|
125
|
+
* `budgeted`, with why when fewer; `budgeted` when no run has recorded its servers' peak yet. Only the app servers are
|
|
126
|
+
* measured, not the browsers or Playwright's own processes, and the reason says so.
|
|
101
127
|
*/
|
|
102
|
-
function
|
|
128
|
+
function memoryWorkers(budgeted, { cwd, availableMemory }) {
|
|
129
|
+
const peak = browserTestServerPeakBytes({ cwd });
|
|
130
|
+
if (!peak) return { workers: budgeted, memory: "" };
|
|
131
|
+
const available = availableMemory();
|
|
132
|
+
const held = Math.max(1, Math.floor(available / peak));
|
|
133
|
+
if (held >= budgeted) return { workers: budgeted, memory: "" };
|
|
134
|
+
const gib = (bytes) => `${(bytes / GIB).toFixed(1)} GiB`;
|
|
135
|
+
return {
|
|
136
|
+
workers: held,
|
|
137
|
+
memory: `${held} worker${held === 1 ? "" : "s"}, not the ${budgeted} the test budget allows: ${gib(available)} of memory is ` +
|
|
138
|
+
`available, and the largest app server peaked at ${gib(peak)} in the last run (only the app servers are measured, not ` +
|
|
139
|
+
"the browsers or Playwright's own processes)"
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** browserTestWorkers()'s count, and for a local run held back by memory, why. */
|
|
144
|
+
function workersOf({ env, argv, cwd, availableMemory }) {
|
|
103
145
|
const asked = commandLineWorkers(argv) || positiveInteger(env.PLAYWRIGHT_WORKERS);
|
|
104
146
|
const targets = managedBaseUrl(env) ? managedWorkerTargets(env) : null;
|
|
105
147
|
if (targets && asked && asked !== targets.length) {
|
|
106
148
|
throw new Error(`PLAYWRIGHT_WORKER_TARGETS lists ${targets.length} app servers, one per Playwright worker, so this run ` +
|
|
107
149
|
`cannot use ${asked} workers. Leave the count to the host that serves them.`);
|
|
108
150
|
}
|
|
109
|
-
|
|
151
|
+
const chosen = targets?.length || asked || (managedBaseUrl(env) ? 1 : 0);
|
|
152
|
+
if (chosen) return { workers: chosen, memory: "" };
|
|
153
|
+
return memoryWorkers(Math.max(1, Math.floor(testConcurrency({ env }) / 2)), { cwd, availableMemory });
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* How many workers a browser run uses: the command line's `--workers`, else PLAYWRIGHT_WORKERS, else half the machine's
|
|
158
|
+
* test budget for a local run and 1 for a managed target (one server). A local worker drives a browser and its own app
|
|
159
|
+
* server, about two threads' work: with a budget of 4, the shell foundation's 9 tests took 11.5 s on 4 workers and
|
|
160
|
+
* 7.9 s on 2. A local run takes no more workers than the memory available holds at the peak its largest app server
|
|
161
|
+
* reached in the last run (the launcher records it, on Linux), never fewer than one. A managed target whose host lists
|
|
162
|
+
* several app servers (PLAYWRIGHT_WORKER_TARGETS) runs one worker per server, and refuses another count: a worker would
|
|
163
|
+
* have no server, or a server no worker.
|
|
164
|
+
* @param {{ env?: Record<string, string | undefined>, argv?: ReadonlyArray<string>, cwd?: string,
|
|
165
|
+
* availableMemory?: () => number }} [options]
|
|
166
|
+
*/
|
|
167
|
+
function browserTestWorkers({
|
|
168
|
+
env = process.env,
|
|
169
|
+
argv = process.argv,
|
|
170
|
+
cwd = process.cwd(),
|
|
171
|
+
availableMemory = systemAvailableMemory
|
|
172
|
+
} = {}) {
|
|
173
|
+
return workersOf({ env, argv, cwd, availableMemory }).workers;
|
|
110
174
|
}
|
|
111
175
|
|
|
112
176
|
// Finds `count` consecutive ports nothing listens on, at a random place below Linux's ephemeral range, and prints the
|
|
@@ -152,6 +216,32 @@ function preparedWorkerEnvironment(file, index) {
|
|
|
152
216
|
}
|
|
153
217
|
}
|
|
154
218
|
|
|
219
|
+
/**
|
|
220
|
+
* A Playwright worker's environment: the one prepare gave its server, from the run's worker environments, and the
|
|
221
|
+
* databases its tests may open, that server's own (TEST_DATABASE_GUARD). A managed run's worker reads it when its host
|
|
222
|
+
* names PLAYWRIGHT_PORT, the port it started `jskit browser-test-server` on; otherwise it may open no database, since
|
|
223
|
+
* its environment's DB_NAME is the host's own, such as a development database.
|
|
224
|
+
*/
|
|
225
|
+
function workerEnvironment({ managed, servedPort, workerEnvironments, workerIndex }) {
|
|
226
|
+
const given = "this Playwright worker was given";
|
|
227
|
+
if (managed && !servedPort) {
|
|
228
|
+
const fix = "A managed run's worker reaches its own server's database when the host names PLAYWRIGHT_PORT, the port it " +
|
|
229
|
+
"started `jskit browser-test-server` on, beside PLAYWRIGHT_BASE_URL and PLAYWRIGHT_WORKER_TARGETS.";
|
|
230
|
+
return { [TEST_DATABASE_GUARD]: JSON.stringify({ databases: [], given, fix }) };
|
|
231
|
+
}
|
|
232
|
+
if (managed && !existsSync(workerEnvironments)) {
|
|
233
|
+
throw new Error(`PLAYWRIGHT_PORT names ${servedPort}, the port this managed run's \`jskit browser-test-server\` was started ` +
|
|
234
|
+
`on, but its servers' environments (${workerEnvironments}) are not here: run the suite in the app those servers ` +
|
|
235
|
+
"serve, while they run.");
|
|
236
|
+
}
|
|
237
|
+
const prepared = preparedWorkerEnvironment(workerEnvironments, workerIndex);
|
|
238
|
+
const databases = [...new Set(DATABASE_VARIABLES.map((name) => String(prepared[name] || "").trim()).filter(Boolean))];
|
|
239
|
+
const fix = databases.length > 0
|
|
240
|
+
? "Open the database through this worker's environment (process.env), which holds its own server's copy."
|
|
241
|
+
: "This run's servers have no database of their own: browserTestConfig()'s prepare module answers each worker's DB_NAME.";
|
|
242
|
+
return { ...prepared, [TEST_DATABASE_GUARD]: JSON.stringify({ databases, given, fix }) };
|
|
243
|
+
}
|
|
244
|
+
|
|
155
245
|
/**
|
|
156
246
|
* The Playwright configuration of an application's browser tests.
|
|
157
247
|
* @param {object} [options]
|
|
@@ -162,7 +252,9 @@ function preparedWorkerEnvironment(file, index) {
|
|
|
162
252
|
* @param {string} [options.build] The command that builds the production frontend into the folder the server serves.
|
|
163
253
|
* @param {string} [options.prepare] An app module, run once before the servers start, whose default export
|
|
164
254
|
* `({ workers, baseUrls })` returns each worker's server environment, such as its own DB_NAME. The worker's own
|
|
165
|
-
* process gets it too, so a test that opens the database itself reaches its own server's copy
|
|
255
|
+
* process gets it too, so a test that opens the database itself reaches its own server's copy, and none other: the
|
|
256
|
+
* app's knexfile settings and runtime refuse any other database there. A managed run's worker gets it when its host
|
|
257
|
+
* names PLAYWRIGHT_PORT, the port it started `jskit browser-test-server` on; without it, it opens no database.
|
|
166
258
|
* @param {string} [options.signIn] An app module whose default export `({ request, baseURL, workerIndex, env })` signs
|
|
167
259
|
* `request`, a Playwright APIRequestContext on one worker's server (`env` is that server's environment), in once,
|
|
168
260
|
* such as with `loginRequestAsExistingUser()` from @jskit-ai/auth-web/test/playwright. Each of that worker's tests
|
|
@@ -192,7 +284,8 @@ function browserTestConfig({
|
|
|
192
284
|
actionTimeout = ACTION_TIMEOUT_MS,
|
|
193
285
|
navigationTimeout = NAVIGATION_TIMEOUT_MS,
|
|
194
286
|
environment = process.env,
|
|
195
|
-
cwd = process.cwd()
|
|
287
|
+
cwd = process.cwd(),
|
|
288
|
+
availableMemory = systemAvailableMemory
|
|
196
289
|
} = {}) {
|
|
197
290
|
if (globalTimeout !== undefined && (!Number.isInteger(globalTimeout) || globalTimeout < 1)) {
|
|
198
291
|
throw new Error("browserTestConfig() needs a globalTimeout of at least 1 ms; a run is always bounded.");
|
|
@@ -203,13 +296,13 @@ function browserTestConfig({
|
|
|
203
296
|
}
|
|
204
297
|
}
|
|
205
298
|
const managed = managedBaseUrl(environment);
|
|
206
|
-
const workers =
|
|
299
|
+
const { workers, memory } = workersOf({ env: environment, argv: process.argv, cwd, availableMemory });
|
|
207
300
|
// A host serving the managed target several app servers: this worker's own, and its signed-in state.
|
|
208
301
|
const workerTargets = managed ? managedWorkerTargets(environment) : null;
|
|
209
|
-
const
|
|
210
|
-
const workerTarget = workerTargets ? workerTargets[
|
|
302
|
+
const workerIndex = Number.parseInt(String(environment.TEST_PARALLEL_INDEX || "0"), 10) || 0;
|
|
303
|
+
const workerTarget = workerTargets ? workerTargets[workerIndex] : null;
|
|
211
304
|
if (workerTargets && !workerTarget) {
|
|
212
|
-
throw new Error(`PLAYWRIGHT_WORKER_TARGETS has no app server for Playwright worker ${
|
|
305
|
+
throw new Error(`PLAYWRIGHT_WORKER_TARGETS has no app server for Playwright worker ${workerIndex}.`);
|
|
213
306
|
}
|
|
214
307
|
const runTimeout = globalTimeout ?? Math.max(MIN_GLOBAL_TIMEOUT_MS, Math.ceil(WORKER_MINUTES_MS / workers));
|
|
215
308
|
let basePort = positiveInteger(environment.PLAYWRIGHT_PORT) || port;
|
|
@@ -222,9 +315,11 @@ function browserTestConfig({
|
|
|
222
315
|
environment.PLAYWRIGHT_PORT = String(basePort);
|
|
223
316
|
}
|
|
224
317
|
// A Playwright worker loads this config again, with its own TEST_PARALLEL_INDEX, and reaches its own server; its
|
|
225
|
-
// process takes the environment prepare gave that server, such as its DB_NAME, before any test file loads.
|
|
226
|
-
|
|
227
|
-
|
|
318
|
+
// process takes the environment prepare gave that server, such as its DB_NAME, before any test file loads. A managed
|
|
319
|
+
// run's servers are `jskit browser-test-server`'s, worker i's on the port its host started it on plus i, which the
|
|
320
|
+
// host names in PLAYWRIGHT_PORT: the targets' URLs may reach them through other ports.
|
|
321
|
+
const servedPort = managed ? positiveInteger(environment.PLAYWRIGHT_PORT) : basePort;
|
|
322
|
+
const workerEnvironments = path.resolve(cwd, WORKER_ENVIRONMENTS, `workers-${servedPort || basePort}.json`);
|
|
228
323
|
// A login state the host supplies is used as it is; the servers sign in only when there is none. A worker of a
|
|
229
324
|
// project that depends on another (a setup project) inherits the environment that project's workers changed,
|
|
230
325
|
// including the state this harness gave them, so one of this harness's own states is never taken for the host's.
|
|
@@ -232,14 +327,15 @@ function browserTestConfig({
|
|
|
232
327
|
const suppliedState = String(environment.PLAYWRIGHT_STORAGE_STATE || "").trim();
|
|
233
328
|
const hostState = suppliedState.startsWith(`${ownStates}-`) ? "" : suppliedState;
|
|
234
329
|
const signedInStates = signIn && !managed && !hostState ? ownStates : "";
|
|
235
|
-
if (
|
|
236
|
-
Object.assign(environment,
|
|
330
|
+
if (environment.TEST_PARALLEL_INDEX !== undefined) {
|
|
331
|
+
Object.assign(environment, workerEnvironment({ managed, servedPort, workerEnvironments, workerIndex }));
|
|
237
332
|
if (signedInStates) environment.PLAYWRIGHT_STORAGE_STATE = `${signedInStates}-${workerIndex}.json`;
|
|
238
333
|
}
|
|
239
334
|
const storageState = workerTarget ? workerTarget.storageState : String(environment.PLAYWRIGHT_STORAGE_STATE || "").trim();
|
|
240
335
|
const settings = {
|
|
241
336
|
workers, host: HOST, basePort, server, build, prepare, env, health, workerEnvironments,
|
|
242
|
-
...(signedInStates ? { signIn, signedInStates } : {})
|
|
337
|
+
...(signedInStates ? { signIn, signedInStates } : {}),
|
|
338
|
+
...(memory ? { memory } : {})
|
|
243
339
|
};
|
|
244
340
|
|
|
245
341
|
return {
|
|
@@ -273,4 +369,4 @@ function browserTestConfig({
|
|
|
273
369
|
};
|
|
274
370
|
}
|
|
275
371
|
|
|
276
|
-
export { SETTINGS_VARIABLE, browserTestConfig, browserTestWorkers };
|
|
372
|
+
export { SETTINGS_VARIABLE, browserTestConfig, browserTestServerPeakBytes, browserTestWorkers };
|
package/scripts/jskit.mjs
CHANGED
|
@@ -106,7 +106,8 @@ function usage() {
|
|
|
106
106
|
" playwright.config.mjs browserTestConfig(), worker i on port+i, on the production build, each with",
|
|
107
107
|
" the database its prepare module gives that worker, its test-only env and APP_ENV=test. The",
|
|
108
108
|
" host's suite runs against them with PLAYWRIGHT_BASE_URL (and PLAYWRIGHT_WORKER_TARGETS for",
|
|
109
|
-
" several)
|
|
109
|
+
" several), [port] in PLAYWRIGHT_PORT, so each worker opens only its own server's database, and",
|
|
110
|
+
" the login state the host supplies. It runs until it is stopped.",
|
|
110
111
|
"",
|
|
111
112
|
"<locale> is a BCP 47 language tag, such as fr or pt-BR."
|
|
112
113
|
].join("\n");
|