@elench/testkit 0.1.80 → 0.1.82
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/README.md +78 -56
- package/lib/cli/args.mjs +2 -14
- package/lib/cli/args.test.mjs +1 -17
- package/lib/cli/command-helpers.mjs +1 -20
- package/lib/cli/entrypoint.mjs +0 -4
- package/lib/cli/presentation/colors.mjs +1 -1
- package/lib/cli/presentation/failure-presentation.mjs +4 -4
- package/lib/cli/presentation/run-reporter.mjs +23 -9
- package/lib/cli/presentation/run-reporter.test.mjs +12 -6
- package/lib/cli/presentation/summary-box.test.mjs +4 -4
- package/lib/cli/viewer.mjs +18 -19
- package/lib/config/index.mjs +6 -6
- package/lib/config/runtime.mjs +8 -8
- package/lib/config-api/auth-fixtures.mjs +762 -0
- package/lib/config-api/index.d.ts +96 -112
- package/lib/config-api/index.mjs +22 -12
- package/lib/config-api/index.test.mjs +61 -222
- package/lib/index.d.ts +29 -9
- package/lib/package.test.mjs +4 -4
- package/lib/{known-failures → regressions}/github.mjs +36 -78
- package/lib/regressions/github.test.mjs +324 -0
- package/lib/regressions/index.d.ts +189 -0
- package/lib/{known-failures → regressions}/index.mjs +90 -93
- package/lib/{known-failures → regressions}/index.test.mjs +37 -48
- package/lib/runner/formatting.mjs +49 -34
- package/lib/runner/formatting.test.mjs +16 -15
- package/lib/runner/metadata.mjs +1 -1
- package/lib/runner/orchestrator.mjs +7 -9
- package/lib/runner/regressions.mjs +304 -0
- package/lib/runner/{triage.test.mjs → regressions.test.mjs} +50 -36
- package/lib/runner/reporting.mjs +2 -2
- package/lib/runner/reporting.test.mjs +2 -2
- package/lib/runner/run-finalization.mjs +18 -30
- package/lib/runner/template-steps.mjs +2 -2
- package/lib/runtime/index.d.ts +50 -33
- package/lib/runtime/index.mjs +0 -1
- package/lib/runtime-src/k6/http-suite-runtime.js +147 -0
- package/lib/runtime-src/k6/http.js +80 -41
- package/lib/runtime-src/k6/scenario-suite.js +13 -110
- package/lib/runtime-src/k6/suite.js +13 -107
- package/node_modules/@elench/next-analysis/package.json +1 -1
- package/node_modules/@elench/testkit-bridge/package.json +2 -2
- package/node_modules/@elench/testkit-protocol/package.json +1 -1
- package/node_modules/@elench/ts-analysis/package.json +1 -1
- package/package.json +8 -8
- package/lib/cli/commands/known-failures/render.mjs +0 -19
- package/lib/cli/commands/known-failures/validate.mjs +0 -20
- package/lib/cli/known-failures.mjs +0 -164
- package/lib/config-api/profiles.mjs +0 -640
- package/lib/known-failures/github.test.mjs +0 -512
- package/lib/known-failures/index.d.ts +0 -192
- package/lib/runner/triage.mjs +0 -221
- /package/lib/{known-failures → regressions}/github-cache.mjs +0 -0
- /package/lib/{known-failures → regressions}/github-transport.mjs +0 -0
|
@@ -143,7 +143,7 @@ export interface BrowserServiceConfig {
|
|
|
143
143
|
origins?: string[];
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
export interface
|
|
146
|
+
export interface RegressionSyncConfig {
|
|
147
147
|
provider?: "github";
|
|
148
148
|
mode?: "off" | "warn" | "error";
|
|
149
149
|
cacheTtlSeconds?: number;
|
|
@@ -192,22 +192,22 @@ export interface TestkitFileMetadata {
|
|
|
192
192
|
skip?: string | { reason: string };
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
export interface
|
|
195
|
+
export interface AuthRequestContext {
|
|
196
196
|
actor: string;
|
|
197
197
|
actorIndex: number;
|
|
198
198
|
env: RuntimeEnv;
|
|
199
199
|
phase: string;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
export type
|
|
202
|
+
export type AuthValueFactory<TValue> =
|
|
203
203
|
| TValue
|
|
204
|
-
| ((context:
|
|
204
|
+
| ((context: AuthRequestContext) => TValue);
|
|
205
205
|
|
|
206
|
-
export interface
|
|
207
|
-
body?:
|
|
206
|
+
export interface AuthRequestConfig {
|
|
207
|
+
body?: AuthValueFactory<unknown>;
|
|
208
208
|
contentTypeJson?: boolean;
|
|
209
209
|
expect?: number | number[];
|
|
210
|
-
headers?:
|
|
210
|
+
headers?: AuthValueFactory<Record<string, string>>;
|
|
211
211
|
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
212
212
|
path: string;
|
|
213
213
|
}
|
|
@@ -222,25 +222,13 @@ export interface SessionAuthHeaderConfig {
|
|
|
222
222
|
source: SessionAuthSourceConfig;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
export interface
|
|
226
|
-
auth?: SessionAuthHeaderConfig;
|
|
227
|
-
cookies?: Record<string, string>;
|
|
228
|
-
fields?: Record<string, string>;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
export interface SessionActorConfig {
|
|
232
|
-
bootstrap?: ProfileRequestConfig | ProfileRequestConfig[];
|
|
233
|
-
login: ProfileRequestConfig;
|
|
234
|
-
session: SessionCaptureConfig;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export interface ProfileHeaderContext<TSession = unknown> {
|
|
225
|
+
export interface AuthProfileHeaderContext<TSession = unknown> {
|
|
238
226
|
actor: string | null;
|
|
239
227
|
env: RuntimeEnv;
|
|
240
228
|
session: TSession | null;
|
|
241
229
|
}
|
|
242
230
|
|
|
243
|
-
export interface
|
|
231
|
+
export interface AuthProfileSessionHeaderConfig {
|
|
244
232
|
actor?: string;
|
|
245
233
|
field: string;
|
|
246
234
|
header: string;
|
|
@@ -252,125 +240,113 @@ export interface DeterministicForwardedForConfig {
|
|
|
252
240
|
seed?: string;
|
|
253
241
|
}
|
|
254
242
|
|
|
255
|
-
export interface
|
|
243
|
+
export interface AuthProfileHeaderOptions<TSession = unknown> {
|
|
256
244
|
contentTypeJson?: boolean;
|
|
257
245
|
forwardedFor?: "deterministic" | DeterministicForwardedForConfig;
|
|
258
|
-
fromSession?:
|
|
259
|
-
values?: Record<string, string> | ((context:
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
export interface RawHttpProfileOptions {
|
|
263
|
-
env?: RuntimeEnv;
|
|
264
|
-
headers?: ProfileHeaderConfig;
|
|
265
|
-
options?: RuntimeOptions;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export interface SessionHttpProfileOptions {
|
|
269
|
-
actor: SessionActorConfig;
|
|
270
|
-
env?: RuntimeEnv;
|
|
271
|
-
headers?: ProfileHeaderConfig<Record<string, unknown>>;
|
|
272
|
-
options?: RuntimeOptions;
|
|
246
|
+
fromSession?: AuthProfileSessionHeaderConfig[];
|
|
247
|
+
values?: Record<string, string> | ((context: AuthProfileHeaderContext<TSession>) => Record<string, string>);
|
|
273
248
|
}
|
|
274
249
|
|
|
275
|
-
export interface
|
|
276
|
-
|
|
277
|
-
env?: RuntimeEnv;
|
|
278
|
-
headers?: ProfileHeaderConfig<Record<string, Record<string, unknown>>>;
|
|
279
|
-
options?: RuntimeOptions;
|
|
280
|
-
primaryActor?: string;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
export interface LocalJsonIdentityContext {
|
|
284
|
-
actor: string;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
export type LocalJsonIdentityValue = string | ((context: LocalJsonIdentityContext) => string);
|
|
288
|
-
|
|
289
|
-
export interface LocalJsonActorIdentityConfig {
|
|
290
|
-
email?: LocalJsonIdentityValue;
|
|
250
|
+
export interface AuthTopologyActorConfig {
|
|
251
|
+
email?: string;
|
|
291
252
|
loginBody?: Record<string, unknown>;
|
|
292
|
-
name?:
|
|
293
|
-
|
|
294
|
-
|
|
253
|
+
name?: string;
|
|
254
|
+
org?: string;
|
|
255
|
+
organizationName?: string;
|
|
256
|
+
password?: string;
|
|
295
257
|
signupBody?: Record<string, unknown>;
|
|
296
258
|
}
|
|
297
259
|
|
|
298
|
-
export interface
|
|
299
|
-
|
|
300
|
-
prefix?: string;
|
|
301
|
-
sourceKey?: string;
|
|
260
|
+
export interface AuthTopologyOrgConfig {
|
|
261
|
+
name?: string;
|
|
302
262
|
}
|
|
303
263
|
|
|
304
|
-
export interface
|
|
305
|
-
auth?: LocalJsonSessionAuthOptions;
|
|
264
|
+
export interface JsonSessionContractOptions {
|
|
306
265
|
authCookie?: string;
|
|
307
|
-
|
|
308
|
-
|
|
266
|
+
authHeader?: string;
|
|
267
|
+
authPrefix?: string;
|
|
268
|
+
authSourceKey?: string;
|
|
269
|
+
contentTypeJson?: boolean;
|
|
270
|
+
forwardedFor?: "deterministic" | DeterministicForwardedForConfig;
|
|
271
|
+
loginExpect?: number | number[];
|
|
272
|
+
loginPath?: string;
|
|
273
|
+
organizationHeader?: false | string;
|
|
309
274
|
organizationIdPath?: string;
|
|
310
275
|
refreshCookie?: string;
|
|
276
|
+
sessionCookies?: Record<string, string>;
|
|
277
|
+
sessionFields?: Record<string, string>;
|
|
278
|
+
signup?: false;
|
|
279
|
+
signupExpect?: number | number[];
|
|
280
|
+
signupPath?: string;
|
|
311
281
|
}
|
|
312
282
|
|
|
313
|
-
export interface
|
|
314
|
-
|
|
315
|
-
field?: string;
|
|
316
|
-
header?: string;
|
|
283
|
+
export interface JsonSessionContract {
|
|
284
|
+
kind: "json-session";
|
|
317
285
|
}
|
|
318
286
|
|
|
319
|
-
export interface
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
287
|
+
export interface SingleOrgTopologyOptions {
|
|
288
|
+
actors?: string[] | Record<string, string | AuthTopologyActorConfig>;
|
|
289
|
+
namespace: string;
|
|
290
|
+
org?: string;
|
|
291
|
+
orgs?: Record<string, AuthTopologyOrgConfig>;
|
|
292
|
+
password?: string;
|
|
324
293
|
}
|
|
325
294
|
|
|
326
|
-
export interface
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
295
|
+
export interface CrossOrgTopologyOptions {
|
|
296
|
+
actors: string[] | Record<string, string | AuthTopologyActorConfig>;
|
|
297
|
+
namespace: string;
|
|
298
|
+
orgs?: Record<string, AuthTopologyOrgConfig>;
|
|
299
|
+
password?: string;
|
|
330
300
|
}
|
|
331
301
|
|
|
332
|
-
export interface
|
|
333
|
-
|
|
334
|
-
path?: string;
|
|
302
|
+
export interface AuthTopology {
|
|
303
|
+
kind: "auth-topology";
|
|
335
304
|
}
|
|
336
305
|
|
|
337
|
-
export interface
|
|
306
|
+
export interface AuthActorProfileOptions {
|
|
338
307
|
env?: RuntimeEnv;
|
|
339
|
-
headers?:
|
|
340
|
-
identities?: Record<string, LocalJsonActorIdentityConfig>;
|
|
341
|
-
login?: LocalJsonLoginOptions;
|
|
308
|
+
headers?: AuthProfileHeaderOptions<Record<string, unknown>>;
|
|
342
309
|
options?: RuntimeOptions;
|
|
343
|
-
password?: LocalJsonIdentityValue;
|
|
344
|
-
session?: LocalJsonSessionOptions;
|
|
345
|
-
signup?: false | LocalJsonSignupOptions;
|
|
346
310
|
}
|
|
347
311
|
|
|
348
|
-
export interface
|
|
349
|
-
|
|
312
|
+
export interface AuthActorsProfileOptions {
|
|
313
|
+
actors: string[];
|
|
350
314
|
env?: RuntimeEnv;
|
|
351
|
-
headers?:
|
|
352
|
-
identity?: LocalJsonActorIdentityConfig;
|
|
315
|
+
headers?: AuthProfileHeaderOptions<Record<string, unknown>>;
|
|
353
316
|
options?: RuntimeOptions;
|
|
317
|
+
primaryActor?: string;
|
|
354
318
|
}
|
|
355
319
|
|
|
356
|
-
export interface
|
|
357
|
-
actors?: string[] | Record<string, LocalJsonActorIdentityConfig>;
|
|
320
|
+
export interface AuthRawProfileOptions {
|
|
358
321
|
env?: RuntimeEnv;
|
|
359
|
-
headers?:
|
|
322
|
+
headers?: AuthProfileHeaderOptions;
|
|
360
323
|
options?: RuntimeOptions;
|
|
361
|
-
primaryActor?: string;
|
|
362
324
|
}
|
|
363
325
|
|
|
364
|
-
export interface
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
326
|
+
export interface AuthActorProfileDescriptor {
|
|
327
|
+
kind: "actor";
|
|
328
|
+
actor: string;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export interface AuthActorsProfileDescriptor {
|
|
332
|
+
kind: "actors";
|
|
333
|
+
actors: string[];
|
|
334
|
+
primaryActor: string;
|
|
368
335
|
}
|
|
369
336
|
|
|
370
|
-
export interface
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
337
|
+
export interface AuthRawProfileDescriptor {
|
|
338
|
+
kind: "raw";
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export type AuthProfileDescriptor =
|
|
342
|
+
| AuthActorProfileDescriptor
|
|
343
|
+
| AuthActorsProfileDescriptor
|
|
344
|
+
| AuthRawProfileDescriptor;
|
|
345
|
+
|
|
346
|
+
export interface AuthFixture {
|
|
347
|
+
contract: JsonSessionContract;
|
|
348
|
+
topology: AuthTopology;
|
|
349
|
+
profiles(definitions: Record<string, AuthProfileDescriptor>): Record<string, HttpSuiteConfig<any>>;
|
|
374
350
|
}
|
|
375
351
|
|
|
376
352
|
export interface NodeAppOptions extends Omit<ServiceConfig, "local" | "runtime" | "env"> {
|
|
@@ -412,9 +388,9 @@ export interface TestkitConfig {
|
|
|
412
388
|
profiles?: {
|
|
413
389
|
http?: Record<string, HttpSuiteConfig<any>>;
|
|
414
390
|
};
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
391
|
+
regressions?: {
|
|
392
|
+
file?: string;
|
|
393
|
+
sync?: RegressionSyncConfig;
|
|
418
394
|
};
|
|
419
395
|
services?: Record<string, ServiceConfig>;
|
|
420
396
|
toolchains?: Record<string, ToolchainConfig>;
|
|
@@ -449,12 +425,20 @@ export declare const database: {
|
|
|
449
425
|
export declare const toolchain: {
|
|
450
426
|
node(options?: NodeToolchainConfig): NodeToolchainConfig;
|
|
451
427
|
};
|
|
452
|
-
export declare const
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
428
|
+
export declare const auth: {
|
|
429
|
+
fixture(options: { contract: JsonSessionContract; topology: AuthTopology }): AuthFixture;
|
|
430
|
+
contracts: {
|
|
431
|
+
jsonSession(options?: JsonSessionContractOptions): JsonSessionContract;
|
|
432
|
+
};
|
|
433
|
+
topologies: {
|
|
434
|
+
crossOrg(options: CrossOrgTopologyOptions): AuthTopology;
|
|
435
|
+
singleOrg(options: SingleOrgTopologyOptions): AuthTopology;
|
|
436
|
+
};
|
|
437
|
+
profile: {
|
|
438
|
+
actor(actorName: string, options?: AuthActorProfileOptions): AuthActorProfileDescriptor;
|
|
439
|
+
actors(options: AuthActorsProfileOptions): AuthActorsProfileDescriptor;
|
|
440
|
+
raw(options?: AuthRawProfileOptions): AuthRawProfileDescriptor;
|
|
441
|
+
};
|
|
458
442
|
};
|
|
459
443
|
|
|
460
444
|
export declare function registerRepoConfig(config: unknown): void;
|
package/lib/config-api/index.mjs
CHANGED
|
@@ -9,12 +9,14 @@ import {
|
|
|
9
9
|
runtimeJson,
|
|
10
10
|
} from "./runtime.mjs";
|
|
11
11
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
actorProfile as createActorProfile,
|
|
13
|
+
actorsProfile as createActorsProfile,
|
|
14
|
+
authFixture as createAuthFixture,
|
|
15
|
+
crossOrgTopology as createCrossOrgTopology,
|
|
16
|
+
jsonSessionContract as createJsonSessionContract,
|
|
17
|
+
rawAuthProfile as createRawAuthProfile,
|
|
18
|
+
singleOrgTopology as createSingleOrgTopology,
|
|
19
|
+
} from "./auth-fixtures.mjs";
|
|
18
20
|
|
|
19
21
|
export function defineConfig(config) {
|
|
20
22
|
return config || {};
|
|
@@ -264,12 +266,20 @@ export const toolchain = {
|
|
|
264
266
|
node: nodeToolchain,
|
|
265
267
|
};
|
|
266
268
|
|
|
267
|
-
export const
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
269
|
+
export const auth = {
|
|
270
|
+
fixture: createAuthFixture,
|
|
271
|
+
contracts: {
|
|
272
|
+
jsonSession: createJsonSessionContract,
|
|
273
|
+
},
|
|
274
|
+
topologies: {
|
|
275
|
+
crossOrg: createCrossOrgTopology,
|
|
276
|
+
singleOrg: createSingleOrgTopology,
|
|
277
|
+
},
|
|
278
|
+
profile: {
|
|
279
|
+
actor: createActorProfile,
|
|
280
|
+
actors: createActorsProfile,
|
|
281
|
+
raw: createRawAuthProfile,
|
|
282
|
+
},
|
|
273
283
|
};
|
|
274
284
|
|
|
275
285
|
export {
|