@zgeoff/rig 0.0.4 → 0.0.6

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.
Files changed (66) hide show
  1. package/README.md +14 -2
  2. package/dist/bench/define-bench.d.ts +24 -0
  3. package/dist/bench/format-benchmark-result.d.ts +3 -0
  4. package/dist/bench/parse-bench-definition.d.ts +9 -0
  5. package/dist/bench/pick-median.d.ts +1 -0
  6. package/dist/bench/run-benchmark.d.ts +7 -0
  7. package/dist/bench.d.ts +2 -0
  8. package/dist/build-init-scripts.d.ts +1 -1
  9. package/dist/build-program-environment.d.ts +3 -0
  10. package/dist/build-program-lane-hooks.d.ts +3 -0
  11. package/dist/build-test-selection.d.ts +1 -0
  12. package/dist/collect-bench-files.d.ts +1 -0
  13. package/dist/collect-eval-files.d.ts +1 -0
  14. package/dist/collect-unprogrammed-e2e-dirs.d.ts +2 -0
  15. package/dist/e2e.d.ts +2 -0
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +83 -3
  18. package/dist/is-command-name.d.ts +1 -1
  19. package/dist/pick-e2e-dirs.d.ts +1 -1
  20. package/dist/probe-workspace-repo.d.ts +1 -0
  21. package/dist/programs/resolve-program.d.ts +12 -0
  22. package/dist/programs/resolve-repo-root.d.ts +1 -0
  23. package/dist/run-bench-file.d.ts +1 -0
  24. package/dist/run-bench.d.ts +10 -0
  25. package/dist/run-cli.d.ts +3 -1
  26. package/dist/run-eval.d.ts +8 -0
  27. package/dist/run-init.d.ts +1 -0
  28. package/dist/run-lane.d.ts +4 -5
  29. package/dist/run-program-builds.d.ts +7 -0
  30. package/dist/run-unit-tests.d.ts +1 -0
  31. package/dist/types.d.ts +13 -0
  32. package/package.json +17 -5
  33. package/src/bench/define-bench.ts +78 -0
  34. package/src/bench/format-benchmark-result.ts +11 -0
  35. package/src/bench/parse-bench-definition.ts +57 -0
  36. package/src/bench/pick-median.ts +10 -0
  37. package/src/bench/run-benchmark.ts +38 -0
  38. package/src/bench.ts +2 -0
  39. package/src/build-init-scripts.ts +17 -3
  40. package/src/build-program-environment.ts +20 -0
  41. package/src/build-program-lane-hooks.ts +24 -0
  42. package/src/build-test-selection.ts +8 -7
  43. package/src/build-unit-command.ts +15 -1
  44. package/src/cli.ts +4 -0
  45. package/src/collect-bench-files.ts +23 -0
  46. package/src/collect-eval-files.ts +5 -0
  47. package/src/collect-unprogrammed-e2e-dirs.ts +21 -0
  48. package/src/define-rig.ts +65 -2
  49. package/src/e2e.ts +2 -0
  50. package/src/index.ts +2 -0
  51. package/src/is-command-name.ts +1 -1
  52. package/src/parse-rig-config.ts +64 -2
  53. package/src/pick-e2e-dirs.ts +8 -5
  54. package/src/probe-workspace-repo.ts +15 -0
  55. package/src/programs/resolve-program.ts +92 -0
  56. package/src/programs/resolve-repo-root.ts +18 -0
  57. package/src/run-bench-file.ts +25 -0
  58. package/src/run-bench.ts +132 -0
  59. package/src/run-cli.ts +8 -1
  60. package/src/run-eval.ts +74 -0
  61. package/src/run-init.ts +6 -1
  62. package/src/run-lane.ts +39 -10
  63. package/src/run-program-builds.ts +35 -0
  64. package/src/run-unit-tests.ts +4 -1
  65. package/src/run-unit.ts +1 -0
  66. package/src/types.ts +30 -0
