@hominis/fireforge 0.44.2 → 0.44.3

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.
@@ -0,0 +1,92 @@
1
+ <!-- SPDX-License-Identifier: EUPL-1.2 -->
2
+
3
+ # Running tests
4
+
5
+ `fireforge test` wraps `mach test`. Most of what follows exists because
6
+ mach's own defaults are wrong for a fork that must know exactly what ran.
7
+
8
+ ## Scope is exact
9
+
10
+ `fireforge test <directory>` runs exactly that directory: FireForge enumerates
11
+ the directory's test files and passes the explicit file list to mach in one
12
+ invocation, so mach's prefix-based path matching cannot silently sweep in
13
+ sibling directories sharing the name prefix. Excluded siblings are echoed with
14
+ their test-file counts.
15
+
16
+ Multiple path arguments run as **sequential shards** by default — one browser
17
+ instance per argument, with a directory argument keeping its files together —
18
+ announced with a notice, since isolated instances do not exercise
19
+ cross-argument state. `--no-shard` restores one combined invocation.
20
+
21
+ ## Pathless runs must choose a mode
22
+
23
+ - `--auto` forwards mach's own auto-selection.
24
+ - `--doctor` runs the Marionette preflight only.
25
+ - `--canary [path]` runs one short browser-chrome canary
26
+ (`test.canaryPath` / `test.canaryTimeoutSeconds` in `fireforge.json`
27
+ provide defaults).
28
+
29
+ ## Build freshness
30
+
31
+ When packageable engine files changed since the last successful FireForge
32
+ build, `test` fails before launching stale artifacts. Use `--build` to
33
+ refresh, or `--allow-stale-build` only for intentional out-of-band rebuilds.
34
+
35
+ `--build-only` packages mixed-harness paths once, then each harness half can
36
+ run without `--build`. `--extend-coverage` safely retains prior scoped
37
+ coverage instead of replacing it; it is refused when the build anchor moved
38
+ (engine HEAD, `engine/mozconfig`, or a previously fingerprinted packageable
39
+ file).
40
+
41
+ ## Resilience
42
+
43
+ - Recognized harness crashes retry up to `--harness-retries <n>` times
44
+ (default 2).
45
+ - `--kill-stale-marionette` terminates recognized stale browsers.
46
+ - `--perf-samples <path>` publishes a perf-sample artifact path to the
47
+ harness (exported as `<BINARYNAME>_PERF_SAMPLE_JSON`).
48
+
49
+ ## The verdict line
50
+
51
+ Every test run ends with one machine-readable line:
52
+
53
+ ```
54
+ FIREFORGE-VERDICT: PASS|FAIL reason=… [log=<path>]
55
+ ```
56
+
57
+ Automation should branch on it rather than on the raw process code, and must
58
+ treat a **missing** verdict as failure. The closed set of `reason=` values and
59
+ the stdout rules around the line are in
60
+ [`machine-output.md`](machine-output.md); `log=` names the run's own complete
61
+ output, specified in [`run-logs.md`](run-logs.md).
62
+
63
+ Exit code 14 (`INCONCLUSIVE`) is not red: it means `engine/` moved while the
64
+ harness ran and the result was thrown away. Exit 15 (`LOCK_TIMEOUT`) means the
65
+ run never started. See [`exit-codes.md`](exit-codes.md).
66
+
67
+ ## Output verbosity
68
+
69
+ mozbuild quiets terminal output to warnings and errors when it detects a
70
+ coding agent (`is_running_under_coding_agent()` keys on `CLAUDECODE`). The
71
+ build half of that quieting is useful; the test half removes `TEST_START` and
72
+ console INFO — the lines a hang or stall diagnosis needs, and the ones
73
+ FireForge's own classifier reads (`Ran N checks`, `Unexpected results:`,
74
+ `TEST-UNEXPECTED-*`), so suppression pushes a run toward `reason=no-tests`.
75
+
76
+ `fireforge test --full-output` unsets the marker for **test dispatches only**;
77
+ the build path stays quiet. It is opt-in rather than automatic because it
78
+ changes how much a third party prints, and an operator who wants the quieting
79
+ should keep it.
80
+
81
+ ## Concurrency
82
+
83
+ A test run holds the engine-session lock and snapshots the engine git
84
+ generation before and after the harness run, failing the verdict as invalid if
85
+ the tree changed mid-run. To verify beside a busy primary checkout instead,
86
+ use a [verification tree](verification-trees.md).
87
+
88
+ ## Dev-build gotcha
89
+
90
+ In dev builds, files under `obj-*/dist/bin` may be symlinks back into the
91
+ source tree (notably prefs), so edit source prefs directly and keep a backup
92
+ before bisection experiments.
@@ -0,0 +1,48 @@
1
+ <!-- SPDX-License-Identifier: EUPL-1.2 -->
2
+
3
+ # Verification trees
4
+
5
+ For concurrent read-mostly verification beside a busy primary checkout,
6
+ `fireforge tree create <name>` snapshots the project — applied engine tree
7
+ included, `obj-*` excluded — into `.fireforge/trees/<name>` using filesystem
8
+ copy-on-write (APFS `clonefile`, btrfs/XFS reflink). Roughly 3 s for a 156 MB
9
+ applied browser tree.
10
+
11
+ ```bash
12
+ npx fireforge tree create verify
13
+ npx fireforge tree exec verify -- npx fireforge lint --per-patch
14
+ npx fireforge tree list
15
+ npx fireforge tree remove verify
16
+ ```
17
+
18
+ ## What works inside a tree
19
+
20
+ Read-only commands and `export`/`re-export` dry runs. **Mutations are
21
+ refused** — a default-deny verdict table, not a blocklist, so a newly added
22
+ mutating command is refused until it is classified. That is invariant 7 in
23
+ [`lifecycle-invariants.md`](lifecycle-invariants.md).
24
+
25
+ `--with-objdir` adds a safely relocated build, which makes build-less `test`
26
+ possible inside the tree.
27
+
28
+ ## Lifecycle
29
+
30
+ - `tree list` reports staleness (`--json`; see
31
+ [`machine-output.md`](machine-output.md)).
32
+ - `tree remove` deletes, refusing an active lock and a lock of unknown
33
+ ownership.
34
+ - `tree exec <name> -- <cmd>` runs a command inside a tree, sealing its stdout
35
+ so exactly one verdict line survives, last.
36
+
37
+ ## Filesystems without CoW
38
+
39
+ Refused unless `--force-copy` explicitly accepts a full physical copy. The
40
+ refusal is the point: a silent full copy of an applied browser tree is not
41
+ the operation anyone asked for.
42
+
43
+ ## The tree marker
44
+
45
+ `.fireforge/tree.json` is tri-state: absent (primary), valid (snapshot), or
46
+ **corrupt**. A corrupt marker refuses every command, because an unreadable
47
+ marker leaves it unknown whether this is a snapshot or the primary tree.
48
+ `--ignore-corrupt-tree-marker` overrides that deliberately.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hominis/fireforge",
3
- "version": "0.44.2",
3
+ "version": "0.44.3",
4
4
  "description": "FireForge — a build tool for customizing Firefox",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -48,6 +48,7 @@
48
48
  "!dist/**/test-utils/",
49
49
  "!dist/**/*.js.map",
50
50
  "templates/",
51
+ "docs/",
51
52
  "README.md",
52
53
  "CHANGELOG.md",
53
54
  "LICENSE.md"