werkmeister-core 0.95.0 → 0.95.1
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/CHANGELOG.md +7 -0
- package/README.md +4 -0
- package/dist/fixture_workspace.d.ts +2 -0
- package/dist/fixture_workspace.js +4 -2
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# sandbox-core
|
|
2
2
|
|
|
3
|
+
## 0.95.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f9c23df: werkmeister-core's test runner takes `COVERAGE=1` (and `pnpm run test:coverage`, which builds with source maps first): Node's built-in coverage, with lcov reports mapped back to `src/` in `$COVERAGE_DIR` (default `coverage/`). Off by default; the README's "Test coverage" section has the caveats (SW-756).
|
|
8
|
+
- 54c43fa: `with-fixture-workspace --gate` takes `--pr-line '<key>: <value>'` (repeatable), written into the seeded PR file as is, so a test can seed an unquoted value that `--pr-field` would quote, e.g. `--pr-line 'skip_release: no changeset: test-only'`, which the gate refuses with "Quote values that contain a colon". The keys are `--pr-field`'s but `status` (`--pr-field status=` already writes that line as is); one line, and it needs `--gate` (exit 2 otherwise). In-process fixtures take `prLines` (SW-851). Rerun `werkmeister workspace init` to regenerate the script's usage line.
|
|
9
|
+
|
|
3
10
|
## 0.95.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -31,6 +31,10 @@ for (const ws of workspaces) {
|
|
|
31
31
|
|
|
32
32
|
The daemon's operations are reached with `callTool`. The full API is at [werkmeister.io/sdk](https://werkmeister.io/sdk/).
|
|
33
33
|
|
|
34
|
+
## Test coverage (contributors)
|
|
35
|
+
|
|
36
|
+
In a werkmeister checkout, `pnpm --filter werkmeister-core run test:coverage` builds `dist/` with source maps and runs the suite with Node's built-in coverage (Node 22.5 or later). It prints a coverage table after the usual output and writes lcov reports, mapped back to `src/*.ts`, to `$COVERAGE_DIR` (default `coverage/`, git-ignored): `lcov-isolated.info` and `lcov-shared.info`, one per `node --test` run. Off by default: `pnpm test` is unchanged. A CI shard (`pnpm test N/M`) reports only its own files, and the `test/*.smoke.mjs` smokes run as plain `node`, so they are not counted. The run costs about 40% more wall time and 35% more CPU (77 s against 55 s in a 3-CPU container). Run `pnpm build` afterwards to rebuild `dist/` without source maps.
|
|
37
|
+
|
|
34
38
|
## Licence
|
|
35
39
|
|
|
36
40
|
Apache-2.0. See `LICENSE` and `NOTICE`.
|
|
@@ -40,6 +40,8 @@ export interface FixtureOptions {
|
|
|
40
40
|
issue?: string;
|
|
41
41
|
/** Extra front matter for each seeded PR file, e.g. `{ skip_release: "tests only" }` (SW-514); `status` replaces `approved`, verbatim (SW-549). */
|
|
42
42
|
prFields?: Record<string, string>;
|
|
43
|
+
/** Raw front matter lines added to each seeded PR file after `prFields`, unquoted, e.g. `skip_release: no changeset: test-only` (SW-851). */
|
|
44
|
+
prLines?: string[];
|
|
43
45
|
/** Every ports.yaml slot leased to `other-N`, each with its own folder so heldSlots keeps it, for no-slot paths (SW-634). */
|
|
44
46
|
slotsFull?: boolean;
|
|
45
47
|
/** The first repo's `.werkmeister/services.yaml` on the branch, committed over a base fragment on main (`fragment`, else the default registry's), so the gate's fragment row compares the two (SW-664). */
|
|
@@ -157,7 +157,9 @@ ${githubProject(repos.map((r) => r.name))}${opts.config ? YAML.stringify(opts.co
|
|
|
157
157
|
}
|
|
158
158
|
// status goes in verbatim, so a brief can try the forms people write, comments included (SW-549).
|
|
159
159
|
const { status = "approved", ...prFields } = opts.prFields ?? {};
|
|
160
|
-
|
|
160
|
+
// prLines go in as written, so a test can seed what YAML.stringify would quote (SW-851).
|
|
161
|
+
const extra = (Object.keys(prFields).length ? YAML.stringify(prFields) : "") +
|
|
162
|
+
(opts.prLines ?? []).map((l) => `${l}\n`).join("");
|
|
161
163
|
let applyFragmentChange;
|
|
162
164
|
for (const { name, change } of repos) {
|
|
163
165
|
// Ends in owner/repo.git so originSlug matches the PR file's repo: (SW-381).
|
|
@@ -328,7 +330,7 @@ const SCRIPT = `#!/bin/sh
|
|
|
328
330
|
# Generated by \`werkmeister workspace init\` (SW-292); rerun it to regenerate.
|
|
329
331
|
# Runs this workspace's own built werkmeister CLI against a seeded fixture workspace, removed on exit:
|
|
330
332
|
# temp HOME and registry, a local bare origin, logging fakes for gh and docker, dead Docker and daemon.
|
|
331
|
-
# usage: with-fixture-workspace [--no-wait] [--gate] [--bare] [--daemon] [--exec-runs] [--merged] [--behind] [--slots-full] [--running <file>] [--queue <feature>[,<feature>]... | --queue <feature>:<waitedMin>[:<service>,...]]... [--issue <ref>] [--pr-field <key>=<value>]... [--workspace <file>] [--config <file>] [--services <file>] [--fragment <file>] [--change <path>] [--change-base <file>] [--change-branch <file>] [--fragment-change <file>] [--stale-compose] [--print <file>]... <werkmeister args> [--then <werkmeister args>]...
|
|
333
|
+
# usage: with-fixture-workspace [--no-wait] [--gate] [--bare] [--daemon] [--exec-runs] [--merged] [--behind] [--slots-full] [--running <file>] [--queue <feature>[,<feature>]... | --queue <feature>:<waitedMin>[:<service>,...]]... [--issue <ref>] [--pr-field <key>=<value>]... [--pr-line '<key>: <value>']... [--workspace <file>] [--config <file>] [--services <file>] [--fragment <file>] [--change <path>] [--change-base <file>] [--change-branch <file>] [--fragment-change <file>] [--stale-compose] [--print <file>]... <werkmeister args> [--then <werkmeister args>]...
|
|
332
334
|
# It only ever runs that CLI, never another command, so one allow rule can cover it (SW-172, SW-231);
|
|
333
335
|
# --exec-runs, given first, also runs the registry's rows on the host, so the workspace asks before it (SW-473).
|
|
334
336
|
ws=$(cd "$(dirname "$0")/../.." && pwd -P) || exit 1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "werkmeister-core",
|
|
3
|
-
"version": "0.95.
|
|
3
|
+
"version": "0.95.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "werkmeister's shared library. Its public API is werkmeister-core/sdk; every other entry point is internal.",
|
|
@@ -137,6 +137,7 @@
|
|
|
137
137
|
"docs:sdk": "node ../../scripts/format-examples.mjs --check && typedoc --options typedoc.sdk.json",
|
|
138
138
|
"test": "sh ./run-tests.sh",
|
|
139
139
|
"test:changed": "node test-changed.mjs",
|
|
140
|
+
"test:coverage": "tsc --sourceMap && COVERAGE=1 sh ./run-tests.sh",
|
|
140
141
|
"test:no-match": "sh ../../scripts/require-temp-home.sh && unset GIT_DIR GIT_WORK_TREE GIT_COMMON_DIR && WERKMEISTER_GH_BIN=$PWD/test/no-gh.sh node --test --test-concurrency=3 --test-name-pattern=__nomatch__ test/*.test.mjs"
|
|
141
142
|
}
|
|
142
143
|
}
|