@@ -0,0 +1,132 @@
1
+ import { basename, join } from 'node:path';
2
+ import { pickExitCodeAfterTests } from './browser/pick-exit-code-after-tests.ts';
3
+ import { buildDietCommand } from './build-diet-command.ts';
4
+ import { buildProgramLaneHooks } from './build-program-lane-hooks.ts';
5
+ import { collectBenchFiles } from './collect-bench-files.ts';
6
+ import type { LaneHooks } from './lane-hooks.ts';
7
+ import { makeRepoLaneHooks } from './make-repo-lane-hooks.ts';
8
+ import { runLaneHooks } from './run-lane-hooks.ts';
9
+ import type { ProgramBuildDeps } from './run-program-builds.ts';
10
+ import { runProgramBuilds } from './run-program-builds.ts';
11
+ import type { RigConfig, RigRun } from './types.ts';
12
+
13
+ export interface BenchDeps extends ProgramBuildDeps {
14
+ readonly dietScript: string;
15
+
16
+ // The script that runs one bench file.
17
+ readonly benchScript: string;
18
+
19
+ readonly probeWorkspaceRepo: (repoRoot: string) => Promise<boolean>;
20
+
21
+ readonly readTrackedFiles: (repoRoot: string) => Promise<readonly string[]>;
22
+
23
+ readonly importModule: (path: string) => Promise<unknown>;
24
+ }
25
+
26
+ // Builds each program once, as `rig e2e` does, then runs each bench file in a process of its own,
27
+ // between the start and stop hooks of the bench lane when the config names one. The bench process
28
+ // gets RIG_PROGRAM_<NAME> for each program, so resolveProgram gives the built artifact.
29
+ export async function runBench(
30
+ args: readonly string[],
31
+ config: RigConfig,
32
+ run: RigRun,
33
+ deps: BenchDeps,
34
+ ): Promise<number> {
35
+ if (args.length > 1) {
36
+ deps.output.err('rig bench: takes at most one benchmark name\n');
37
+
38
+ return 2;
39
+ }
40
+
41
+ const isWorkspaceRepo = await deps.probeWorkspaceRepo(run.repoRoot);
42
+ const trackedFiles = await deps.readTrackedFiles(run.repoRoot);
43
+
44
+ const benchFiles = collectBenchFiles(trackedFiles, isWorkspaceRepo);
45
+ const [name] = args;
46
+
47
+ const files =
48
+ name === undefined ? benchFiles : benchFiles.filter((file) => toBenchName(file) === name);
49
+
50
+ if (files.length === 0) {
51
+ return reportNoBenchmark(name, benchFiles, deps);
52
+ }
53
+
54
+ const buildExitCode = await runProgramBuilds(config.programs, run, deps);
55
+
56
+ if (buildExitCode !== 0) {
57
+ return buildExitCode;
58
+ }
59
+
60
+ const hooks = buildProgramLaneHooks(
61
+ makeBenchHooks(config, run, deps),
62
+ run.repoRoot,
63
+ config.programs,
64
+ );
65
+
66
+ const exitCode = await runLaneHooks(files, hooks);
67
+
68
+ return pickExitCodeAfterTests(exitCode, run.signal.aborted);
69
+ }
70
+
71
+ function toBenchName(file: string): string {
72
+ return basename(file, '.bench.ts');
73
+ }
74
+
75
+ function reportNoBenchmark(
76
+ name: string | undefined,
77
+ benchFiles: readonly string[],
78
+ deps: BenchDeps,
79
+ ): number {
80
+ if (name === undefined) {
81
+ deps.output.out('rig: the repo has no benchmarks\n');
82
+
83
+ return 0;
84
+ }
85
+
86
+ const names = benchFiles.map((file) => toBenchName(file)).join(', ');
87
+
88
+ deps.output.err(`rig bench: no benchmark named "${name}"; the benchmarks are ${names}\n`);
89
+
90
+ return 1;
91
+ }
92
+
93
+ function makeBenchHooks(config: RigConfig, run: RigRun, deps: BenchDeps): LaneHooks {
94
+ const lane = config.lanes.find((candidate) => candidate.name === config.benchLane);
95
+
96
+ const laneHooks: Pick<LaneHooks, 'start' | 'stop'> =
97
+ lane === undefined
98
+ ? {
99
+ start: () => Promise.resolve({ kind: 'proceed', environment: run.environment }),
100
+ stop: () => Promise.resolve(),
101
+ }
102
+ : makeRepoLaneHooks({
103
+ context: { repoRoot: run.repoRoot, lane, runID: run.runID, environment: run.environment },
104
+ dietScript: deps.dietScript,
105
+ parallel: 1,
106
+ signal: run.signal,
107
+ importModule: deps.importModule,
108
+ runCommand: deps.runCommand,
109
+ });
110
+
111
+ return {
112
+ ...laneHooks,
113
+ run: async (files, environment) => {
114
+ let exitCode = 0;
115
+
116
+ for (const file of files) {
117
+ const fileExitCode = await deps.runCommand(
118
+ buildDietCommand(deps.dietScript, lane?.memory ?? null, [
119
+ 'bun',
120
+ deps.benchScript,
121
+ join(run.repoRoot, file),
122
+ ]),
123
+ { cwd: run.repoRoot, environment, signal: run.signal },
124
+ );
125
+
126
+ exitCode = fileExitCode === 0 ? exitCode : 1;
127
+ }
128
+
129
+ return exitCode;
130
+ },
131
+ };
132
+ }
package/src/run-cli.ts CHANGED
@@ -2,6 +2,10 @@ import { match } from 'ts-pattern';
2
2
  import { findTimeoutArg } from './find-timeout-arg.ts';
