@drift-ci/cli 1.0.0
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/LICENSE +21 -0
- package/README.md +28 -0
- package/dist/commands/baseline.d.ts +26 -0
- package/dist/commands/baseline.d.ts.map +1 -0
- package/dist/commands/baseline.js +227 -0
- package/dist/commands/baseline.js.map +1 -0
- package/dist/commands/compare.d.ts +16 -0
- package/dist/commands/compare.d.ts.map +1 -0
- package/dist/commands/compare.js +109 -0
- package/dist/commands/compare.js.map +1 -0
- package/dist/commands/config.d.ts +11 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +78 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/init.d.ts +10 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +80 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/run.d.ts +16 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +132 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/reporters/index.d.ts +11 -0
- package/dist/reporters/index.d.ts.map +1 -0
- package/dist/reporters/index.js +16 -0
- package/dist/reporters/index.js.map +1 -0
- package/dist/reporters/ink.d.ts +23 -0
- package/dist/reporters/ink.d.ts.map +1 -0
- package/dist/reporters/ink.js +89 -0
- package/dist/reporters/ink.js.map +1 -0
- package/dist/reporters/interface.d.ts +18 -0
- package/dist/reporters/interface.d.ts.map +1 -0
- package/dist/reporters/interface.js +2 -0
- package/dist/reporters/interface.js.map +1 -0
- package/dist/reporters/json.d.ts +36 -0
- package/dist/reporters/json.d.ts.map +1 -0
- package/dist/reporters/json.js +37 -0
- package/dist/reporters/json.js.map +1 -0
- package/dist/reporters/text.d.ts +14 -0
- package/dist/reporters/text.d.ts.map +1 -0
- package/dist/reporters/text.js +94 -0
- package/dist/reporters/text.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
const CONFIG_TEMPLATE = (provider, model) => `version: 1
|
|
4
|
+
provider:
|
|
5
|
+
name: ${provider}
|
|
6
|
+
model: ${model}
|
|
7
|
+
|
|
8
|
+
storage:
|
|
9
|
+
type: json-file
|
|
10
|
+
|
|
11
|
+
thresholds:
|
|
12
|
+
regression: 0.10
|
|
13
|
+
alert: 0.20
|
|
14
|
+
|
|
15
|
+
baseline:
|
|
16
|
+
source: branch
|
|
17
|
+
|
|
18
|
+
concurrency: 5
|
|
19
|
+
timeoutMs: 30000
|
|
20
|
+
|
|
21
|
+
suite: .drift/suite.yaml
|
|
22
|
+
`;
|
|
23
|
+
const SUITE_TEMPLATE = `version: 1
|
|
24
|
+
id: example
|
|
25
|
+
name: Example suite
|
|
26
|
+
description: Starter suite. Replace with your own cases.
|
|
27
|
+
evaluators:
|
|
28
|
+
- exact-match
|
|
29
|
+
cases:
|
|
30
|
+
- id: example-case
|
|
31
|
+
input: Say hello
|
|
32
|
+
expected: Hello
|
|
33
|
+
`;
|
|
34
|
+
const GITIGNORE_TEMPLATE = `# drift-ci ephemeral state — baselines at .drift/baseline/ ARE committed.
|
|
35
|
+
runs/
|
|
36
|
+
`;
|
|
37
|
+
/* c8 ignore start -- Commander wiring; covered by the CLI E2E in a subprocess. */
|
|
38
|
+
export function registerInitCommand(program) {
|
|
39
|
+
program
|
|
40
|
+
.command('init')
|
|
41
|
+
.description('Scaffold .drift/ with config, example suite, and .gitignore')
|
|
42
|
+
.option('--dir <path>', 'drift-ci directory', '.drift')
|
|
43
|
+
.option('--provider <name>', 'default provider', 'anthropic')
|
|
44
|
+
.option('--model <name>', 'default model', 'claude-sonnet-4-5')
|
|
45
|
+
.option('--force', 'overwrite existing files', false)
|
|
46
|
+
.action(async (opts) => {
|
|
47
|
+
executeInit(opts);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/* c8 ignore stop */
|
|
51
|
+
export function executeInit(opts) {
|
|
52
|
+
mkdirSync(opts.dir, { recursive: true });
|
|
53
|
+
mkdirSync(join(opts.dir, 'baseline'), { recursive: true });
|
|
54
|
+
const files = [
|
|
55
|
+
{ path: join(opts.dir, 'config.yaml'), content: CONFIG_TEMPLATE(opts.provider, opts.model) },
|
|
56
|
+
{ path: join(opts.dir, 'suite.yaml'), content: SUITE_TEMPLATE },
|
|
57
|
+
{ path: join(opts.dir, '.gitignore'), content: GITIGNORE_TEMPLATE },
|
|
58
|
+
];
|
|
59
|
+
const written = [];
|
|
60
|
+
const skipped = [];
|
|
61
|
+
for (const f of files) {
|
|
62
|
+
if (existsSync(f.path) && !opts.force) {
|
|
63
|
+
skipped.push(f.path);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
writeFileSync(f.path, f.content);
|
|
67
|
+
written.push(f.path);
|
|
68
|
+
}
|
|
69
|
+
for (const p of written)
|
|
70
|
+
console.log(` wrote ${p}`);
|
|
71
|
+
for (const p of skipped)
|
|
72
|
+
console.log(` skipped ${p} (already exists; pass --force to overwrite)`);
|
|
73
|
+
console.log('\nNext steps:');
|
|
74
|
+
console.log(' 1. Edit .drift/suite.yaml with your own cases.');
|
|
75
|
+
console.log(' 2. Set ANTHROPIC_API_KEY (or your provider equivalent).');
|
|
76
|
+
console.log(' 3. drift-ci run');
|
|
77
|
+
console.log(' 4. drift-ci baseline init # once scores look right');
|
|
78
|
+
console.log(' 5. git add .drift/baseline && git commit');
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,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EAAE,OAAO,EAAE,cAAc,EAAE;QAC/D,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE;KACpE,CAAC;IAEF,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACrB,SAAS;QACX,CAAC;QACD,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;QACjC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,OAAO;QAAE,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IACvD,KAAK,MAAM,CAAC,IAAI,OAAO;QAAE,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,8CAA8C,CAAC,CAAC;IAEnG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;IAChE,OAAO,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAC;IACzE,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACjC,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
import { type ReporterKind } from '../reporters/index.js';
|
|
3
|
+
export interface RunOptions {
|
|
4
|
+
config: string;
|
|
5
|
+
suite?: string;
|
|
6
|
+
provider?: string;
|
|
7
|
+
model?: string;
|
|
8
|
+
baselineDir: string;
|
|
9
|
+
runsDir: string;
|
|
10
|
+
noBaseline?: boolean;
|
|
11
|
+
reporter: ReporterKind;
|
|
12
|
+
junitPath?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function registerRunCommand(program: Command): void;
|
|
15
|
+
export declare function executeRun(positionalSuite: string | undefined, opts: RunOptions): Promise<number>;
|
|
16
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBzC,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1E,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+BzD;AAGD,wBAAsB,UAAU,CAC9B,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,MAAM,CAAC,CAiCjB"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, resolve } from 'node:path';
|
|
3
|
+
import { buildIngestContext, computeDeltas, createEvaluatorChain, createProvider, createStorage, FileBaselineStore, hasLLMJudge, judgeHashForProvider, loadConfigFromFile, loadSuiteFromFile, Runner, renderJUnitXml, } from '@drift-ci/core';
|
|
4
|
+
import { createReporter } from '../reporters/index.js';
|
|
5
|
+
/* c8 ignore start -- Commander wiring; covered by the CLI E2E in a subprocess. */
|
|
6
|
+
export function registerRunCommand(program) {
|
|
7
|
+
program
|
|
8
|
+
.command('run')
|
|
9
|
+
.description('Run a drift-ci suite')
|
|
10
|
+
.argument('[suite]', 'path to suite.yaml (overrides config)')
|
|
11
|
+
.option('--config <path>', 'drift-ci config path', '.drift/config.yaml')
|
|
12
|
+
.option('--suite <path>', 'suite yaml path (overrides config)')
|
|
13
|
+
.option('-p, --provider <name>', 'override provider from config')
|
|
14
|
+
.option('-m, --model <name>', 'override model from config')
|
|
15
|
+
.option('--baseline-dir <path>', 'baseline directory', '.drift/baseline')
|
|
16
|
+
.option('--runs-dir <path>', 'runs directory', '.drift/runs')
|
|
17
|
+
.option('--no-baseline', 'skip baseline comparison for this run')
|
|
18
|
+
.option('--reporter <kind>', 'output format: terminal (human) or json (tooling)', 'terminal')
|
|
19
|
+
.option('--junit-path <path>', 'also write a JUnit XML report to this path (suitable for GitLab CI / Jenkins)')
|
|
20
|
+
.action(async (positionalSuite, opts) => {
|
|
21
|
+
if (opts.reporter !== 'terminal' && opts.reporter !== 'json') {
|
|
22
|
+
console.error(`drift-ci: unknown --reporter '${opts.reporter}'. Use 'terminal' or 'json'.`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
const exitCode = await executeRun(positionalSuite, opts);
|
|
26
|
+
if (exitCode !== 0)
|
|
27
|
+
process.exit(exitCode);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/* c8 ignore stop */
|
|
31
|
+
export async function executeRun(positionalSuite, opts) {
|
|
32
|
+
const loaded = loadConfigFromFile(opts.config);
|
|
33
|
+
if (loaded.notice)
|
|
34
|
+
console.error(loaded.notice);
|
|
35
|
+
const suitePath = positionalSuite ?? opts.suite ?? loaded.config.suite;
|
|
36
|
+
const suite = loadSuiteFromFile(suitePath);
|
|
37
|
+
const provider = resolveProvider(loaded.config, opts);
|
|
38
|
+
// Precompute the HTTP ingest context up front so `http` storage can
|
|
39
|
+
// enrich POST /api/v1/runs with per-case suiteHash + judgeHash. No-op
|
|
40
|
+
// for other storage types.
|
|
41
|
+
const needsJudge = hasLLMJudge(suite.evaluators);
|
|
42
|
+
const judgeProvider = needsJudge
|
|
43
|
+
? resolveJudgeProvider(loaded.config, provider)
|
|
44
|
+
: undefined;
|
|
45
|
+
const judgeHash = judgeProvider
|
|
46
|
+
? judgeHashForProvider({ provider: judgeProvider })
|
|
47
|
+
: undefined;
|
|
48
|
+
const httpContext = loaded.config.storage?.type === 'http'
|
|
49
|
+
? buildIngestContext(suite, judgeHash)
|
|
50
|
+
: undefined;
|
|
51
|
+
const storage = await createStorage(loaded.config, {
|
|
52
|
+
runsDir: opts.runsDir,
|
|
53
|
+
httpContext,
|
|
54
|
+
});
|
|
55
|
+
try {
|
|
56
|
+
return await runWithStorage(suite, provider, judgeProvider, judgeHash, storage, loaded, opts);
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
await storage.close();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async function runWithStorage(suite, provider, judgeProvider, judgeHash, storage, loaded, opts) {
|
|
63
|
+
const specs = suite.evaluators ?? ['exact-match'];
|
|
64
|
+
const evaluatorForCase = (tc) => createEvaluatorChain(tc.evaluators ?? specs, {
|
|
65
|
+
testProvider: provider,
|
|
66
|
+
judgeProvider,
|
|
67
|
+
allowSelfBias: loaded.config.judge?.allowSelfBias,
|
|
68
|
+
case: tc,
|
|
69
|
+
});
|
|
70
|
+
const reporter = createReporter({
|
|
71
|
+
kind: opts.reporter,
|
|
72
|
+
stdoutIsTty: Boolean(process.stdout.isTTY),
|
|
73
|
+
});
|
|
74
|
+
await reporter.onRunStart({ suite, provider: provider.name });
|
|
75
|
+
const runner = new Runner({
|
|
76
|
+
provider,
|
|
77
|
+
evaluator: evaluatorForCase,
|
|
78
|
+
storage,
|
|
79
|
+
concurrency: loaded.config.concurrency,
|
|
80
|
+
timeoutMs: loaded.config.timeoutMs,
|
|
81
|
+
defaultThreshold: loaded.config.thresholds.regression,
|
|
82
|
+
onCaseComplete: (cr) => {
|
|
83
|
+
void reporter.onCaseComplete(cr);
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
const run = await runner.run(suite);
|
|
87
|
+
let deltas = null;
|
|
88
|
+
if (opts.noBaseline !== true) {
|
|
89
|
+
const baselineStore = new FileBaselineStore(opts.baselineDir);
|
|
90
|
+
deltas = await computeDeltas(run, suite, baselineStore, {
|
|
91
|
+
defaultThreshold: loaded.config.thresholds.regression,
|
|
92
|
+
judgeHash,
|
|
93
|
+
});
|
|
94
|
+
run.summary.regressions = deltas.regressions.length;
|
|
95
|
+
await storage.saveRun(run);
|
|
96
|
+
}
|
|
97
|
+
await reporter.onRunEnd({ suite, run, deltas, loaded });
|
|
98
|
+
if (opts.junitPath) {
|
|
99
|
+
const absolute = resolve(opts.junitPath);
|
|
100
|
+
const xml = renderJUnitXml({ run, suite, deltas });
|
|
101
|
+
mkdirSync(dirname(absolute), { recursive: true });
|
|
102
|
+
writeFileSync(absolute, xml);
|
|
103
|
+
console.error(`drift-ci: wrote JUnit report to ${absolute}`);
|
|
104
|
+
}
|
|
105
|
+
if (deltas && deltas.regressions.length > 0)
|
|
106
|
+
return 1;
|
|
107
|
+
return 0;
|
|
108
|
+
}
|
|
109
|
+
function resolveProvider(config, opts) {
|
|
110
|
+
const name = opts.provider ?? config.provider.name;
|
|
111
|
+
const model = opts.model ?? config.provider.model;
|
|
112
|
+
return createProvider({
|
|
113
|
+
name,
|
|
114
|
+
model,
|
|
115
|
+
baseUrl: config.provider.baseUrl,
|
|
116
|
+
region: config.provider.region,
|
|
117
|
+
mock: config.provider.mock,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function resolveJudgeProvider(config, fallback) {
|
|
121
|
+
const judge = config.judge;
|
|
122
|
+
if (!judge || (!judge.provider && !judge.model))
|
|
123
|
+
return fallback;
|
|
124
|
+
return createProvider({
|
|
125
|
+
name: judge.provider ?? config.provider.name,
|
|
126
|
+
model: judge.model ?? config.provider.model,
|
|
127
|
+
apiKey: judge.apiKey,
|
|
128
|
+
baseUrl: judge.baseUrl ?? config.provider.baseUrl,
|
|
129
|
+
region: config.provider.region,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,MAAM,EACN,cAAc,GAIf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,cAAc,EAAqB,MAAM,uBAAuB,CAAC;AAc1E,kFAAkF;AAClF,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IACjD,OAAO;SACJ,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,sBAAsB,CAAC;SACnC,QAAQ,CAAC,SAAS,EAAE,uCAAuC,CAAC;SAC5D,MAAM,CAAC,iBAAiB,EAAE,sBAAsB,EAAE,oBAAoB,CAAC;SACvE,MAAM,CAAC,gBAAgB,EAAE,oCAAoC,CAAC;SAC9D,MAAM,CAAC,uBAAuB,EAAE,+BAA+B,CAAC;SAChE,MAAM,CAAC,oBAAoB,EAAE,4BAA4B,CAAC;SAC1D,MAAM,CAAC,uBAAuB,EAAE,oBAAoB,EAAE,iBAAiB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C,KAAK,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACjE,OAAO,cAAc,CAAC;QACpB,IAAI,EAAE,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI;QAC5C,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK;QAC3C,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO;QACjD,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;KAC/B,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { registerRunCommand } from './commands/run.js';
|
|
4
|
+
import { registerBaselineCommand } from './commands/baseline.js';
|
|
5
|
+
import { registerInitCommand } from './commands/init.js';
|
|
6
|
+
import { registerConfigCommand } from './commands/config.js';
|
|
7
|
+
import { registerCompareCommand } from './commands/compare.js';
|
|
8
|
+
async function main(argv) {
|
|
9
|
+
const program = new Command();
|
|
10
|
+
program
|
|
11
|
+
.name('drift-ci')
|
|
12
|
+
.description('Behaviour regression testing for LLM applications')
|
|
13
|
+
.version('0.1.0');
|
|
14
|
+
registerInitCommand(program);
|
|
15
|
+
registerRunCommand(program);
|
|
16
|
+
registerBaselineCommand(program);
|
|
17
|
+
registerConfigCommand(program);
|
|
18
|
+
registerCompareCommand(program);
|
|
19
|
+
await program.parseAsync(argv);
|
|
20
|
+
}
|
|
21
|
+
main(process.argv).catch((err) => {
|
|
22
|
+
const code = err.code;
|
|
23
|
+
if (code === 'RUN_ABORTED_TRANSIENT') {
|
|
24
|
+
console.error(`\n${err.message}`);
|
|
25
|
+
process.exit(2);
|
|
26
|
+
}
|
|
27
|
+
console.error(err.message ?? err);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,KAAK,UAAU,IAAI,CAAC,IAAc;IAChC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,OAAO;SACJ,IAAI,CAAC,UAAU,CAAC;SAChB,WAAW,CAAC,mDAAmD,CAAC;SAChE,OAAO,CAAC,OAAO,CAAC,CAAC;IAEpB,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC7B,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC5B,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACjC,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAC/B,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAEhC,MAAM,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IAC/B,MAAM,IAAI,GAAI,GAAyB,CAAC,IAAI,CAAC;IAC7C,IAAI,IAAI,KAAK,uBAAuB,EAAE,CAAC;QACrC,OAAO,CAAC,KAAK,CAAC,KAAM,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,CAAC,KAAK,CAAE,GAAa,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC;IAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Reporter, ReporterKind } from './interface.js';
|
|
2
|
+
export * from './interface.js';
|
|
3
|
+
export { TextReporter, renderSummary } from './text.js';
|
|
4
|
+
export { JsonReporter, buildPayload, JSON_REPORTER_SCHEMA_VERSION } from './json.js';
|
|
5
|
+
export { InkReporter } from './ink.js';
|
|
6
|
+
export interface CreateReporterOptions {
|
|
7
|
+
kind: ReporterKind;
|
|
8
|
+
stdoutIsTty?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function createReporter(opts: CreateReporterOptions): Reporter;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reporters/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE7D,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,qBAAqB,GAAG,QAAQ,CAMpE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InkReporter } from './ink.js';
|
|
2
|
+
import { JsonReporter } from './json.js';
|
|
3
|
+
import { TextReporter } from './text.js';
|
|
4
|
+
export * from './interface.js';
|
|
5
|
+
export { TextReporter, renderSummary } from './text.js';
|
|
6
|
+
export { JsonReporter, buildPayload, JSON_REPORTER_SCHEMA_VERSION } from './json.js';
|
|
7
|
+
export { InkReporter } from './ink.js';
|
|
8
|
+
export function createReporter(opts) {
|
|
9
|
+
if (opts.kind === 'json') {
|
|
10
|
+
return new JsonReporter();
|
|
11
|
+
}
|
|
12
|
+
if (opts.stdoutIsTty)
|
|
13
|
+
return new InkReporter();
|
|
14
|
+
return new TextReporter();
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reporters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAOvC,MAAM,UAAU,cAAc,CAAC,IAA2B;IACxD,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACzB,OAAO,IAAI,YAAY,EAAE,CAAC;IAC5B,CAAC;IACD,IAAI,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,WAAW,EAAE,CAAC;IAC/C,OAAO,IAAI,YAAY,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Instance } from 'ink';
|
|
3
|
+
import type { CaseResult } from '@drift-ci/core';
|
|
4
|
+
import type { Reporter, RunEndContext, RunStartContext } from './interface.js';
|
|
5
|
+
export declare function statusColor(status: CaseResult['status']): string;
|
|
6
|
+
export type InkRenderFn = (element: React.ReactElement, options: {
|
|
7
|
+
stdout: NodeJS.WriteStream;
|
|
8
|
+
}) => Instance;
|
|
9
|
+
export interface InkReporterOptions {
|
|
10
|
+
out?: NodeJS.WriteStream;
|
|
11
|
+
render?: InkRenderFn;
|
|
12
|
+
}
|
|
13
|
+
export declare class InkReporter implements Reporter {
|
|
14
|
+
private instance?;
|
|
15
|
+
private readonly listeners;
|
|
16
|
+
private readonly stream;
|
|
17
|
+
private readonly renderFn;
|
|
18
|
+
constructor(opts?: InkReporterOptions);
|
|
19
|
+
onRunStart(ctx: RunStartContext): void;
|
|
20
|
+
onCaseComplete(result: CaseResult): void;
|
|
21
|
+
onRunEnd(ctx: RunEndContext): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ink.d.ts","sourceRoot":"","sources":["../../src/reporters/ink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAA6B,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAUxB,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,MAAM,CAehE;AAyCD,MAAM,MAAM,WAAW,GAAG,CACxB,OAAO,EAAE,KAAK,CAAC,YAAY,EAC3B,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC,WAAW,CAAA;CAAE,KACpC,QAAQ,CAAC;AAEd,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC;IACzB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,qBAAa,WAAY,YAAW,QAAQ;IAC1C,OAAO,CAAC,QAAQ,CAAC,CAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuC;IACjE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAc;gBAE3B,IAAI,GAAE,kBAAuB;IAKzC,UAAU,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IAiBtC,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAIlC,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAQlD"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { Box, Static, Text, render } from 'ink';
|
|
3
|
+
import { renderSummary } from './text.js';
|
|
4
|
+
export function statusColor(status) {
|
|
5
|
+
switch (status) {
|
|
6
|
+
case 'pass':
|
|
7
|
+
return 'green';
|
|
8
|
+
case 'evaluator-error':
|
|
9
|
+
return 'yellow';
|
|
10
|
+
case 'provider-rate-limit':
|
|
11
|
+
case 'provider-network':
|
|
12
|
+
case 'timeout':
|
|
13
|
+
return 'cyan';
|
|
14
|
+
case 'provider-auth':
|
|
15
|
+
return 'red';
|
|
16
|
+
default:
|
|
17
|
+
return 'white';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function CaseRow({ result }) {
|
|
21
|
+
const marker = result.status === 'pass' ? '\u2713' : '\u2717';
|
|
22
|
+
const score = Number.isNaN(result.score) ? '\u2014' : result.score.toFixed(3);
|
|
23
|
+
return (React.createElement(Box, null,
|
|
24
|
+
React.createElement(Text, { color: statusColor(result.status) },
|
|
25
|
+
marker,
|
|
26
|
+
" "),
|
|
27
|
+
React.createElement(Text, null,
|
|
28
|
+
result.caseId.padEnd(24),
|
|
29
|
+
" "),
|
|
30
|
+
React.createElement(Text, { color: "gray" },
|
|
31
|
+
result.status.padEnd(20),
|
|
32
|
+
" "),
|
|
33
|
+
React.createElement(Text, null,
|
|
34
|
+
"score=",
|
|
35
|
+
score,
|
|
36
|
+
" "),
|
|
37
|
+
React.createElement(Text, { color: "gray" },
|
|
38
|
+
result.latencyMs,
|
|
39
|
+
"ms")));
|
|
40
|
+
}
|
|
41
|
+
function LiveView({ total, subscribe }) {
|
|
42
|
+
const [completed, setCompleted] = useState([]);
|
|
43
|
+
useEffect(() => subscribe((cr) => setCompleted((prev) => [...prev, cr])), [subscribe]);
|
|
44
|
+
const remaining = total - completed.length;
|
|
45
|
+
return (React.createElement(Box, { flexDirection: "column" },
|
|
46
|
+
React.createElement(Static, { items: completed }, (cr) => React.createElement(CaseRow, { key: cr.caseId, result: cr })),
|
|
47
|
+
remaining > 0 && (React.createElement(Box, null,
|
|
48
|
+
React.createElement(Text, { color: "gray" },
|
|
49
|
+
' \u22EF ',
|
|
50
|
+
completed.length,
|
|
51
|
+
"/",
|
|
52
|
+
total,
|
|
53
|
+
" complete...")))));
|
|
54
|
+
}
|
|
55
|
+
export class InkReporter {
|
|
56
|
+
instance;
|
|
57
|
+
listeners = [];
|
|
58
|
+
stream;
|
|
59
|
+
renderFn;
|
|
60
|
+
constructor(opts = {}) {
|
|
61
|
+
this.stream = opts.out ?? process.stdout;
|
|
62
|
+
this.renderFn = opts.render ?? render;
|
|
63
|
+
}
|
|
64
|
+
onRunStart(ctx) {
|
|
65
|
+
this.stream.write(`drift-ci: running ${ctx.suite.cases.length} case(s) against ${ctx.provider}\n`);
|
|
66
|
+
const subscribe = (cb) => {
|
|
67
|
+
this.listeners.push(cb);
|
|
68
|
+
return () => {
|
|
69
|
+
const i = this.listeners.indexOf(cb);
|
|
70
|
+
if (i >= 0)
|
|
71
|
+
this.listeners.splice(i, 1);
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
this.instance = this.renderFn(React.createElement(LiveView, { total: ctx.suite.cases.length, subscribe: subscribe }), { stdout: this.stream });
|
|
75
|
+
}
|
|
76
|
+
onCaseComplete(result) {
|
|
77
|
+
for (const listener of this.listeners)
|
|
78
|
+
listener(result);
|
|
79
|
+
}
|
|
80
|
+
async onRunEnd(ctx) {
|
|
81
|
+
if (this.instance) {
|
|
82
|
+
this.instance.unmount();
|
|
83
|
+
await this.instance.waitUntilExit().catch(() => undefined);
|
|
84
|
+
this.instance = undefined;
|
|
85
|
+
}
|
|
86
|
+
renderSummary(ctx, (line) => this.stream.write(line + '\n'));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=ink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ink.js","sourceRoot":"","sources":["../../src/reporters/ink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAiB,MAAM,KAAK,CAAC;AAQ/D,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAS1C,MAAM,UAAU,WAAW,CAAC,MAA4B;IACtD,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,MAAM;YACT,OAAO,OAAO,CAAC;QACjB,KAAK,iBAAiB;YACpB,OAAO,QAAQ,CAAC;QAClB,KAAK,qBAAqB,CAAC;QAC3B,KAAK,kBAAkB,CAAC;QACxB,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC;QAChB,KAAK,eAAe;YAClB,OAAO,KAAK,CAAC;QACf;YACE,OAAO,OAAO,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,OAAO,CAAC,EAAE,MAAM,EAA0B;IACjD,MAAM,MAAM,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EAAE,SAAS,EAAE,SAAS,GAAI,EACjE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CACxB,CAAC;IACJ,CAAC;IAED,cAAc,CAAC,MAAkB;QAC/B,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS;YAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,GAAkB;QAC/B,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACxB,MAAM,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;YAC3D,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC5B,CAAC;QACD,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CaseResult, ConfigLoadResult, DeltaReport, RunResult, Suite } from '@drift-ci/core';
|
|
2
|
+
export interface RunStartContext {
|
|
3
|
+
suite: Suite;
|
|
4
|
+
provider: string;
|
|
5
|
+
}
|
|
6
|
+
export interface RunEndContext {
|
|
7
|
+
suite: Suite;
|
|
8
|
+
run: RunResult;
|
|
9
|
+
deltas: DeltaReport | null;
|
|
10
|
+
loaded: ConfigLoadResult;
|
|
11
|
+
}
|
|
12
|
+
export interface Reporter {
|
|
13
|
+
onRunStart(ctx: RunStartContext): void | Promise<void>;
|
|
14
|
+
onCaseComplete(result: CaseResult): void | Promise<void>;
|
|
15
|
+
onRunEnd(ctx: RunEndContext): void | Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export type ReporterKind = 'terminal' | 'json';
|
|
18
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/reporters/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,KAAK,EACN,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,SAAS,CAAC;IACf,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAAW,QAAQ;IACvB,UAAU,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/reporters/interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { CaseResult } from '@drift-ci/core';
|
|
2
|
+
import type { Reporter, RunEndContext, RunStartContext } from './interface.js';
|
|
3
|
+
export declare const JSON_REPORTER_SCHEMA_VERSION = 1;
|
|
4
|
+
export interface JsonReporterOptions {
|
|
5
|
+
out?: NodeJS.WritableStream;
|
|
6
|
+
}
|
|
7
|
+
export declare class JsonReporter implements Reporter {
|
|
8
|
+
private readonly out;
|
|
9
|
+
constructor(opts?: JsonReporterOptions);
|
|
10
|
+
onRunStart(_ctx: RunStartContext): void;
|
|
11
|
+
onCaseComplete(_result: CaseResult): void;
|
|
12
|
+
onRunEnd(ctx: RunEndContext): void;
|
|
13
|
+
}
|
|
14
|
+
export interface JsonReporterPayload {
|
|
15
|
+
schemaVersion: number;
|
|
16
|
+
suite: {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
run: {
|
|
21
|
+
id: string;
|
|
22
|
+
suiteId: string;
|
|
23
|
+
provider: string;
|
|
24
|
+
startedAt: string;
|
|
25
|
+
completedAt: string;
|
|
26
|
+
cases: unknown[];
|
|
27
|
+
summary: unknown;
|
|
28
|
+
};
|
|
29
|
+
deltas: unknown | null;
|
|
30
|
+
config: {
|
|
31
|
+
upgradedInMemory: boolean;
|
|
32
|
+
requestedVersion: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export declare function buildPayload(ctx: RunEndContext): JsonReporterPayload;
|
|
36
|
+
//# sourceMappingURL=json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/reporters/json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;CAC7B;AAED,qBAAa,YAAa,YAAW,QAAQ;IAC3C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAwB;gBAEhC,IAAI,GAAE,mBAAwB;IAI1C,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;IAEvC,cAAc,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;IAEzC,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI;CAGnC;AAED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,GAAG,EAAE;QACH,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,OAAO,EAAE,CAAC;QACjB,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE;QACN,gBAAgB,EAAE,OAAO,CAAC;QAC1B,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,mBAAmB,CAsBpE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { formatVersion } from '@drift-ci/core';
|
|
2
|
+
export const JSON_REPORTER_SCHEMA_VERSION = 1;
|
|
3
|
+
export class JsonReporter {
|
|
4
|
+
out;
|
|
5
|
+
constructor(opts = {}) {
|
|
6
|
+
this.out = opts.out ?? process.stdout;
|
|
7
|
+
}
|
|
8
|
+
onRunStart(_ctx) { }
|
|
9
|
+
onCaseComplete(_result) { }
|
|
10
|
+
onRunEnd(ctx) {
|
|
11
|
+
this.out.write(JSON.stringify(buildPayload(ctx), null, 2) + '\n');
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function buildPayload(ctx) {
|
|
15
|
+
return {
|
|
16
|
+
schemaVersion: JSON_REPORTER_SCHEMA_VERSION,
|
|
17
|
+
suite: { id: ctx.suite.id, name: ctx.suite.name },
|
|
18
|
+
run: {
|
|
19
|
+
id: ctx.run.id,
|
|
20
|
+
suiteId: ctx.run.suiteId,
|
|
21
|
+
provider: ctx.run.provider,
|
|
22
|
+
startedAt: ctx.run.startedAt.toISOString(),
|
|
23
|
+
completedAt: ctx.run.completedAt.toISOString(),
|
|
24
|
+
cases: ctx.run.cases.map((c) => ({
|
|
25
|
+
...c,
|
|
26
|
+
score: Number.isNaN(c.score) ? null : c.score,
|
|
27
|
+
})),
|
|
28
|
+
summary: ctx.run.summary,
|
|
29
|
+
},
|
|
30
|
+
deltas: ctx.deltas,
|
|
31
|
+
config: {
|
|
32
|
+
upgradedInMemory: ctx.loaded.upgradedInMemory,
|
|
33
|
+
requestedVersion: formatVersion(ctx.loaded.requestedVersion),
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/reporters/json.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAQ/C,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAM9C,MAAM,OAAO,YAAY;IACN,GAAG,CAAwB;IAE5C,YAAY,OAA4B,EAAE;QACxC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IACxC,CAAC;IAED,UAAU,CAAC,IAAqB,IAAS,CAAC;IAE1C,cAAc,CAAC,OAAmB,IAAS,CAAC;IAE5C,QAAQ,CAAC,GAAkB;QACzB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACpE,CAAC;CACF;AAqBD,MAAM,UAAU,YAAY,CAAC,GAAkB;IAC7C,OAAO;QACL,aAAa,EAAE,4BAA4B;QAC3C,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE;QACjD,GAAG,EAAE;YACH,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE;YACd,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO;YACxB,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,QAAQ;YAC1B,SAAS,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE;YAC1C,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,EAAE;YAC9C,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC/B,GAAG,CAAC;gBACJ,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK;aAC9C,CAAC,CAAC;YACH,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO;SACzB;QACD,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,MAAM,EAAE;YACN,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB;YAC7C,gBAAgB,EAAE,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC;SAC7D;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CaseResult } from '@drift-ci/core';
|
|
2
|
+
import type { Reporter, RunEndContext, RunStartContext } from './interface.js';
|
|
3
|
+
export interface TextReporterOptions {
|
|
4
|
+
out?: NodeJS.WritableStream;
|
|
5
|
+
}
|
|
6
|
+
export declare class TextReporter implements Reporter {
|
|
7
|
+
private readonly out;
|
|
8
|
+
constructor(opts?: TextReporterOptions);
|
|
9
|
+
onRunStart(_ctx: RunStartContext): void;
|
|
10
|
+
onCaseComplete(_result: CaseResult): void;
|
|
11
|
+
onRunEnd(ctx: RunEndContext): void;
|
|
12
|
+
}
|
|
13
|
+
export declare function renderSummary({ suite, run, deltas, loaded }: RunEndContext, emit: (line: string) => void): void;
|
|
14
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/reporters/text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;CAC7B;AAED,qBAAa,YAAa,YAAW,QAAQ;IAC3C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAwB;gBAEhC,IAAI,GAAE,mBAAwB;IAI1C,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;IAEvC,cAAc,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;IAEzC,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI;CAGnC;AAED,wBAAgB,aAAa,CAC3B,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,aAAa,EAC7C,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC3B,IAAI,CAoEN"}
|