main 98594d0

answers.mjs RawHistoryFolder

1// SPDX-License-Identifier: MIT
2//
3// Generates testdata/runner.json.gz: what the C# runner's expression engine
4// (actions/runner, src/Sdk/DTExpressions2) answers on the expressions of
5// testdata/oracle.json.gz. Needs the .NET SDK and a clone of actions/runner:
6//
7//   dotnet build -c Release expr/gen/runner -p:RunnerSrc=<runner>/src/Sdk
8//   RUNNER_CLONE=<runner clone> node expr/gen/runner/answers.mjs | gzip -9 -n > expr/testdata/runner.json.gz
9
10import { readFileSync, writeFileSync, mkdtempSync } from "node:fs";
11import { tmpdir } from "node:os";
12import { join } from "node:path";
13import { runDriver, here, checkEnvironment } from "./env.mjs";
14import { gunzipSync } from "node:zlib";
15
16const env = checkEnvironment(process.argv[2]);
17
18const oracle = JSON.parse(gunzipSync(readFileSync(join(here, "../../testdata/oracle.json.gz"))));
19const dir = mkdtempSync(join(tmpdir(), "runner-answers-"));
20const input = join(dir, "in.json");
21writeFileSync(input, JSON.stringify({ contexts: oracle.contexts, cases: oracle.cases.map(c => ({ e: c.e })) }));
22const out = runDriver([input]).split("\n").filter(Boolean);
23if (out.length !== oracle.cases.length) throw new Error(`got ${out.length} answers for ${oracle.cases.length} cases`);
24const cases = out.map((l, i) => {
25  const r = JSON.parse(l);
26  return { e: oracle.cases[i].e, ...r };
27});
28process.stdout.write(JSON.stringify({
29  reference: { source: "actions/runner src/Sdk/DTExpressions2 (Expressions2)", commit: env.commit, runtime: env.runtime },
30  cases,
31}));

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 3

↑↓ moveenter openesc close