3
3
  import { commandNames, isCommandName } from './is-command-name.ts';
4
4
  import { readCLIArgs } from './read-cli-args.ts';
5
+ import { runBench } from './run-bench.ts';
6
+ import type { BenchDeps } from './run-bench.ts';
7
+ import { runEval } from './run-eval.ts';
8
+ import type { EvalDeps } from './run-eval.ts';
5
9
  import { runInit } from './run-init.ts';
6
10
  import type { InitDeps } from './run-init.ts';
7
11
  import type { LaneDeps } from './run-lane.ts';
@@ -12,7 +16,8 @@ import { runUnit } from './run-unit.ts';
12
16
  import type { UnitDeps } from './run-unit.ts';
13
17
  import type { RigConfig, RigRun } from './types.ts';
14
18
 
15
- export interface CLIDeps extends LaneDeps, UnitDeps, RelatedTestDeps, InitDeps {
19
+ export interface CLIDeps
20
+ extends LaneDeps, UnitDeps, RelatedTestDeps, InitDeps, BenchDeps, EvalDeps {
16
21
  readonly readConfig: (repoRoot: string) => Promise<RigConfig>;
17
22
  }
18
23
 
@@ -31,6 +36,8 @@ export async function runCLI(argv: readonly string[], run: RigRun, deps: CLIDeps
31
36
 
32
37
  if (isCommandName(command)) {
33
38
  return match(command)
39
+ .with('bench', () => runBench(args.extraArgs, config, run, deps))
40
+ .with('eval', () => runEval(args.extraArgs, run, deps))
34
41
  .with('init', () => runInit(run.repoRoot, config, deps))
35
42
  .with('related', () => runRelatedTests(args.extraArgs, config, run, deps))
36
43
  .exhaustive();
@@ -0,0 +1,74 @@
1
+ import { basename, dirname } from 'node:path';
2
+ import { collectEvalFiles } from './collect-eval-files.ts';
3
+ import type { CommandOptions } from './run-command.ts';
4
+ import type { RigOutput, RigRun } from './types.ts';
5
+
6
+ export interface EvalDeps {
7
+ readonly output: RigOutput;
8
+
9
+ readonly readTrackedFiles: (repoRoot: string) => Promise<readonly string[]>;
10
+
11
+ readonly runCommand: (command: readonly string[], options: CommandOptions) => Promise<number>;
12
+ }
13
+
14
+ // Runs each evaluation script with bun from the repo root, one after another, and fails when any
15
+ // one fails.
16
+ export async function runEval(
17
+ args: readonly string[],
18
+ run: RigRun,
19
+ deps: EvalDeps,
20
+ ): Promise<number> {
21
+ if (args.length > 1) {
22
+ deps.output.err('rig eval: takes at most one evaluation name\n');
23
+
24
+ return 2;
25
+ }
26
+
27
+ const trackedFiles = await deps.readTrackedFiles(run.repoRoot);
28
+
29
+ const evalFiles = collectEvalFiles(trackedFiles);
30
+ const [name] = args;
31
+
32
+ const files =
33
+ name === undefined ? evalFiles : evalFiles.filter((file) => toEvalName(file) === name);
34
+
35
+ if (files.length === 0) {
36
+ return reportNoEval(name, evalFiles, deps);
37
+ }
38
+
39
+ let exitCode = 0;
40
+
41
+ for (const file of files) {
42
+ const fileExitCode = await deps.runCommand(['bun', file], {
43
+ cwd: run.repoRoot,
44
+ environment: run.environment,
45
+ signal: run.signal,
46
+ });
47
+
48
+ exitCode = fileExitCode === 0 ? exitCode : 1;
49
+ }
50
+
51
+ return run.signal.aborted ? 1 : exitCode;
52
+ }
53
+
54
+ function toEvalName(file: string): string {
55
+ return basename(dirname(file));
56
+ }
57
+
58
+ function reportNoEval(
59
+ name: string | undefined,
60
+ evalFiles: readonly string[],
61
+ deps: EvalDeps,
62
+ ): number {
63
+ if (name === undefined) {
64
+ deps.output.out('rig: the repo has no evaluations\n');
65
+
66
+ return 0;
67
+ }
68
+
69
+ const names = evalFiles.map((file) => toEvalName(file)).join(', ');
70
+
71
+ deps.output.err(`rig eval: no evaluation named "${name}"; the evaluations are ${names}\n`);
72
+
73
+ return 1;
74
+ }
package/src/run-init.ts CHANGED
@@ -5,6 +5,8 @@ import type { InitFiles } from './init-files.ts';
5
5
  import type { RigConfig, RigOutput } from './types.ts';
6
6
 
7
7
  export interface InitDeps {
8
+ readonly probeWorkspaceRepo: (repoRoot: string) => Promise<boolean>;
9
+
8
10
  readonly readTrackedFiles: (repoRoot: string) => Promise<readonly string[]>;
9
11
 
10
12
  readonly initFiles: InitFiles;
@@ -36,7 +38,10 @@ export async function runInit(
36
38
  const trackedFiles = await deps.readTrackedFiles(repoRoot);
37
39
 
38
40
  const oldScripts = readScripts(manifest['scripts']);
39
- const newScripts = buildInitScripts(oldScripts, config, trackedFiles);
41
+
42
+ const isWorkspaceRepo = await deps.probeWorkspaceRepo(repoRoot);
43
+
44
+ const newScripts = buildInitScripts(oldScripts, config, trackedFiles, isWorkspaceRepo);
40
45
 
41
46
  if (JSON.stringify(oldScripts) !== JSON.stringify(newScripts)) {
42
47
  await deps.initFiles.writeText(
package/src/run-lane.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { match } from 'ts-pattern';
2
2
  import { pickExitCodeAfterTests } from './browser/pick-exit-code-after-tests.ts';
3
3
  import type { BrowserLaneWiring } from './browser/wire-browser-lane-hooks.ts';
4
+ import { buildProgramLaneHooks } from './build-program-lane-hooks.ts';
4
5
  import type { TestSelection } from './build-test-selection.ts';
5
6
  import { buildTestSelection } from './build-test-selection.ts';
7
+ import { collectUnprogrammedE2EDirs } from './collect-unprogrammed-e2e-dirs.ts';
6
8
  import { formatNoMatchMessage } from './format-no-match-message.ts';
7
9
  import { formatNoTestsMessage } from './format-no-tests-message.ts';
8
10
  import type { LaneHooks } from './lane-hooks.ts';
@@ -10,21 +12,20 @@ import { makeRepoLaneHooks } from './make-repo-lane-hooks.ts';
10
12
  import { parseTestArgs } from './parse-test-args.ts';
11
13
  import { pickE2EDirs } from './pick-e2e-dirs.ts';
12
14
  import { pickLaneSelection } from './pick-lane-selection.ts';
13
- import type { CommandOptions } from './run-command.ts';
14
15
  import { runLaneHooks } from './run-lane-hooks.ts';
15
- import type { ResolvedLane, RigConfig, RigOutput, RigRun } from './types.ts';
16
+ import type { ProgramBuildDeps } from './run-program-builds.ts';
17
+ import { runProgramBuilds } from './run-program-builds.ts';
18
+ import type { ResolvedLane, RigConfig, RigRun } from './types.ts';
16
19
 
17
- export interface LaneDeps {
20
+ export interface LaneDeps extends ProgramBuildDeps {
18
21
  readonly dietScript: string;
19
22
 
20
- readonly output: RigOutput;
23
+ readonly probeWorkspaceRepo: (repoRoot: string) => Promise<boolean>;
21
24
 
22
25
  readonly readTrackedFiles: (repoRoot: string) => Promise<readonly string[]>;
23
26
 
24
27
  readonly importModule: (path: string) => Promise<unknown>;
25
28
 
26
- readonly runCommand: (command: readonly string[], options: CommandOptions) => Promise<number>;
27
-
28
29
  readonly wireBrowserLaneHooks: (wiring: BrowserLaneWiring) => Promise<LaneHooks>;
29
30
  }
30
31
 
@@ -42,11 +43,13 @@ export async function runLane(request: LaneRequest, run: RigRun, deps: LaneDeps)
42
43
  const lane = request.lane;
43
44
 
44
45
  const trackedFiles = await deps.readTrackedFiles(run.repoRoot);
46
+ const isWorkspaceRepo = await deps.probeWorkspaceRepo(run.repoRoot);
45
47
 
46
48
  const selection = buildTestSelection({
47
49
  config: request.config,
48
50
  lane,
49
51
  repoRoot: run.repoRoot,
52
+ isWorkspaceRepo,
50
53
  trackedFiles,
51
54
  args: parseTestArgs(request.extraArgs),
52
55
  });
@@ -63,10 +66,32 @@ export async function runLane(request: LaneRequest, run: RigRun, deps: LaneDeps)
63
66
  return 0;
64
67
  }
65
68
 
66
- const testArgs = pickLaneTestArgs(request.config, lane, selection, trackedFiles);
69
+ const e2eDirs = pickE2EDirs(trackedFiles, isWorkspaceRepo);
70
+ const testArgs = pickLaneTestArgs(request.config, lane, selection, e2eDirs);
71
+ const programs = lane.name === 'e2e' ? request.config.programs : {};
72
+
73
+ if (lane.name === 'e2e') {
74
+ const unprogrammed = collectUnprogrammedE2EDirs(e2eDirs, programs);
75
+
76
+ if (unprogrammed.length > 0) {
77
+ deps.output.err(formatUnprogrammedMessage(unprogrammed));
78
+
79
+ return 2;
80
+ }
81
+ }
82
+
83
+ const buildExitCode = await runProgramBuilds(programs, run, deps);
84
+
85
+ if (buildExitCode !== 0) {
86
+ return buildExitCode;
87
+ }
67
88
 
68
89
  const hooks = await wireLaneHooks(lane, run, deps);
69
- const exitCode = await runLaneHooks(testArgs, hooks);
90
+
91
+ const exitCode = await runLaneHooks(
92
+ testArgs,
93
+ buildProgramLaneHooks(hooks, run.repoRoot, programs),
94
+ );
70
95
 
71
96
  // A signal that arrives while the stop hook cleans up still fails the run.
72
97
  return pickExitCodeAfterTests(exitCode, run.signal.aborted);
@@ -76,7 +101,7 @@ function pickLaneTestArgs(
76
101
  config: RigConfig,
77
102
  lane: ResolvedLane,
78
103
  selection: Extract<TestSelection, { kind: 'files' | 'lane' }>,
79
- trackedFiles: readonly string[],
104
+ e2eDirs: readonly string[],
80
105
  ): readonly string[] {
81
106
  const timeoutArg = `--timeout=${lane.limitMs}`;
82
107
 
@@ -84,7 +109,7 @@ function pickLaneTestArgs(
84
109
  .with({ kind: 'files' }, (files) => [timeoutArg, ...files.files, ...files.flags])
85
110
  .with({ kind: 'lane' }, (laneRun) => [
86
111
  timeoutArg,
87
- ...pickLaneSelection(lane, pickE2EDirs(trackedFiles)),
112
+ ...pickLaneSelection(lane, e2eDirs),
88
113
  ...pickOtherLaneIgnoreArgs(config, lane),
89
114
  ...laneRun.flags,
90
115
  ])
@@ -107,6 +132,10 @@ function pickOtherLaneIgnoreArgs(config: RigConfig, lane: ResolvedLane): readonl
107
132
  );
108
133
  }
109
134
 
135
+ function formatUnprogrammedMessage(directories: readonly string[]): string {
136
+ return `rig: ${directories.join(', ')} has no program to run: declare the program in rig.config.ts programs, with the package it belongs to\n`;
137
+ }
138
+
110
139
  function wireLaneHooks(lane: ResolvedLane, run: RigRun, deps: LaneDeps): Promise<LaneHooks> {
111
140
  if (lane.name === 'browser') {
112
141
  return deps.wireBrowserLaneHooks({
@@ -0,0 +1,35 @@
1
+ import { join } from 'node:path';
2
+ import type { CommandOptions } from './run-command.ts';
3
+ import type { ProgramDeclaration, RigOutput, RigRun } from './types.ts';
4
+
5
+ export interface ProgramBuildDeps {
6
+ readonly output: RigOutput;
7
+
8
+ readonly runCommand: (command: readonly string[], options: CommandOptions) => Promise<number>;
9
+ }
10
+
11
+ // Builds each program once, in its package folder, and stops at the first failure. The build's own
12
+ // output goes to the terminal as it runs.
13
+ export async function runProgramBuilds(
14
+ programs: Readonly<Record<string, ProgramDeclaration>>,
15
+ run: RigRun,
16
+ deps: ProgramBuildDeps,
17
+ ): Promise<number> {
18
+ for (const [name, program] of Object.entries(programs)) {
19
+ const exitCode = await deps.runCommand(['bash', '-c', program.build], {
20
+ cwd: join(run.repoRoot, program.package),
21
+ environment: run.environment,
22
+ signal: run.signal,
23
+ });
24
+
25
+ if (exitCode !== 0) {
26
+ deps.output.err(
27
+ `rig: the build of program "${name}" failed with exit code ${exitCode}: ${program.build}\n`,
28
+ );
29
+
30
+ return exitCode;
31
+ }
32
+ }
33
+
34
+ return 0;
35
+ }
@@ -13,6 +13,8 @@ export interface UnitRequest {
13
13
  export interface UnitRunDeps {
14
14
  readonly dietScript: string;
15
15
 
16
+ readonly probeWorkspaceRepo: (repoRoot: string) => Promise<boolean>;
17
+
16
18
  readonly readTrackedFiles: (repoRoot: string) => Promise<readonly string[]>;
17
19
 
18
20
  readonly runCommand: (command: readonly string[], options: CommandOptions) => Promise<number>;
@@ -27,8 +29,9 @@ export async function runUnitTests(
27
29
  deps: UnitRunDeps,
28
30
  ): Promise<number> {
29
31
  const trackedFiles = await deps.readTrackedFiles(run.repoRoot);
32
+ const isWorkspaceRepo = await deps.probeWorkspaceRepo(run.repoRoot);
30
33
 
31
- const e2eDirs = pickE2EDirs(trackedFiles);
34
+ const e2eDirs = pickE2EDirs(trackedFiles, isWorkspaceRepo);
32
35
  const memory = config.lanes.find((lane) => lane.name === 'unit')?.memory ?? null;
33
36
 
34
37
  return deps.runCommand(
package/src/run-unit.ts CHANGED
@@ -38,6 +38,7 @@ export async function runUnit(
38
38
  config,
39
39
  lane: unitLane,
40
40
  repoRoot: run.repoRoot,
41
+ isWorkspaceRepo: await deps.probeWorkspaceRepo(run.repoRoot),
41
42
  trackedFiles: await deps.readTrackedFiles(run.repoRoot),
42
43
  args: parseTestArgs(extraArgs),
43
44
  });
package/src/types.ts CHANGED
@@ -14,8 +14,33 @@ export interface LaneDeclaration {
14
14
  readonly stop?: string;
15
15
  }
16
16
 
17
+ // A program that the e2e tests run: the entry file, the command that builds it, and the file the
18
+ // build leaves.
19
+ export interface ProgramDeclaration {
20
+ // The package folder, relative to the repo root.
21
+ readonly package: string;
22
+
23
+ // The entry file, relative to the package.
24
+ readonly source: string;
25
+
26
+ // A shell command that rig runs from the package folder.
27
+ readonly build: string;
28
+
29
+ // The built file, relative to the package.
30
+ readonly artifact: string;
31
+ }
32
+
33
+ export interface BenchDeclaration {
34
+ // The lane whose start and stop hooks surround the benchmarks.
35
+ readonly lane?: string;
36
+ }
37
+
17
38
  export interface RigDeclaration {
18
39
  readonly lanes?: Readonly<Record<string, LaneDeclaration>>;
40
+
41
+ readonly programs?: Readonly<Record<string, ProgramDeclaration>>;
42
+
43
+ readonly bench?: BenchDeclaration;
19
44
  }
20
45
 
21
46
  export type LaneParallelism = 'workers' | number;
@@ -40,6 +65,11 @@ export interface ResolvedLane {
40
65
 
41
66
  export interface RigConfig {
42
67
  readonly lanes: readonly ResolvedLane[];
68
+
69
+ readonly programs: Readonly<Record<string, ProgramDeclaration>>;
70
+
71
+ // The lane whose hooks surround the benchmarks, or null.
72
+ readonly benchLane: string | null;
43
73
  }
44
74
 
45
75
  export interface LaneContext {