@zgeoff/rig 0.0.0 → 0.0.2
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 +87 -3
- package/dist/browser/browser-preload.d.ts +1 -0
- package/dist/browser/build-browser-run.d.ts +9 -0
- package/dist/browser/build-lane-environments.d.ts +8 -0
- package/dist/browser/build-recorded-command.d.ts +1 -0
- package/dist/browser/find-browser-run.d.ts +4 -0
- package/dist/browser/find-private-dir-problem.d.ts +2 -0
- package/dist/browser/has-browser-build-script.d.ts +1 -0
- package/dist/browser/has-error-code.d.ts +1 -0
- package/dist/browser/is-zombie-state.d.ts +1 -0
- package/dist/browser/lane-files.d.ts +13 -0
- package/dist/browser/make-browser-lane-hooks.d.ts +22 -0
- package/dist/browser/pick-chrome-dirs.d.ts +7 -0
- package/dist/browser/pick-exit-code-after-tests.d.ts +1 -0
- package/dist/browser/pick-step-after-build.d.ts +7 -0
- package/dist/browser/pick-stop-step.d.ts +17 -0
- package/dist/browser/probe-host-process.d.ts +1 -0
- package/dist/browser/probe-process.d.ts +6 -0
- package/dist/browser/probe-run.d.ts +9 -0
- package/dist/browser/process-group-still-running-error.d.ts +4 -0
- package/dist/browser/process-group-stop-error.d.ts +4 -0
- package/dist/browser/process-groups.d.ts +5 -0
- package/dist/browser/process-runtime.d.ts +15 -0
- package/dist/browser/read-dir-names.d.ts +1 -0
- package/dist/browser/read-process-table.d.ts +6 -0
- package/dist/browser/remove-exited-run-dirs.d.ts +2 -0
- package/dist/browser/remove-path.d.ts +1 -0
- package/dist/browser/run-in-page.d.ts +23 -0
- package/dist/browser/should-keep-run-folders.d.ts +1 -0
- package/dist/browser/start-browser.d.ts +9 -0
- package/dist/browser/start-process-group.d.ts +17 -0
- package/dist/browser/wire-browser-lane-hooks.d.ts +12 -0
- package/dist/build-diet-command.d.ts +1 -0
- package/dist/build-init-scripts.d.ts +3 -0
- package/dist/build-test-selection.d.ts +23 -0
- package/dist/build-unit-command.d.ts +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/define-rig.d.ts +2 -0
- package/dist/find-timeout-arg.d.ts +1 -0
- package/dist/format-no-match-message.d.ts +1 -0
- package/dist/format-no-tests-message.d.ts +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +255 -0
- package/dist/init-files.d.ts +6 -0
- package/dist/is-command-name.d.ts +3 -0
- package/dist/lane-hooks.d.ts +13 -0
- package/dist/make-repo-lane-hooks.d.ts +12 -0
- package/dist/parse-duration.d.ts +1 -0
- package/dist/parse-lane-hook.d.ts +3 -0
- package/dist/parse-lane-start.d.ts +2 -0
- package/dist/parse-rig-config.d.ts +9 -0
- package/dist/parse-test-args.d.ts +5 -0
- package/dist/pick-e2e-dirs.d.ts +1 -0
- package/dist/pick-lane-selection.d.ts +2 -0
- package/dist/read-cli-args.d.ts +5 -0
- package/dist/read-memory-budget.d.ts +8 -0
- package/dist/read-rig-config.d.ts +6 -0
- package/dist/read-tracked-files.d.ts +1 -0
- package/dist/read-worker-count.d.ts +13 -0
- package/dist/resolve-diet-script.d.ts +1 -0
- package/dist/resolve-related-tests.d.ts +6 -0
- package/dist/run-cli.d.ts +9 -0
- package/dist/run-command.d.ts +6 -0
- package/dist/run-init.d.ts +8 -0
- package/dist/run-lane-hooks.d.ts +2 -0
- package/dist/run-lane.d.ts +18 -0
- package/dist/run-related-tests.d.ts +10 -0
- package/dist/run-unit-tests.d.ts +12 -0
- package/dist/run-unit.d.ts +8 -0
- package/dist/standard-lanes.d.ts +8 -0
- package/dist/system-clock.d.ts +5 -0
- package/dist/types.d.ts +42 -0
- package/package.json +41 -3
- package/src/browser/browser-preload.ts +36 -0
- package/src/browser/build-browser-run.ts +32 -0
- package/src/browser/build-lane-environments.ts +33 -0
- package/src/browser/build-recorded-command.ts +12 -0
- package/src/browser/find-browser-run.ts +15 -0
- package/src/browser/find-private-dir-problem.ts +21 -0
- package/src/browser/has-browser-build-script.ts +7 -0
- package/src/browser/has-error-code.ts +3 -0
- package/src/browser/is-zombie-state.ts +4 -0
- package/src/browser/lane-files.ts +56 -0
- package/src/browser/make-browser-lane-hooks.ts +228 -0
- package/src/browser/pick-chrome-dirs.ts +34 -0
- package/src/browser/pick-exit-code-after-tests.ts +5 -0
- package/src/browser/pick-step-after-build.ts +20 -0
- package/src/browser/pick-stop-step.ts +28 -0
- package/src/browser/probe-host-process.ts +11 -0
- package/src/browser/probe-process.ts +35 -0
- package/src/browser/probe-run.ts +38 -0
- package/src/browser/process-group-still-running-error.ts +9 -0
- package/src/browser/process-group-stop-error.ts +10 -0
- package/src/browser/process-groups.ts +45 -0
- package/src/browser/process-runtime.ts +40 -0
- package/src/browser/read-dir-names.ts +15 -0
- package/src/browser/read-process-table.ts +35 -0
- package/src/browser/remove-exited-run-dirs.ts +21 -0
- package/src/browser/remove-path.ts +5 -0
- package/src/browser/run-in-page.ts +103 -0
- package/src/browser/should-keep-run-folders.ts +7 -0
- package/src/browser/start-browser.ts +40 -0
- package/src/browser/start-process-group.ts +168 -0
- package/src/browser/wire-browser-lane-hooks.ts +88 -0
- package/src/build-diet-command.ts +11 -0
- package/src/build-init-scripts.ts +40 -0
- package/src/build-test-selection.ts +124 -0
- package/src/build-unit-command.ts +22 -0
- package/src/cli.ts +73 -0
- package/src/define-rig.ts +195 -0
- package/src/find-timeout-arg.ts +3 -0
- package/src/format-no-match-message.ts +3 -0
- package/src/format-no-tests-message.ts +3 -0
- package/src/index.ts +14 -0
- package/src/init-files.ts +15 -0
- package/src/is-command-name.ts +9 -0
- package/src/lane-hooks.ts +15 -0
- package/src/make-repo-lane-hooks.ts +70 -0
- package/src/parse-duration.ts +14 -0
- package/src/parse-lane-hook.ts +20 -0
- package/src/parse-lane-start.ts +30 -0
- package/src/parse-rig-config.ts +96 -0
- package/src/parse-test-args.ts +14 -0
- package/src/pick-e2e-dirs.ts +25 -0
- package/src/pick-lane-selection.ts +14 -0
- package/src/read-cli-args.ts +57 -0
- package/src/read-memory-budget.ts +65 -0
- package/src/read-rig-config.ts +32 -0
- package/src/read-tracked-files.ts +20 -0
- package/src/read-worker-count.ts +40 -0
- package/src/resolve-diet-script.ts +7 -0
- package/src/resolve-related-tests.ts +52 -0
- package/src/run-cli.ts +68 -0
- package/src/run-command.ts +36 -0
- package/src/run-init.ts +71 -0
- package/src/run-lane-hooks.ts +49 -0
- package/src/run-lane.ts +138 -0
- package/src/run-related-tests.ts +113 -0
- package/src/run-unit-tests.ts +42 -0
- package/src/run-unit.ts +68 -0
- package/src/standard-lanes.ts +23 -0
- package/src/system-clock.ts +10 -0
- package/src/types.ts +75 -0
package/README.md
CHANGED
|
@@ -1,4 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>@zgeoff/rig</h1>
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
<p>
|
|
5
|
+
<a href="https://www.npmjs.com/package/@zgeoff/rig"><img src="https://img.shields.io/npm/v/@zgeoff/rig" alt="npm version"></a>
|
|
6
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT license"></a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p>
|
|
10
|
+
<a href="../../docs/README.md">Documentation</a> •
|
|
11
|
+
<a href="../../docs/architecture/rig.md">How rig works</a> •
|
|
12
|
+
<a href="../../docs/guides/browser-lane.md">Browser lane</a>
|
|
13
|
+
</p>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
Run every test lane of a Bun repo from one declaration of its limits, with a browser lane built in.
|
|
17
|
+
|
|
18
|
+
A repo's tests split into lanes: the unit run, `e2e/` folders, and suites that need a real system,
|
|
19
|
+
such as a browser or a container. `rig` runs each lane with its own timeout, worker count and memory
|
|
20
|
+
cap, and the unit run leaves every lane out, so a lane never runs by mistake. The same declaration
|
|
21
|
+
sets the limits that the `@zgeoff/oxlint-config` rules check. To start, run `rig init`, then
|
|
22
|
+
`rig unit`.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
bun add -d @zgeoff/rig
|
|
28
|
+
bunx rig init
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`rig` runs under Bun. It runs each command under [`@zgeoff/diet`](../diet/README.md), a dependency,
|
|
32
|
+
so a run that outgrows its memory budget fails alone when `diet` finds a
|
|
33
|
+
[cap mode](../../docs/architecture/memory-caps.md#the-modes) that the host supports. With
|
|
34
|
+
`DIET_MODE=none`, or on a host with no supported mode, the command runs uncapped.
|
|
35
|
+
|
|
36
|
+
## Commands
|
|
37
|
+
|
|
38
|
+
- `rig unit` runs the unit tests in random order with the host's worker count.
|
|
39
|
+
- `rig related <paths...>` runs the unit tests beside the changed files, for a pre-push hook.
|
|
40
|
+
- `rig <lane>` runs one lane: `e2e`, `browser`, `docker`, `host`, `agent-sdk`, `model-api`, or a
|
|
41
|
+
lane the repo declares.
|
|
42
|
+
- `rig init` writes the `test`, `test:related` and `test:<lane>` scripts and a starter config.
|
|
43
|
+
|
|
44
|
+
`rig unit` and the lane commands pass every argument after the command on to `bun test`, so
|
|
45
|
+
`bun run test --seed=1` replays a run's order, and rig drops one `--` among them. The exception is
|
|
46
|
+
`--timeout`: the lane's limit in `rig.config.ts` is its one per-test timeout, so rig exits 2 on a
|
|
47
|
+
`--timeout` or `--timeout=<ms>` argument and runs nothing. `rig related` takes changed file paths
|
|
48
|
+
only, and exits 2 on an option.
|
|
49
|
+
|
|
50
|
+
Among those arguments, a path keeps only the lane's own files that it selects: a file, the files
|
|
51
|
+
under a folder, or, for a bare word, the files whose path holds it. rig resolves a path, with its
|
|
52
|
+
`.` and `..` segments, against the repo root, and a path outside the repo selects nothing. When the
|
|
53
|
+
paths select no file of the lane, as `rig unit ./src/oven.host.test.ts` does, rig names them and
|
|
54
|
+
exits 1. An option takes its value after `=`, as in `--rerun-each=2`, because rig reads every
|
|
55
|
+
argument that does not start with `-` as a path. So `--rerun-each 2` makes `2` a path, which selects
|
|
56
|
+
no file and fails the run.
|
|
57
|
+
|
|
58
|
+
## Configuration
|
|
59
|
+
|
|
60
|
+
`rig.config.ts` at the repo root declares what differs from the built-in lanes:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
import { defineRig } from '@zgeoff/rig';
|
|
64
|
+
|
|
65
|
+
export default defineRig({
|
|
66
|
+
lanes: { kiln: { suffix: '.kiln', limit: '15s', start: './test-utils/start-kiln.ts' } },
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Oxlint's plugin reads this file under Node 22.18 or later, or under Bun, because it imports the
|
|
71
|
+
config to take the limits from it.
|
|
72
|
+
|
|
73
|
+
## Testing in a page
|
|
74
|
+
|
|
75
|
+
A `.browser.test.ts` suite runs in Chrome through `Bun.WebView`. `runInPage` runs a real function in
|
|
76
|
+
the page and parses its result with a schema:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { runInPage } from '@zgeoff/rig';
|
|
80
|
+
import { z } from 'zod';
|
|
81
|
+
|
|
82
|
+
const title = await runInPage(view, () => document.title, undefined, z.string());
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Documentation
|
|
86
|
+
|
|
87
|
+
[How rig works](../../docs/architecture/rig.md) describes the lane table, a lane's run, the browser
|
|
88
|
+
lane and the limits mechanism.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface BrowserRun {
|
|
2
|
+
readonly runID: string;
|
|
3
|
+
readonly runsDir: string;
|
|
4
|
+
readonly runDir: string;
|
|
5
|
+
readonly groupsDir: string;
|
|
6
|
+
readonly buildDir: string;
|
|
7
|
+
readonly profilesDir: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function buildBrowserRun(repoRoot: string, hostName: string, runID: string): BrowserRun;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BrowserRun } from './build-browser-run.ts';
|
|
2
|
+
type Environment = Readonly<Record<string, string | undefined>>;
|
|
3
|
+
export interface LaneEnvironments {
|
|
4
|
+
readonly buildEnvironment: Environment;
|
|
5
|
+
readonly testsEnvironment: Environment;
|
|
6
|
+
}
|
|
7
|
+
export declare function buildLaneEnvironments(environment: Environment, run: BrowserRun, chromeRunDir: string, hasBuild: boolean): LaneEnvironments;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function buildRecordedCommand(groupsDir: string, pendingRecord: string, command: readonly string[]): readonly string[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BrowserRun } from './build-browser-run.ts';
|
|
2
|
+
export declare const runIDVariable = "RIG_BROWSER_RUN_ID";
|
|
3
|
+
export declare const buildDirVariable = "RIG_BROWSER_BUILD_DIR";
|
|
4
|
+
export declare function findBrowserRun(repoRoot: string, hostName: string, environment: Readonly<Record<string, string | undefined>>): BrowserRun | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hasBrowserBuildScript(manifest: unknown): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hasErrorCode(error: unknown, code: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isZombieState(state: string): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PathStatus {
|
|
2
|
+
readonly isDirectory: boolean;
|
|
3
|
+
readonly ownerID: number;
|
|
4
|
+
readonly mode: number;
|
|
5
|
+
}
|
|
6
|
+
export interface LaneFiles {
|
|
7
|
+
readonly createPrivateDir: (path: string) => Promise<void>;
|
|
8
|
+
readonly createDirs: (path: string) => Promise<void>;
|
|
9
|
+
readonly readStatus: (path: string) => Promise<PathStatus | null>;
|
|
10
|
+
readonly readDirNames: (path: string) => Promise<readonly string[]>;
|
|
11
|
+
readonly removePath: (path: string) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export declare const laneFiles: LaneFiles;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { LaneHooks } from '../lane-hooks.ts';
|
|
2
|
+
import type { BrowserRun } from './build-browser-run.ts';
|
|
3
|
+
import type { LaneFiles } from './lane-files.ts';
|
|
4
|
+
import type { ChromeDirs } from './pick-chrome-dirs.ts';
|
|
5
|
+
import type { ProcessGroups } from './process-groups.ts';
|
|
6
|
+
type Environment = Readonly<Record<string, string | undefined>>;
|
|
7
|
+
export interface BrowserLaneOptions {
|
|
8
|
+
readonly run: BrowserRun;
|
|
9
|
+
readonly chromeDirs: ChromeDirs;
|
|
10
|
+
readonly userID: number;
|
|
11
|
+
readonly preloadPath: string;
|
|
12
|
+
readonly environment: Environment;
|
|
13
|
+
readonly signal: AbortSignal;
|
|
14
|
+
readonly files: LaneFiles;
|
|
15
|
+
readonly probeProcess: (pid: number) => boolean;
|
|
16
|
+
readonly groups: Pick<ProcessGroups, 'probeGroup'>;
|
|
17
|
+
readonly runBuild: ((environment: Environment, signal: AbortSignal, pendingRecord: string) => Promise<number>) | null;
|
|
18
|
+
readonly reportCleanupError: (error: unknown) => void;
|
|
19
|
+
readonly runTests: (testArgs: readonly string[], environment: Environment, signal: AbortSignal, pendingRecord: string) => Promise<number>;
|
|
20
|
+
}
|
|
21
|
+
export declare function makeBrowserLaneHooks(options: BrowserLaneOptions): LaneHooks;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BrowserRun } from './build-browser-run.ts';
|
|
2
|
+
export interface ChromeDirs {
|
|
3
|
+
readonly privateDir: string;
|
|
4
|
+
readonly runsDir: string;
|
|
5
|
+
readonly runDir: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function pickChromeDirs(tmpdir: string, userID: number, run: BrowserRun): ChromeDirs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function pickExitCodeAfterTests(testsExitCode: number, isAborted: boolean): number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type StopPhase = 'before-stop' | 'after-sigterm' | 'after-sigkill';
|
|
2
|
+
export interface StopObservation {
|
|
3
|
+
readonly phase: StopPhase;
|
|
4
|
+
readonly isGroupRunning: boolean;
|
|
5
|
+
readonly isPastDeadline: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type StopStep = {
|
|
8
|
+
readonly kind: 'done';
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: 'signal';
|
|
11
|
+
readonly signal: 'SIGTERM' | 'SIGKILL';
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'wait';
|
|
14
|
+
} | {
|
|
15
|
+
readonly kind: 'fail';
|
|
16
|
+
};
|
|
17
|
+
export declare function pickStopStep(observation: StopObservation): StopStep;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function probeHostProcess(pid: number): boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ProcessEntry } from './read-process-table.ts';
|
|
2
|
+
export interface ProcessProbeDependencies {
|
|
3
|
+
readonly signalProcess: (pid: number, signal: number) => void;
|
|
4
|
+
readonly readProcessTable: () => readonly ProcessEntry[] | null;
|
|
5
|
+
}
|
|
6
|
+
export declare function probeProcess(pid: number, dependencies: ProcessProbeDependencies): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LaneFiles } from './lane-files.ts';
|
|
2
|
+
import type { ProcessGroups } from './process-groups.ts';
|
|
3
|
+
export interface RunProbeOptions {
|
|
4
|
+
readonly files: Pick<LaneFiles, 'readDirNames' | 'removePath'>;
|
|
5
|
+
readonly probeProcess: (pid: number) => boolean;
|
|
6
|
+
readonly groups: Pick<ProcessGroups, 'probeGroup'>;
|
|
7
|
+
}
|
|
8
|
+
export declare const pendingRecordPrefix = "pending-";
|
|
9
|
+
export declare function probeRun(runID: string, groupsDir: string, options: RunProbeOptions): Promise<boolean>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Clock } from '../system-clock.ts';
|
|
2
|
+
export interface SpawnedProcess {
|
|
3
|
+
readonly pid: number;
|
|
4
|
+
readonly stdout: ReadableStream<Uint8Array> | null;
|
|
5
|
+
readonly exited: Promise<number>;
|
|
6
|
+
}
|
|
7
|
+
export interface SpawnOptions {
|
|
8
|
+
readonly cwd: string;
|
|
9
|
+
readonly environment: Readonly<Record<string, string | undefined>>;
|
|
10
|
+
readonly stdout: 'inherit' | 'pipe';
|
|
11
|
+
}
|
|
12
|
+
export interface ProcessRuntime extends Clock {
|
|
13
|
+
readonly spawn: (command: readonly string[], options: SpawnOptions) => SpawnedProcess;
|
|
14
|
+
}
|
|
15
|
+
export declare const processRuntime: ProcessRuntime;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function readDirNames(path: string): Promise<readonly string[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function removePath(path: string): Promise<void>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface PageResultIssue {
|
|
2
|
+
readonly message: string;
|
|
3
|
+
readonly path?: readonly (PropertyKey | {
|
|
4
|
+
readonly key: PropertyKey;
|
|
5
|
+
})[] | undefined;
|
|
6
|
+
}
|
|
7
|
+
type PageResult<Output> = {
|
|
8
|
+
readonly value: Output;
|
|
9
|
+
readonly issues?: undefined;
|
|
10
|
+
} | {
|
|
11
|
+
readonly issues: readonly PageResultIssue[];
|
|
12
|
+
};
|
|
13
|
+
export interface PageResultSchema<Input, Output> {
|
|
14
|
+
readonly '~standard': {
|
|
15
|
+
readonly validate: (value: unknown) => PageResult<Output> | Promise<PageResult<Output>>;
|
|
16
|
+
readonly types?: {
|
|
17
|
+
readonly input: Input;
|
|
18
|
+
readonly output: Output;
|
|
19
|
+
} | undefined;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export declare function runInPage<Argument, Input, Output>(view: Bun.WebView, pageFunction: (argument: Argument) => NoInfer<Input> | Promise<NoInfer<Input>>, argument: Argument, schema: PageResultSchema<Input, Output>): Promise<Output>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function shouldKeepRunFolders(error: unknown): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface BrowserStart {
|
|
2
|
+
readonly repoRoot: string;
|
|
3
|
+
readonly hostName: string;
|
|
4
|
+
readonly environment: Readonly<Record<string, string | undefined>>;
|
|
5
|
+
readonly profileName: string;
|
|
6
|
+
readonly readDirNames: (path: string) => Promise<readonly string[]>;
|
|
7
|
+
readonly openView: (profileDir: string) => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare function startBrowser(start: BrowserStart): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ProcessGroups } from './process-groups.ts';
|
|
2
|
+
import type { ProcessRuntime } from './process-runtime.ts';
|
|
3
|
+
export interface ProcessGroupOptions {
|
|
4
|
+
readonly cwd: string;
|
|
5
|
+
readonly environment: Readonly<Record<string, string | undefined>>;
|
|
6
|
+
readonly signal: AbortSignal;
|
|
7
|
+
readonly stdout: 'inherit' | 'pipe';
|
|
8
|
+
readonly stopDeadlineMs: number;
|
|
9
|
+
readonly groups: ProcessGroups;
|
|
10
|
+
readonly runtime: ProcessRuntime;
|
|
11
|
+
}
|
|
12
|
+
export interface StartedProcessGroup {
|
|
13
|
+
readonly pid: number;
|
|
14
|
+
readonly stdout: ReadableStream<Uint8Array> | null;
|
|
15
|
+
readonly exited: Promise<number>;
|
|
16
|
+
}
|
|
17
|
+
export declare function startProcessGroup(command: readonly string[], options: ProcessGroupOptions): StartedProcessGroup;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LaneHooks } from '../lane-hooks.ts';
|
|
2
|
+
type Environment = Readonly<Record<string, string | undefined>>;
|
|
3
|
+
export interface BrowserLaneWiring {
|
|
4
|
+
readonly repoRoot: string;
|
|
5
|
+
readonly runID: string;
|
|
6
|
+
readonly memory: string | null;
|
|
7
|
+
readonly dietScript: string;
|
|
8
|
+
readonly environment: Environment;
|
|
9
|
+
readonly signal: AbortSignal;
|
|
10
|
+
}
|
|
11
|
+
export declare function wireBrowserLaneHooks(wiring: BrowserLaneWiring): Promise<LaneHooks>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function buildDietCommand(dietScript: string, memory: string | null, command: readonly string[]): readonly string[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TestArgs } from './parse-test-args.ts';
|
|
2
|
+
import type { ResolvedLane, RigConfig } from './types.ts';
|
|
3
|
+
export type TestSelection = {
|
|
4
|
+
readonly kind: 'lane';
|
|
5
|
+
readonly flags: readonly string[];
|
|
6
|
+
} | {
|
|
7
|
+
readonly kind: 'empty';
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'files';
|
|
10
|
+
readonly files: readonly string[];
|
|
11
|
+
readonly flags: readonly string[];
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'none';
|
|
14
|
+
readonly paths: readonly string[];
|
|
15
|
+
};
|
|
16
|
+
export interface TestSelectionRequest {
|
|
17
|
+
readonly config: RigConfig;
|
|
18
|
+
readonly lane: Pick<ResolvedLane, 'name' | 'suffix'>;
|
|
19
|
+
readonly repoRoot: string;
|
|
20
|
+
readonly trackedFiles: readonly string[];
|
|
21
|
+
readonly args: TestArgs;
|
|
22
|
+
}
|
|
23
|
+
export declare function buildTestSelection(request: TestSelectionRequest): TestSelection;
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function findTimeoutArg(args: readonly string[]): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatNoMatchMessage(laneName: string, paths: readonly string[]): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatNoTestsMessage(laneName: string): string;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { defineRig } from './define-rig.ts';
|
|
2
|
+
export { parseRigConfig } from './parse-rig-config.ts';
|
|
3
|
+
export type { ParsedRigConfig } from './parse-rig-config.ts';
|
|
4
|
+
export { runInPage } from './browser/run-in-page.ts';
|
|
5
|
+
export type { PageResultSchema } from './browser/run-in-page.ts';
|
|
6
|
+
export type { LaneContext, LaneDeclaration, LaneStart, ResolvedLane, RigConfig, RigDeclaration, } from './types.ts';
|