nukadoko 0.5.0 → 0.7.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +553 -3
- data/README.ja.md +22 -6
- data/README.md +13 -7
- data/docs/ci.ja.md +542 -0
- data/docs/ci.md +635 -0
- data/docs/commands.ja.md +1524 -0
- data/docs/commands.md +1281 -0
- data/docs/engines.json +19 -0
- data/docs/execution-events.ja.md +336 -0
- data/docs/execution-events.md +423 -0
- data/docs/glossary.json +1348 -0
- data/docs/guide.ja.md +733 -0
- data/docs/guide.md +815 -0
- data/docs/intent.ja.md +133 -0
- data/docs/intent.md +156 -0
- data/docs/layout.ja.md +442 -0
- data/docs/layout.md +399 -0
- data/docs/releasing.ja.md +186 -0
- data/docs/releasing.md +237 -0
- data/docs/ruby/reference.ja.md +302 -0
- data/docs/ruby/reference.md +368 -0
- data/docs/spec.ja.md +8916 -0
- data/docs/spec.md +11250 -0
- data/docs/tutorial.ja.md +451 -0
- data/docs/tutorial.md +458 -0
- data/docs/typescript/adopting.ja.md +231 -0
- data/docs/typescript/adopting.md +251 -0
- data/docs/typescript/doors.ja.md +301 -0
- data/docs/typescript/doors.md +329 -0
- data/docs/typescript/migration-playwright-test.ja.md +189 -0
- data/docs/typescript/migration-playwright-test.md +212 -0
- data/docs/typescript/migration.ja.md +391 -0
- data/docs/typescript/migration.md +505 -0
- data/docs/typescript/reference.ja.md +176 -0
- data/docs/typescript/reference.md +197 -0
- data/docs/typescript/upgrading.ja.md +1774 -0
- data/docs/typescript/upgrading.md +2224 -0
- data/docs/web-app.ja.md +627 -0
- data/docs/web-app.md +659 -0
- data/docs/writing-scenarios.ja.md +544 -0
- data/docs/writing-scenarios.md +563 -0
- data/lib/nukadoko/base.rb +12 -5
- data/lib/nukadoko/changed_files.rb +95 -0
- data/lib/nukadoko/check.rb +459 -51
- data/lib/nukadoko/claim_drops.rb +271 -0
- data/lib/nukadoko/claim_line.rb +24 -4
- data/lib/nukadoko/claim_rules.rb +143 -1
- data/lib/nukadoko/claim_sides.rb +157 -9
- data/lib/nukadoko/cli.rb +403 -50
- data/lib/nukadoko/codes.json +246 -21
- data/lib/nukadoko/codes.rb +21 -4
- data/lib/nukadoko/command.rb +120 -13
- data/lib/nukadoko/command_help.rb +128 -0
- data/lib/nukadoko/compat.rb +469 -0
- data/lib/nukadoko/criteria.rb +1 -1
- data/lib/nukadoko/definition.rb +157 -7
- data/lib/nukadoko/error_frames.rb +6 -3
- data/lib/nukadoko/events/count.rb +146 -0
- data/lib/nukadoko/events/counted.rb +114 -0
- data/lib/nukadoko/events/format.rb +257 -0
- data/lib/nukadoko/events/lists.rb +154 -0
- data/lib/nukadoko/events/path.rb +285 -0
- data/lib/nukadoko/events/read.rb +284 -0
- data/lib/nukadoko/events/reader.rb +490 -0
- data/lib/nukadoko/events/selection.rb +252 -0
- data/lib/nukadoko/events/tally.rb +438 -0
- data/lib/nukadoko/features.rb +2 -2
- data/lib/nukadoko/fixtures.rb +160 -35
- data/lib/nukadoko/http_recording.rb +6 -2
- data/lib/nukadoko/intent.rb +364 -0
- data/lib/nukadoko/intent_file.rb +81 -0
- data/lib/nukadoko/intent_view.rb +190 -0
- data/lib/nukadoko/js_json.rb +2 -1
- data/lib/nukadoko/judge.rb +2 -2
- data/lib/nukadoko/judgment_file.rb +22 -1
- data/lib/nukadoko/judgments.rb +33 -3
- data/lib/nukadoko/measure_mcp.rb +202 -0
- data/lib/nukadoko/parts.rb +8 -2
- data/lib/nukadoko/path_view.rb +252 -0
- data/lib/nukadoko/place_rows.rb +161 -0
- data/lib/nukadoko/program.rb +1265 -51
- data/lib/nukadoko/program_log.rb +122 -0
- data/lib/nukadoko/program_shape.rb +385 -0
- data/lib/nukadoko/project_fixtures.rb +43 -10
- data/lib/nukadoko/project_program.rb +5 -4
- data/lib/nukadoko/repeated_prefix.rb +310 -0
- data/lib/nukadoko/report_run.rb +3 -3
- data/lib/nukadoko/run.rb +1156 -159
- data/lib/nukadoko/run_record.rb +70 -46
- data/lib/nukadoko/scaffold.rb +24 -6
- data/lib/nukadoko/schema.rb +15 -2
- data/lib/nukadoko/secrets.rb +55 -5
- data/lib/nukadoko/states.rb +478 -0
- data/lib/nukadoko/step.rb +71 -2
- data/lib/nukadoko/step_fixtures.rb +52 -3
- data/lib/nukadoko/summary.rb +803 -30
- data/lib/nukadoko/table.rb +4 -2
- data/lib/nukadoko/text_fit.rb +20 -7
- data/lib/nukadoko/trace.rb +152 -45
- data/lib/nukadoko/tree_passes.rb +95 -33
- data/lib/nukadoko/underneath.rb +311 -0
- data/lib/nukadoko/verdict.rb +18 -1
- data/lib/nukadoko/version.rb +1 -1
- data/lib/nukadoko/vocabulary.rb +166 -23
- data/lib/nukadoko/walk.rb +2 -2
- data/lib/nukadoko/walk_step.rb +1 -1
- data/lib/nukadoko.rb +23 -0
- data/llms.txt +42 -35
- data/sig/generated/nukadoko/base.rbs +4 -4
- data/sig/generated/nukadoko/changed_files.rbs +42 -0
- data/sig/generated/nukadoko/check.rbs +147 -10
- data/sig/generated/nukadoko/claim_drops.rbs +135 -0
- data/sig/generated/nukadoko/claim_line.rbs +11 -0
- data/sig/generated/nukadoko/claim_rules.rbs +49 -4
- data/sig/generated/nukadoko/claim_sides.rbs +63 -12
- data/sig/generated/nukadoko/cli.rbs +80 -7
- data/sig/generated/nukadoko/codes.rbs +19 -4
- data/sig/generated/nukadoko/command.rbs +68 -1
- data/sig/generated/nukadoko/command_help.rbs +18 -0
- data/sig/generated/nukadoko/compat.rbs +392 -0
- data/sig/generated/nukadoko/criteria.rbs +1 -1
- data/sig/generated/nukadoko/definition.rbs +50 -0
- data/sig/generated/nukadoko/error_frames.rbs +1 -1
- data/sig/generated/nukadoko/events/count.rbs +69 -0
- data/sig/generated/nukadoko/events/counted.rbs +70 -0
- data/sig/generated/nukadoko/events/format.rbs +163 -0
- data/sig/generated/nukadoko/events/lists.rbs +47 -0
- data/sig/generated/nukadoko/events/path.rbs +161 -0
- data/sig/generated/nukadoko/events/read.rbs +109 -0
- data/sig/generated/nukadoko/events/reader.rbs +226 -0
- data/sig/generated/nukadoko/events/selection.rbs +100 -0
- data/sig/generated/nukadoko/events/tally.rbs +227 -0
- data/sig/generated/nukadoko/features.rbs +6 -4
- data/sig/generated/nukadoko/fixtures.rbs +67 -11
- data/sig/generated/nukadoko/http_recording.rbs +1 -1
- data/sig/generated/nukadoko/intent.rbs +132 -0
- data/sig/generated/nukadoko/intent_file.rbs +46 -0
- data/sig/generated/nukadoko/intent_view.rbs +69 -0
- data/sig/generated/nukadoko/judgment_file.rbs +7 -1
- data/sig/generated/nukadoko/judgments.rbs +10 -0
- data/sig/generated/nukadoko/measure_mcp.rbs +104 -0
- data/sig/generated/nukadoko/parts.rbs +2 -2
- data/sig/generated/nukadoko/path_view.rbs +105 -0
- data/sig/generated/nukadoko/place_rows.rbs +43 -0
- data/sig/generated/nukadoko/program.rbs +627 -23
- data/sig/generated/nukadoko/program_log.rbs +67 -0
- data/sig/generated/nukadoko/program_shape.rbs +147 -0
- data/sig/generated/nukadoko/project_fixtures.rbs +16 -3
- data/sig/generated/nukadoko/project_program.rbs +2 -1
- data/sig/generated/nukadoko/repeated_prefix.rbs +172 -0
- data/sig/generated/nukadoko/report_run.rbs +1 -1
- data/sig/generated/nukadoko/run.rbs +286 -41
- data/sig/generated/nukadoko/run_record.rbs +20 -12
- data/sig/generated/nukadoko/scaffold.rbs +3 -0
- data/sig/generated/nukadoko/schema.rbs +5 -0
- data/sig/generated/nukadoko/secrets.rbs +26 -3
- data/sig/generated/nukadoko/states.rbs +214 -0
- data/sig/generated/nukadoko/step.rbs +58 -1
- data/sig/generated/nukadoko/step_fixtures.rbs +39 -0
- data/sig/generated/nukadoko/summary.rbs +256 -2
- data/sig/generated/nukadoko/table.rbs +3 -2
- data/sig/generated/nukadoko/trace.rbs +108 -33
- data/sig/generated/nukadoko/tree_passes.rbs +36 -8
- data/sig/generated/nukadoko/underneath.rbs +141 -0
- data/sig/generated/nukadoko/verdict.rbs +8 -0
- data/sig/generated/nukadoko/vocabulary.rbs +45 -6
- data/skills/nukadoko/SKILL.md +18 -18
- data/skills/nukadoko/references/checking-steps.md +16 -83
- data/skills/nukadoko/references/diagnosing.md +6 -6
- data/skills/nukadoko/references/done.md +22 -0
- data/skills/nukadoko/references/evidence.md +19 -6
- data/skills/nukadoko/references/exploring.md +22 -7
- data/skills/nukadoko/references/fixtures.md +12 -32
- data/skills/nukadoko/references/judgments.md +18 -0
- data/skills/nukadoko/references/maintenance.md +1 -1
- data/skills/nukadoko/references/merge-risk.md +1 -1
- data/skills/nukadoko/references/parts.md +46 -23
- data/skills/nukadoko/references/{perturbed-worlds.md → perturbed-systems.md} +30 -12
- data/skills/nukadoko/references/program.md +168 -169
- data/skills/nukadoko/references/reviewing.md +20 -20
- data/skills/nukadoko/references/ruby/checking-steps.md +106 -0
- data/skills/nukadoko/references/ruby/examples/cli.md +212 -0
- data/skills/nukadoko/references/ruby/fixtures.md +34 -0
- data/skills/nukadoko/references/ruby/program.md +112 -0
- data/skills/nukadoko/references/ruby/step-files.md +115 -0
- data/skills/nukadoko/references/running.md +34 -34
- data/skills/nukadoko/references/scenario-rules.md +7 -6
- data/skills/nukadoko/references/states.md +7 -1
- data/skills/nukadoko/references/step-files.md +41 -120
- data/skills/nukadoko/references/typescript/checking-steps.md +129 -0
- data/skills/nukadoko/references/{examples → typescript/examples}/cli.md +1 -1
- data/skills/nukadoko/references/{examples → typescript/examples}/http-api.md +6 -6
- data/skills/nukadoko/references/{examples → typescript/examples}/workflow.md +1 -1
- data/skills/nukadoko/references/typescript/fixtures.md +56 -0
- data/skills/nukadoko/references/typescript/program.md +111 -0
- data/skills/nukadoko/references/typescript/step-files.md +104 -0
- data/skills/nukadoko/references/verdicts.md +10 -10
- data/skills/nukadoko/references/writing-steps.md +67 -67
- data/skills/nukadoko/references/writing-the-feature.md +1 -1
- data/skills/nukadoko-verification/SKILL.md +13 -8
- metadata +103 -7
- data/skills/nukadoko/references/ruby.md +0 -80
|
@@ -0,0 +1,2224 @@
|
|
|
1
|
+
# Upgrading nukadoko
|
|
2
|
+
|
|
3
|
+
For a project already running on nukadoko, moving to a newer release.
|
|
4
|
+
Coming from a cucumber-js suite instead? See
|
|
5
|
+
[docs/typescript/migration.md](migration.md); that door and this upgrade are
|
|
6
|
+
different questions for different readers.
|
|
7
|
+
|
|
8
|
+
## How to upgrade, every time
|
|
9
|
+
|
|
10
|
+
This part does not change release to release.
|
|
11
|
+
|
|
12
|
+
- **The completion condition is `nuka check` reporting green, not `tsc`
|
|
13
|
+
passing.** A step can stay completely type-valid under `tsc` and still be
|
|
14
|
+
refused by `nuka check`: a step's `run()` that takes an undestructured
|
|
15
|
+
first argument, for one, typechecks fine but is rejected outright, since
|
|
16
|
+
`check` reads a step's static shape more strictly than the type system
|
|
17
|
+
does. `tsc` clean is not the signal to stop upgrading; `nuka check` green
|
|
18
|
+
is.
|
|
19
|
+
- **`nuka steps` and `nuka describe` still read the vocabulary mid-upgrade.**
|
|
20
|
+
One step file that fails to import does not take either command down:
|
|
21
|
+
what discovery could still read comes back, and what it could not is
|
|
22
|
+
named on stderr and in `import_failures` (`nuka steps --json`'s top level
|
|
23
|
+
is `{ schema_version, steps, import_failures }`, not a bare array).
|
|
24
|
+
- **`needs_inferred` reads even from a step nobody has touched yet.** A
|
|
25
|
+
step whose `run()` still takes an undestructured first argument gets a
|
|
26
|
+
best-effort `needs_inferred` list, read lexically from that argument's
|
|
27
|
+
own member accesses, so a fixture inventory does not have to be built by
|
|
28
|
+
hand while the upgrade is in progress.
|
|
29
|
+
- **`nuka check`'s findings are grouped, not repeated.** A finding that
|
|
30
|
+
applies to more than one file (`step-file-import-failed`, for instance)
|
|
31
|
+
prints its message once, followed by the sorted file list, instead of
|
|
32
|
+
once per file.
|
|
33
|
+
- **Order**: upgrade the package, run `nuka check`, fix what it names, run
|
|
34
|
+
`nuka run`, repeat until both are green.
|
|
35
|
+
- **Across several releases, read every section from yours up, and the
|
|
36
|
+
newest one wins.** Each section below describes its release as it
|
|
37
|
+
shipped. A command, a flag, or an exit code that an older section names
|
|
38
|
+
can have been removed or changed by a later one: in the newest release,
|
|
39
|
+
a refusal exits 2, and `nuka clean` takes no `--records`, `--cache`, or
|
|
40
|
+
`--export`.
|
|
41
|
+
- **A release with no section below needs no action.** 0.4.1, 0.6.0,
|
|
42
|
+
0.13.1, 0.14.0, 0.19.0, and 0.20.0 are such releases (0.19.0 and 0.20.0
|
|
43
|
+
only added or fixed things, and changed no exit code, config key, or
|
|
44
|
+
step contract). Start reading at the first section whose range ends above your
|
|
45
|
+
version: a project on 0.13.0, 0.13.1, or 0.14.0 starts at "0.14.0 to
|
|
46
|
+
0.14.1", and one on 0.18.0, 0.19.0, or 0.20.0 starts at "0.20.0 to
|
|
47
|
+
0.21.0".
|
|
48
|
+
|
|
49
|
+
## 0.29.0 to 0.30.0
|
|
50
|
+
|
|
51
|
+
- **One pass of a run against one program is a system, not a world.** The
|
|
52
|
+
word was nukadoko's own for one pass of the scenarios against one
|
|
53
|
+
program, started for one environment and one tree, and cucumber-js gives
|
|
54
|
+
the same name to the per-scenario `this` object the compat door carries:
|
|
55
|
+
two different things under one word, and the reader who already knows
|
|
56
|
+
cucumber reads the wrong one. Nothing about how a run works changed.
|
|
57
|
+
What a project writes and reads did:
|
|
58
|
+
|
|
59
|
+
- `nukadoko.config.ts`: the `{world}` placeholder is `{system}`. A field
|
|
60
|
+
that still writes `{world}` is not a gap, since nothing fills a name
|
|
61
|
+
nukadoko does not know, so it has its own error:
|
|
62
|
+
`program-placeholder-renamed`, which `nuka check` reports and
|
|
63
|
+
`nuka run` and `nuka do` refuse with before any command runs, naming
|
|
64
|
+
the field and `{system}`.
|
|
65
|
+
- The types a program imports: `ProgramWorld` is `ProgramSystem`, and
|
|
66
|
+
`ProgramWorldPlace` is `ProgramSystemPlace`. What a `setup` or a `url`
|
|
67
|
+
function receives is the same value under the new name.
|
|
68
|
+
- `run.json`: `worlds[]` is `systems[]`, `table.worlds` is
|
|
69
|
+
`table.systems`, a cell's and a scenario execution's `world` is
|
|
70
|
+
`system`, a step record's `world_name` is `system_name`, and a claim's
|
|
71
|
+
`after_world_stop` is `after_system_stop`.
|
|
72
|
+
- The run directory: `worlds/<environment>/` is
|
|
73
|
+
`systems/<environment>/`, and `nuka do` keeps its record's program
|
|
74
|
+
files under `system/`, not `world/`.
|
|
75
|
+
- A redacted record writes `{{secret.SYSTEM_TOKEN}}` where it wrote
|
|
76
|
+
`{{secret.WORLD_TOKEN}}`, and an unjudged events claim's gap word is
|
|
77
|
+
`system-unread`, not `world-unread`.
|
|
78
|
+
- stderr opens those lines `system <name>:` where it opened
|
|
79
|
+
`world <name>:`.
|
|
80
|
+
|
|
81
|
+
A script that reads a run, a CI step that uploads a path under the run
|
|
82
|
+
directory, and an assertion on a redacted value take the new names.
|
|
83
|
+
cucumber-js's `World` keeps its name wherever the compat door is what is
|
|
84
|
+
being written about: the class and its constructor, `defineWorld`,
|
|
85
|
+
`setWorldConstructor`, `worldParameters`, the `world_invalid` failure
|
|
86
|
+
kind, the `duplicate-world` and `world-setup-failed` codes, and the step
|
|
87
|
+
record's own `world` field.
|
|
88
|
+
- **A system's program is a list of services, and its record moves with
|
|
89
|
+
it.** A program that writes no `services` is one service named `main`,
|
|
90
|
+
so its config needs no change. What moves is where the record keeps
|
|
91
|
+
what that service did:
|
|
92
|
+
|
|
93
|
+
- `run.json`'s `systems[]` keeps `name`, `tree`, `url`, and `error`,
|
|
94
|
+
gains `primary`, and keeps only `setup_ms` and `stop_ms` in
|
|
95
|
+
`timings`. `commands`, `log`, `program_log`, `events`, `lists`, and
|
|
96
|
+
the `build_ms`, `prepare_ms`, `serve_ms`, and `lists_ms` timings move
|
|
97
|
+
to `systems[].services[]`, where `main` is the only entry. A script
|
|
98
|
+
that read `systems[0].log` reads `systems[0].services[0].log`.
|
|
99
|
+
- The system's log moves from `systems/<environment>/program.log` to
|
|
100
|
+
`systems/<environment>/main/program.log`, its copy of the execution
|
|
101
|
+
events from `systems/<environment>/events.jsonl` to
|
|
102
|
+
`systems/<environment>/main/events.jsonl`, and `{dir}` names
|
|
103
|
+
`systems/<environment>/main/`. `nuka do` keeps the log at
|
|
104
|
+
`system/main/program.log` beside its record.
|
|
105
|
+
- A step's `observed.program_log` is
|
|
106
|
+
`{ trace_id, stamped, services: { main: { lines, file, stamped } } }`,
|
|
107
|
+
and the slice beside the record is `program-log.main.txt`, not
|
|
108
|
+
`program-log.txt`. The late lines are in `program-log-late.main.txt`,
|
|
109
|
+
and `run.json`'s step carries `program_log_late: { main: { lines,
|
|
110
|
+
file } }`.
|
|
111
|
+
- A system at a `url` records `observed.program_log` as
|
|
112
|
+
`{ trace_id, stamped, services: { main: null } }`, where it was
|
|
113
|
+
`null`, so a step's count of stamped requests is there too.
|
|
114
|
+
- A step may now write evidence named `program-log.txt`. A name of the
|
|
115
|
+
shape `program-log.<service>.txt` or `program-log-late.<service>.txt`
|
|
116
|
+
is refused with `ReservedEvidenceNameError` instead, for any service
|
|
117
|
+
name.
|
|
118
|
+
|
|
119
|
+
A reader that opens these files by path, such as a CI step that uploads
|
|
120
|
+
`program.log` or a script that reads `program-log.txt`, takes the new
|
|
121
|
+
path.
|
|
122
|
+
- **A step's execution events are keyed by service too.** Every service
|
|
123
|
+
that names `{events}` gets a file of its own and is read, where only
|
|
124
|
+
the primary service's file was. A program of one service needs no
|
|
125
|
+
change to its config, and its records move:
|
|
126
|
+
|
|
127
|
+
- `observed.events` is
|
|
128
|
+
`{ trace_id, stamped, services, process_spans, whole, open }`, with
|
|
129
|
+
`mcp_spans` when the step sent an MCP call. `lines`, `file`,
|
|
130
|
+
`kinds`, `stamped`, `stamped_spans`, `unreadable`, `unowned`, and
|
|
131
|
+
`process_requests` are in `services[<name>]`, where `main` is the
|
|
132
|
+
only entry for a program of one service. A script that read
|
|
133
|
+
`observed.events.lines` reads
|
|
134
|
+
`observed.events.services.main.lines`. A service whose events
|
|
135
|
+
nukadoko does not read, one at a `url` or one that names no
|
|
136
|
+
`{events}`, has `null` for its entry.
|
|
137
|
+
- `whole` and `open` stay where they were, one answer for the step.
|
|
138
|
+
A gap about one service carries `service`, so a reader that matched
|
|
139
|
+
a gap by `gap` alone still matches, and one that printed a gap's
|
|
140
|
+
sentence reads the service in it.
|
|
141
|
+
- The step's slice beside the record is `events.<service>.jsonl`, not
|
|
142
|
+
`events.jsonl`, its late lines are in
|
|
143
|
+
`events-late.<service>.jsonl`, and `run.json`'s step carries
|
|
144
|
+
`events_late: { main: { lines, file } }` where it carried
|
|
145
|
+
`events_late: { lines, file }`.
|
|
146
|
+
- A step may now write evidence named `events.jsonl`. A name of the
|
|
147
|
+
shape `events.<service>.jsonl` or `events-late.<service>.jsonl` is
|
|
148
|
+
refused with `ReservedEvidenceNameError` instead, for any service
|
|
149
|
+
name.
|
|
150
|
+
- A `flags` row in `run.json` carries `service`, and so does every
|
|
151
|
+
`path` entry and request. A script that joined a flag by `name` and
|
|
152
|
+
`side`, or a path key by its fields, reads `service` too: a key
|
|
153
|
+
with no service is never the same key as one that has it.
|
|
154
|
+
|
|
155
|
+
A reader that opens a step's events by path, or compares path keys
|
|
156
|
+
between two runs, takes the new shape.
|
|
157
|
+
- **An environment that writes `url` no longer takes the top level's
|
|
158
|
+
`build`, `prepare`, or `root`.** Those are for the code the top level
|
|
159
|
+
starts, and a `url` reaches code nukadoko does not start, so a run
|
|
160
|
+
against a deployed server builds nothing. The `build: []` and
|
|
161
|
+
`prepare: []` such an environment wrote to stop them can go; they still
|
|
162
|
+
read. An environment at a `url` that counted on the top level's
|
|
163
|
+
`prepare`, to seed the deployed server for one, writes its own
|
|
164
|
+
`prepare` now. The same holds for a service an environment moves to a
|
|
165
|
+
`url` under its own `services`.
|
|
166
|
+
- **A system's `setup` has to return a JSON value, or nothing.** What it
|
|
167
|
+
returns now reaches every step as the `setupResult` fixture, so it
|
|
168
|
+
crosses to a `--concurrency` worker and into `run.json` as JSON. A
|
|
169
|
+
`setup` that returned something else, a `Date` or a class instance among
|
|
170
|
+
them, failed nothing before, because nothing read the value; it fails
|
|
171
|
+
the system with `program-start-failed` now, naming the path of the part
|
|
172
|
+
that cannot cross (`setup returned a value that is not JSON at
|
|
173
|
+
.customer.created`). A `setup` that only prepares data and happens to
|
|
174
|
+
return its last expression returns nothing instead, or the JSON value a
|
|
175
|
+
step should read.
|
|
176
|
+
- **`exit_code` and `duration_ms` of a step record's
|
|
177
|
+
`observed.processes[]` entry are optional.** The entry of a command a
|
|
178
|
+
system's `stepsReach: "url"` refused holds `refused: "steps-reach-url"`
|
|
179
|
+
and neither of them, since a measurement of a process that never ran
|
|
180
|
+
would be a lie. A script that read `exit_code` from every entry reads it
|
|
181
|
+
as optional, and treats an entry that carries `refused` as a command
|
|
182
|
+
that did not run.
|
|
183
|
+
- New, and nothing to do: `stepsReach` says how far the code that runs
|
|
184
|
+
with the scenarios may reach into the program, `"any"` by default, which
|
|
185
|
+
leaves every helper as it is. An environment or a program that declares
|
|
186
|
+
`"url"` refuses `runCommand` with `CommandRefusedError`, records the
|
|
187
|
+
command it did not start, makes that execution's cell `broke`, reports
|
|
188
|
+
`command-refused` in the run, and reports `steps-reach-command` from
|
|
189
|
+
`nuka check`. A step reads the system's test tenant from the
|
|
190
|
+
`setupResult` fixture, whose shape a project declares once by augmenting
|
|
191
|
+
the `SetupResult` interface, and `setup` receives `services` and
|
|
192
|
+
`conditions` to make it. See "Steps reach" in
|
|
193
|
+
[docs/spec.md](../spec.md#steps-reach).
|
|
194
|
+
- New, and nothing to do: an events key of a claim step takes `service`
|
|
195
|
+
to count one service's lines alone, the new gap `service-unrecorded`
|
|
196
|
+
names a service the step sent a request to whose events are not read,
|
|
197
|
+
and `nuka check` reports `events-service-unknown` for a `service` no
|
|
198
|
+
service of a system the run would start has. A line of a step's
|
|
199
|
+
http.jsonl names the `service` that answered it. See "Execution
|
|
200
|
+
events" in [docs/spec.md](../spec.md#execution-events).
|
|
201
|
+
- New, and nothing to do: a program can name several services (`services`,
|
|
202
|
+
`primary`, `root`, `external`), reach one from another through
|
|
203
|
+
`{service.<name>.url}` and `{service.<name>.port}`, and a step reads
|
|
204
|
+
them in the `services` fixture. `nuka check` reports
|
|
205
|
+
`program-service-root-missing` for a service whose `root` is no
|
|
206
|
+
directory. A service whose code is a checkout outside the repository is
|
|
207
|
+
built once for head's system and the base's under `nuka run --base`, and
|
|
208
|
+
the run records the commit it had checked out. See "Services" in
|
|
209
|
+
[docs/spec.md](../spec.md#services).
|
|
210
|
+
|
|
211
|
+
## 0.26.0 to 0.27.0
|
|
212
|
+
|
|
213
|
+
- **The program moves into the config.** `nukadoko.program.ts` and
|
|
214
|
+
`defineProgram` are gone, and the program under test is `program` in
|
|
215
|
+
`nukadoko.config.ts`: a function that returns the object
|
|
216
|
+
`defineProgram` took. A project root that still holds
|
|
217
|
+
`nukadoko.program.ts` or `nukadoko.program.mts` stops every command,
|
|
218
|
+
`nuka check` included, with exit code 2:
|
|
219
|
+
|
|
220
|
+
```text
|
|
221
|
+
refused program-file-moved - nukadoko.program.ts is no longer read: the program under test is part of nukadoko.config.ts now, so nukadoko does not start what nukadoko.program.ts describes.
|
|
222
|
+
fix: Move what nukadoko.program.ts describes into nukadoko.config.ts as its program, and delete nukadoko.program.ts; CHANGELOG.md, under "The program moves into the config", shows the move.
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Move the object into the config, and delete the program file:
|
|
226
|
+
|
|
227
|
+
```ts
|
|
228
|
+
// nukadoko.config.ts
|
|
229
|
+
import { defineConfig } from "nukadoko";
|
|
230
|
+
|
|
231
|
+
export default defineConfig({
|
|
232
|
+
featuresDir: "features",
|
|
233
|
+
program: () => ({
|
|
234
|
+
serve: { command: "npm start", ready: "/" },
|
|
235
|
+
env: { PORT: "{port}" },
|
|
236
|
+
}),
|
|
237
|
+
});
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
A helper or a constant the program file declared moves above
|
|
241
|
+
`defineConfig`. A config that still imports `defineProgram` is
|
|
242
|
+
refused with `config-invalid`. A `--base` ref from before the move
|
|
243
|
+
needs nothing: the run still reads that ref's program file for its base
|
|
244
|
+
system. The upgrade is done when `nuka check` is green.
|
|
245
|
+
|
|
246
|
+
## 0.25.0 to 0.26.0
|
|
247
|
+
|
|
248
|
+
- **A scenario whose claims held is `broke` when the program failed
|
|
249
|
+
underneath it.** A cell whose steps all passed reads `broke@<line>`
|
|
250
|
+
when one of them got a response with a status from 500 to 599, its
|
|
251
|
+
page threw an error nothing caught, or (where the program writes
|
|
252
|
+
execution events) the program reported an `error` with `handled:
|
|
253
|
+
false`, and no `@expects:` tag of the scenario names that failure. Its
|
|
254
|
+
row is `failed`, the run exits 1, and an `unexpected-failure` finding
|
|
255
|
+
names the step, the status and its URL, the page error's name, or the
|
|
256
|
+
class. Fix the program. A scenario that causes the failure on purpose
|
|
257
|
+
(a maintenance page, an error boundary, a declined card) names it on
|
|
258
|
+
its Scenario line, `@expects:status=503`, `@expects:page-error=TypeError`,
|
|
259
|
+
or `@expects:error=<class>`; the finding's `fix:` line spells the tag
|
|
260
|
+
(see "Failures underneath" in docs/spec.md). `nuka check` reports a tag
|
|
261
|
+
that does not read as `expects-tag-malformed`, which stops a run.
|
|
262
|
+
- **Under `--base`, an `@expects:` tag is part of the criterion.** Adding
|
|
263
|
+
one makes the criterion `changed`, so it needs proof at the base. A
|
|
264
|
+
scenario tagged only to move across this release did not change its
|
|
265
|
+
behaviour: tag it `@held` too, so its base cell passes under the same
|
|
266
|
+
tag, or land the tags in a change of their own before the change a
|
|
267
|
+
reviewer reads.
|
|
268
|
+
- **A test that asserted a run exits 0 while its page throws** now sees
|
|
269
|
+
exit 1; tag the scenario with the name the step record's
|
|
270
|
+
`page_events.page_errors` shows, or stop the throw.
|
|
271
|
+
- **run.json gains fields a strict reader may not know:** a step's
|
|
272
|
+
`underneath`, a scenario's and a table row's `expects`, a cell
|
|
273
|
+
`reason` that names a failure underneath, and the finding codes
|
|
274
|
+
`unexpected-failure` and `expects-unseen`. A step record's page error
|
|
275
|
+
gains `name`. A run in which a failure underneath turned a passed
|
|
276
|
+
cell `broke` prints the `criteria:` line after the count line, as a
|
|
277
|
+
run with a control does.
|
|
278
|
+
- **A file named `INTENT.md` at the repository's top is read under
|
|
279
|
+
`nuka run --base`** when the base does not hold the same text
|
|
280
|
+
(docs/intent.md). A project that already keeps an unrelated file under
|
|
281
|
+
that name and changes it in a branch gets `intent-unread`, which fails
|
|
282
|
+
the run; rename the file.
|
|
283
|
+
- **A writer's own kinds (`x_...`) take part in paths.** A program that
|
|
284
|
+
emits its own events sees them under "Changed paths" and in run.json's
|
|
285
|
+
`paths` when their count differs between the base and head, and a
|
|
286
|
+
path entry's `kind` can now be such a kind. A criterion that differs
|
|
287
|
+
only in them was `same` before and is `changed` now.
|
|
288
|
+
- **`explained_by` in run.json's `paths` can be `"intent"`,** and a
|
|
289
|
+
difference can carry `intent`, the row that declares it. A job that
|
|
290
|
+
treated every value other than `"criterion_change"` as `null` reads
|
|
291
|
+
`"intent"` as declared.
|
|
292
|
+
- **Each Then that reads a page takes 50 to 100 ms longer,** since it
|
|
293
|
+
keeps a view of each open page right after its judged reading
|
|
294
|
+
(`judged_view`, see "What the pages showed" in docs/spec.md). A step
|
|
295
|
+
whose `timeout` left no room for that, or a `poll` whose timeout is that
|
|
296
|
+
close to the step's, gets the room back with `judgedView: false` in
|
|
297
|
+
`nukadoko.config.ts`, which also saves the files.
|
|
298
|
+
- **The run summary's verdict table gains a `seen` column** when a Then
|
|
299
|
+
of the run can be seen, and Claims entries and red rows' failure lines
|
|
300
|
+
end in `seen` links. A job that parses `summary.md` by column reads the
|
|
301
|
+
last column as `seen`, or reads `run.json`'s `table` instead.
|
|
302
|
+
- **The run summary moved its gap sections into one.** "Scenarios with
|
|
303
|
+
no claim", "Unmeasured actions", the line under the table that counts
|
|
304
|
+
criteria `--env` left out, and the condition lines `check: skipped`,
|
|
305
|
+
`program log of system ...`, and `events of system ...` are gone; each
|
|
306
|
+
is an entry under "What this run does not show", right after the
|
|
307
|
+
table's reasons. A job that searched `summary.md` for one of those
|
|
308
|
+
headings or lines reads run.json's `limits` instead, by `kind`
|
|
309
|
+
(`no-claim`, `unmeasured`, `after-record`, `left-out`,
|
|
310
|
+
`check-skipped`, `unrecorded-log`, `unrecorded-events`). A test that
|
|
311
|
+
asserted stderr ends with the count line now sees a `limits: ...`
|
|
312
|
+
line after the findings when the run has a limit.
|
|
313
|
+
- **`judged` is a reserved evidence name.** `evidence.attach("judged", ...)`
|
|
314
|
+
and `evidence.path("judged")` throw `ReservedEvidenceNameError`, since
|
|
315
|
+
the view goes in that directory. Pick another name.
|
|
316
|
+
- **run.json gains enum values a strict reader may not know.** A claim's
|
|
317
|
+
`outcome` can be `for-judgment`, a scenario's `claims` can count
|
|
318
|
+
`for_judgment` and its `judged_by` can be `"judgment"`, a table row
|
|
319
|
+
can carry `judgment`, the table `judgments_changed` under `--base`,
|
|
320
|
+
a claim `value_digest`, and `limits` the kind `judgment` (see
|
|
321
|
+
"Judgments" in docs/spec.md). A job that rejects an unknown value
|
|
322
|
+
accepts these; one that counts `held` claims to decide a scenario held
|
|
323
|
+
reads `for-judgment` as passed but not held. Nothing changes for a
|
|
324
|
+
project with no `judged-as` claim.
|
|
325
|
+
- **`judgments/` at the project root is where `nuka judge` writes.** A
|
|
326
|
+
project that keeps an unrelated directory under that name and starts
|
|
327
|
+
using `judged-as` moves it, since `nuka run` reads
|
|
328
|
+
`judgments/<feature path>.json` for each feature that asks for a
|
|
329
|
+
judgment and fails with `judgments-unread` on a file it cannot read.
|
|
330
|
+
|
|
331
|
+
## 0.24.0 to 0.25.0
|
|
332
|
+
|
|
333
|
+
- **A claim that a key an earlier step's `returns` dropped could change
|
|
334
|
+
is `unjudged` where it held,** and the scenario fails on it. The run
|
|
335
|
+
reads the keys the producing step's record names in `returns_dropped`,
|
|
336
|
+
and the reason names the step, the place, and the keys. Declare such a
|
|
337
|
+
key in `returns` as optional (`password: z.unknown().optional()`), or
|
|
338
|
+
declare the object with `z.looseObject`, which keeps every key, so the
|
|
339
|
+
claim judges the key, or claim only the fields that matter with
|
|
340
|
+
`has-fields`. A claim through a `z.strictObject` is judged as before.
|
|
341
|
+
- **`nuka do --use` of a record an earlier nukadoko wrote reads the
|
|
342
|
+
producer's `returns` in its place,** since such a record has no
|
|
343
|
+
`returns_dropped`, and leaves a claim on an object that a `z.object`
|
|
344
|
+
there parsed `unjudged` wherever a key it does not declare could
|
|
345
|
+
change it. Run the producing step again with `nuka do` and pass the
|
|
346
|
+
new record id to `--use`.
|
|
347
|
+
- **A broken `equal` line on two lists with an item inserted or removed
|
|
348
|
+
names the items the two do not share in order,** where it ended with
|
|
349
|
+
the first difference by place (`; 1 actual item is extra:
|
|
350
|
+
["4","chair","2"] (item 3)` where it read `; first difference at 3.0:
|
|
351
|
+
actual "4", expected "3"`), and a line on two lists that hold the same
|
|
352
|
+
items in another order starts its first difference with `the same
|
|
353
|
+
items in another order, `. No verdict or exit code changes, and no
|
|
354
|
+
step file changes. Update a script that matched the old text.
|
|
355
|
+
- **A count claim on the events of a step that ran a command-line tool
|
|
356
|
+
is judged where it was `unjudged`,** once each `runCommand` process
|
|
357
|
+
the step ran has closed with no process of its group left. Such a
|
|
358
|
+
claim now holds or breaks: read the reason of one that breaks, since
|
|
359
|
+
it counts what the tool's requests did. A step whose tool leaves a
|
|
360
|
+
helper running in its process group keeps `processes-unbounded`, as
|
|
361
|
+
before: stop the helper before the step ends, or start it from a
|
|
362
|
+
fixture, when the step's events should be whole.
|
|
363
|
+
- **Inside a step on POSIX, a `runCommand` process has no controlling
|
|
364
|
+
terminal,** since it runs in a process group and a session of its own.
|
|
365
|
+
A tool that prompts on the terminal fails there: give it the answer
|
|
366
|
+
through `input` or `env`. A reader that compares the entries of
|
|
367
|
+
`observed.processes` whole adds the key `group`.
|
|
368
|
+
- **Two claims that could hold are refused before the run,** and a
|
|
369
|
+
scenario that passed on them fails `nuka check`. An `each` whose
|
|
370
|
+
`where` compares an item's value in order (`greater-than`, `at-least`,
|
|
371
|
+
`less-than`, `at-most`), or with `not-equal` against a literal, and
|
|
372
|
+
claims `is-a` of a kind that is that value's JSON type alone, such as
|
|
373
|
+
"every item over 10 has a number price", held whatever the data was:
|
|
374
|
+
`defineStep` refuses it now, and the run breaks the pair when the line
|
|
375
|
+
fills the kind or the compared value. Claim what the value is beyond
|
|
376
|
+
its type, or drop the `is-a` claim. A `lacks-field` claim, or a `where`
|
|
377
|
+
that selects by one, on a value the claim step's own `args` declares
|
|
378
|
+
as a `z.object` that does not declare the field is
|
|
379
|
+
`claim-args-dropped`: declare the value with the producing step's own
|
|
380
|
+
schema (`user: signUp.returns.shape.user`) or with `z.looseObject`. The other new
|
|
381
|
+
refusals and findings name claims that never held, so a scenario that
|
|
382
|
+
passed meets none of them.
|
|
383
|
+
- **MCP calls: a fixture that connects an MCP client can make each call
|
|
384
|
+
part of the step record.** Nothing changes for a client as it is
|
|
385
|
+
connected now. Pass its transport through `measureMcp` from
|
|
386
|
+
`nukadoko`, in the fixture that builds it:
|
|
387
|
+
`await client.connect(measureMcp(new StdioClientTransport({ command, args })))`.
|
|
388
|
+
Each call a step sends is then a line of the step's `mcp.jsonl`, and
|
|
389
|
+
carries the step's trace context in `params._meta.traceparent`. Over
|
|
390
|
+
streamable HTTP to the system, the program's lines for the call are the
|
|
391
|
+
step's, and a count claim on them can be exact. Over stdio, an exact
|
|
392
|
+
count claim on the server's work is `unjudged` (`mcp-unbounded`):
|
|
393
|
+
claim `at-least`, or reach the server over HTTP. A transport written
|
|
394
|
+
inside the `connect` call cannot be wrapped, and `nuka check` names
|
|
395
|
+
it as the note `mcp-transport-unmeasured`: build it first, then pass
|
|
396
|
+
it through `measureMcp`. See docs/spec.md "MCP calls".
|
|
397
|
+
|
|
398
|
+
## 0.23.0 to 0.24.0
|
|
399
|
+
|
|
400
|
+
- **`run.json`'s `counts` always has `stopped`,** 0 for every run but a
|
|
401
|
+
walk (`nuka run --step`). A reader that compares `counts` whole adds
|
|
402
|
+
the key. Outside a walk, `failed` counts what it counted before.
|
|
403
|
+
- **A walk adds a scenario status, a cell outcome, and a hook status,
|
|
404
|
+
under `--step` only.** A scenario a person stopped is `status:
|
|
405
|
+
"stopped"` with its cell `stopped`, and an After hook there gets
|
|
406
|
+
`result.status` `SKIPPED`, which the compat `HookParameter` type now
|
|
407
|
+
allows. A run without `--step` writes none of them. Change code only
|
|
408
|
+
where it reads `run.json` with a switch that refuses a status it does
|
|
409
|
+
not know, or where an After hook narrows `result.status` to `PASSED`
|
|
410
|
+
or `FAILED`.
|
|
411
|
+
|
|
412
|
+
## 0.22.0 to 0.23.0
|
|
413
|
+
|
|
414
|
+
- **`nuka scaffold --then` writes a claim for a line that states its value
|
|
415
|
+
with a number word,** given one `z.number()` `--from`, where it refused.
|
|
416
|
+
Its refusal for a line that states no value names number words among
|
|
417
|
+
the words that state one; a script that matched the old text updates it.
|
|
418
|
+
- **A broken claim's failure message shows `{{secret.NAME}}` where a
|
|
419
|
+
loaded secret stood,** cut after redaction, so its character positions
|
|
420
|
+
are those of the redacted text, as in the run summary. No step file
|
|
421
|
+
changes.
|
|
422
|
+
- **`neither` and `nor` right before `no`, `none`, `nothing`, or `empty`
|
|
423
|
+
negate it, as `not` does.** A claim that compared "the reply is
|
|
424
|
+
neither empty nor blank" with `equal ""` held for an empty reply, the
|
|
425
|
+
opposite of the line, and is now refused at import, naming the words
|
|
426
|
+
"neither empty". Claim `not-equal` there, or rewrite the claim so the
|
|
427
|
+
line states what it compares.
|
|
428
|
+
- **A step whose `observe` no claim reads is refused at import.** Every
|
|
429
|
+
claim's actual is a `from` key and no expected value is `{ observe }`,
|
|
430
|
+
so what `observe` returns changes no verdict; the usual cause is a key
|
|
431
|
+
it returns under a `from` key's name, which the `from` value hid.
|
|
432
|
+
`nuka check` names the file as `step-file-import-failed`. Rename the
|
|
433
|
+
key `observe` returns so no `from` key has its name, or drop `observe`.
|
|
434
|
+
At run time, a claim whose actual `from` key `observe` also returned
|
|
435
|
+
now breaks and names the key, where it used to read the `from` value.
|
|
436
|
+
- **`observe` no longer receives the actual `from` key of a claim whose
|
|
437
|
+
expected value is `{ observe }`.** An `observe` that reads that key
|
|
438
|
+
throws, and the step is `unobserved`; read what it needs from another
|
|
439
|
+
key. A step `nuka check` refused as `claim-compares-itself` for this
|
|
440
|
+
shape passes now, when `observe` reads no other key that holds the
|
|
441
|
+
actual value.
|
|
442
|
+
- **`measured` is `null` for a number another channel of the record
|
|
443
|
+
also holds, and for any value while a text channel of the record was
|
|
444
|
+
cut, is not text, or was not read.** The run summary prints
|
|
445
|
+
`measured: none` where it used to name a channel that may not have
|
|
446
|
+
been the source. No
|
|
447
|
+
step file changes; a reader that relied on the named channel reads the
|
|
448
|
+
value from the step record itself.
|
|
449
|
+
- **The `--base` summary line and the `moved` and `unproven` reasons
|
|
450
|
+
read differently.** When the old system ran fewer unchanged criteria
|
|
451
|
+
than needed it, the line says how many it ran; a reason names every
|
|
452
|
+
environment whose cell came to the same thing. No verdict or exit code
|
|
453
|
+
changes. Update a script that matched the old text.
|
|
454
|
+
- **`features-dir-missing` in a directory with no config file names the
|
|
455
|
+
directory as its file,** where it named `nukadoko.config.ts`, and its
|
|
456
|
+
fix says to run `nuka init`. When a parent directory holds a config
|
|
457
|
+
file, the fix says to run nuka from that directory instead. The exit
|
|
458
|
+
code is the same.
|
|
459
|
+
- **A broken `each` claim's summary line ends with the first broken
|
|
460
|
+
item,** and the item lines of its failure message name the item's
|
|
461
|
+
`id`, `name`, or `key` when it has one. A broken item result in the
|
|
462
|
+
step record may carry `identity`. No step file changes.
|
|
463
|
+
- **A broken `equal` line on a long or multi-line text, or on two arrays
|
|
464
|
+
or two objects, ends with `; first difference at ...`.** It appears in
|
|
465
|
+
the failure message, the run summary, and the Allure step name. No
|
|
466
|
+
step file changes.
|
|
467
|
+
|
|
468
|
+
## 0.21.0 to 0.22.0
|
|
469
|
+
|
|
470
|
+
- **A typed Then declares claims, and a Then that runs code is an
|
|
471
|
+
error.** `nuka check` reports each typed step that runs and is bound in
|
|
472
|
+
Then position as `then-without-claims`, and `nuka run` refuses to
|
|
473
|
+
start while one is reported. For each one, replace `run` with
|
|
474
|
+
`claims`, and drop `returns` and `mutates`, which `defineStep` refuses
|
|
475
|
+
on a claim step. A value the step read through `from` stays a `from`
|
|
476
|
+
key; a value it read itself moves into `observe`, which returns what it
|
|
477
|
+
read. Then pick where each expected value comes from (docs/spec.md
|
|
478
|
+
"Claims"). The sentence states it:
|
|
479
|
+
|
|
480
|
+
```ts
|
|
481
|
+
export default defineStep({
|
|
482
|
+
pattern: "it exits with {code:int}",
|
|
483
|
+
description: "The process exit code is exactly this",
|
|
484
|
+
args: z.object({ code: z.number(), exitCode: runTally.returns.shape.exitCode }),
|
|
485
|
+
from: { exitCode: [runTally, "exitCode"] },
|
|
486
|
+
mutates: false,
|
|
487
|
+
run({}, { code, exitCode }) {
|
|
488
|
+
assert.equal(exitCode, code, `exitCode: expected ${code}, got ${exitCode}`);
|
|
489
|
+
},
|
|
490
|
+
});
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
```ts
|
|
494
|
+
export default defineStep({
|
|
495
|
+
pattern: "it exits with {code:int}",
|
|
496
|
+
description: "The process exit code is exactly this",
|
|
497
|
+
args: z.object({ code: z.number(), exitCode: runTally.returns.shape.exitCode }),
|
|
498
|
+
from: { exitCode: [runTally, "exitCode"] },
|
|
499
|
+
claims: [{ actual: "exitCode", compare: "equal", expected: "code" }],
|
|
500
|
+
});
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
An earlier step returned it: `{ from: "<from key>" }`.
|
|
504
|
+
|
|
505
|
+
```ts
|
|
506
|
+
// Before: run({ request }, { before }) { ...; expect(items.length).toBe(before); }
|
|
507
|
+
args: z.object({ before: countItems.returns.shape.count }),
|
|
508
|
+
from: { before: [countItems, "count"] },
|
|
509
|
+
async observe({ request }) {
|
|
510
|
+
const res = await request.get("/items");
|
|
511
|
+
return { count: ((await res.json()) as unknown[]).length };
|
|
512
|
+
},
|
|
513
|
+
claims: [{ actual: "count", compare: "equal", expected: { from: "before" } }],
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
The pattern's fixed words state it: `{ literal }`. A literal the pattern
|
|
517
|
+
does not state, word for word, is refused at import, so a sentence that
|
|
518
|
+
keeps its value in step code is reworded to state it. A value that a
|
|
519
|
+
word such as `no` or `empty` fixes is compared with `equal` only.
|
|
520
|
+
|
|
521
|
+
```gherkin
|
|
522
|
+
# Before: Then the command succeeds
|
|
523
|
+
Then the command exits 0
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
```ts
|
|
527
|
+
// Before: pattern "the command succeeds", run: expect(exitCode).toBe(0)
|
|
528
|
+
pattern: "the command exits 0",
|
|
529
|
+
claims: [{ actual: "exitCode", compare: "equal", expected: { literal: 0 } }],
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
A second reading: `{ observe: "<path>" }`. An `observe` that reaches
|
|
533
|
+
`page`, `context`, or `pageAs` states `poll` (`claim-poll-unstated`).
|
|
534
|
+
|
|
535
|
+
```ts
|
|
536
|
+
// Before: run({ page }, ...) { ...; expect(firstAt).toBeLessThan(secondAt); }
|
|
537
|
+
async observe({ page }, { first, second }) {
|
|
538
|
+
const titles = await page.locator(".result h2").allTextContents();
|
|
539
|
+
const at = (title: string) => (titles.includes(title) ? titles.indexOf(title) : undefined);
|
|
540
|
+
return { firstAt: at(first), secondAt: at(second) };
|
|
541
|
+
},
|
|
542
|
+
poll: { timeout_ms: 5000 },
|
|
543
|
+
claims: [{ actual: "firstAt", compare: "less-than", expected: { observe: "secondAt" } }],
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
- **A Then parses the line's text with `expected_view`, not with its
|
|
547
|
+
schema.** An args schema that rewrites a value a claim reads
|
|
548
|
+
(`z.coerce`, a transform, a preprocess, a pipe, `trim` and the other
|
|
549
|
+
overwrite checks, `catch`, a default or a prefault, a refine on an
|
|
550
|
+
object or an array, or any of these on the args object itself) is
|
|
551
|
+
refused at import. A docstring of JSON
|
|
552
|
+
keeps a plain `z.string()` key, and the claim reads it as JSON:
|
|
553
|
+
|
|
554
|
+
```ts
|
|
555
|
+
// Before: expected: z.string().transform((text) => JSON.parse(text))
|
|
556
|
+
args: z.object({ expected: z.string(), body: z.unknown() }),
|
|
557
|
+
claims: [{ actual: "body", compare: "equal", expected: "expected", expected_view: "json" }],
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
A claim on a `Date`, a bigint, a `Proxy`, or another value that is
|
|
561
|
+
not plain JSON is `unjudged` at run: return the value as JSON (an ISO
|
|
562
|
+
date string, a decimal string, a number) and claim on that.
|
|
563
|
+
|
|
564
|
+
- **A boolean becomes the word the sentence uses, or the measurement
|
|
565
|
+
behind it.** A boolean literal is refused against a value `observe`
|
|
566
|
+
computed, and a sentence says `accepted`, not `true`. A producer that
|
|
567
|
+
returned `accepted: boolean` returns the outcome as a word, and the Then
|
|
568
|
+
claims the word its sentence states:
|
|
569
|
+
|
|
570
|
+
```ts
|
|
571
|
+
// Before: returns { accepted: z.boolean() }, and the Then: expect(accepted).toBe(true)
|
|
572
|
+
returns: z.object({ outcome: z.enum(["accepted", "refused"]), reason: z.string().nullable() }),
|
|
573
|
+
// The Then "the sign-in is accepted":
|
|
574
|
+
claims: [{ actual: "outcome", compare: "equal", expected: { literal: "accepted" } }],
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
An `observe` that returned `{ visible: true }` returns what it saw (a
|
|
578
|
+
count, a text, a list) and the claim compares it.
|
|
579
|
+
|
|
580
|
+
- **A Then that only reads or records a value moves to When**, or becomes
|
|
581
|
+
a claim on what it reads: `Then the created todo id is read back via
|
|
582
|
+
resultOf` became `Then the created todo is titled "Read a book"` in
|
|
583
|
+
`examples/migration`. A claim step bound in Given or When position is
|
|
584
|
+
`claims-outside-then`, and so is one on a `*` line: write its keyword.
|
|
585
|
+
|
|
586
|
+
- **A claim step takes an earlier step's value through `from`, not
|
|
587
|
+
`resultOf`.** `resultOf` throws inside a claim step, also when a
|
|
588
|
+
project fixture calls it there, with a message that names the step.
|
|
589
|
+
Read through `resultOf`, the value carried the label `observe:`; read
|
|
590
|
+
through `from`, the record names the line that returned it. Move the
|
|
591
|
+
read into `from`, and claim on the `from` key:
|
|
592
|
+
|
|
593
|
+
```ts
|
|
594
|
+
// Before: observe({ resultOf }) { return { createdTitle: resultOf(createTodo)?.title }; }
|
|
595
|
+
args: z.object({ title: z.string(), createdTitle: createTodo.returns.shape.title }),
|
|
596
|
+
from: { createdTitle: [createTodo, "title"] },
|
|
597
|
+
claims: [{ actual: "createdTitle", compare: "equal", expected: "title" }],
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
A step that runs keeps `resultOf` as it was. `nuka check` also refuses
|
|
601
|
+
a claim step whose `observe` receives a `from` value that an expected
|
|
602
|
+
`{ from }` reads, or the `from` value an actual reads when the expected
|
|
603
|
+
value is `{ observe }` (`claim-compares-itself`): take one of the two
|
|
604
|
+
from another step.
|
|
605
|
+
|
|
606
|
+
- **A Then that returned a value for a later Then hands that value to a
|
|
607
|
+
step that runs.** A claim step has no `returns`, so a chain of Thens
|
|
608
|
+
where each read the one before cannot keep its shape. Move what the
|
|
609
|
+
first Then measured into the When (or a Given) that ran the command,
|
|
610
|
+
return it there, and point each later Then's `from` at that step.
|
|
611
|
+
`from` reads the most recent result of the step it names, so when one
|
|
612
|
+
step file served two lines whose results later Thens tell apart (a
|
|
613
|
+
first check and a check run again), split it into two step files, one
|
|
614
|
+
per line, and name the one each Then means.
|
|
615
|
+
|
|
616
|
+
- **A fact an old Then checked that its sentence does not state goes in
|
|
617
|
+
the When, as a precondition.** A claim compares only with what its line
|
|
618
|
+
states, so an exit code of 0 or a status of 200 under a sentence that
|
|
619
|
+
names neither has no claim to carry it. Check it in the When that ran
|
|
620
|
+
the command or sent the request, and throw when it does not hold: the
|
|
621
|
+
step fails at its own line, and no Then is judged on a system that was
|
|
622
|
+
never in the state the scenario meant.
|
|
623
|
+
|
|
624
|
+
- **A parameter type with a transformer cannot fill a claim's expected
|
|
625
|
+
value.** `nuka check` reports such a pattern as
|
|
626
|
+
`claim-expected-transformed`, and `nuka run` refuses to start while it
|
|
627
|
+
is reported; under `--no-check`, a claim that compares with such a key
|
|
628
|
+
is `unjudged`. Capture the key with a type that has no transformer, such
|
|
629
|
+
as `{key:string}`, and name `expected_view` on the claim when it reads
|
|
630
|
+
the text as JSON or as lines.
|
|
631
|
+
|
|
632
|
+
- **`scenario-without-then` warns for more scenarios.** A scenario of
|
|
633
|
+
only `*` lines, and one whose Then lines each bind a step that is not a
|
|
634
|
+
claim step (a compat step), are reported now. A job that runs `nuka
|
|
635
|
+
check --fail-on scenario-without-then` fails on them: give each one a
|
|
636
|
+
Then line that binds a claim step.
|
|
637
|
+
|
|
638
|
+
- **`nuka scaffold --then` refuses a pattern that states no value.** It
|
|
639
|
+
exits 2 with `invalid-value`, where it used to write a claim against a
|
|
640
|
+
value `observe` computed. Capture the value in `--pattern` ("the count
|
|
641
|
+
is {count:int}"), state it with a word (`none`, `empty`), or give the
|
|
642
|
+
feature line a docstring or a table. `nuka scaffold --feature` skips
|
|
643
|
+
such a Then line with a note on stderr instead of writing a stub.
|
|
644
|
+
|
|
645
|
+
- **run.json has three more fields.** Each scenario entry has `claims`,
|
|
646
|
+
and one in which no claim on a Then line was judged has `judged_by`;
|
|
647
|
+
the document has `check`. A reader that compares a scenario entry or the document as a
|
|
648
|
+
whole adds them; a reader that reads keys by name has nothing to do.
|
|
649
|
+
The run summary gains "Scenarios with no claim", a `check: skipped`
|
|
650
|
+
condition line under `--no-check`, and `measured:` on every claim
|
|
651
|
+
line.
|
|
652
|
+
|
|
653
|
+
- **`then-mutates` is gone.** `nuka check --fail-on then-mutates`
|
|
654
|
+
refuses the code with `fail-on-unknown-code`; drop it. The error
|
|
655
|
+
`then-without-claims` fails the check with no flag.
|
|
656
|
+
|
|
657
|
+
- **A Then that `nuka scaffold --then` wrote earlier is a step that
|
|
658
|
+
runs.** `--replace` refuses it, because it is not what scaffold writes
|
|
659
|
+
now. Rewrite it as above, or delete the file and scaffold it again.
|
|
660
|
+
|
|
661
|
+
- **Three error kinds and three Allure categories are new.** A reader
|
|
662
|
+
that switches on `error.kind` adds `claim_broken`, `unobserved`, and
|
|
663
|
+
`claim_unjudged`. A project with an `allurerc.mjs` from an earlier
|
|
664
|
+
release copies the three new rules from [examples/allure/allurerc.mjs](https://github.com/meganemura/nukadoko/blob/main/typescript/examples/allure/allurerc.mjs);
|
|
665
|
+
without them, Allure 3 files these kinds under "Product errors".
|
|
666
|
+
`nuka report --format allure` writes Allure 2's `categories.json` with
|
|
667
|
+
all ten on its own.
|
|
668
|
+
|
|
669
|
+
- **A step file exports the step `defineStep` returned, and leaves it as
|
|
670
|
+
it is.** `defineStep` now freezes the step it returns, with its claims,
|
|
671
|
+
`from`, and `parts`, and discovery refuses a default export that is a
|
|
672
|
+
copy (`{ ...step }`, `Object.assign({}, step)`). It validates a copy
|
|
673
|
+
of the definition's data, so a getter, a setter, a Proxy, a class
|
|
674
|
+
instance, or a hole in an array in the claims, `from`, `parts`,
|
|
675
|
+
`poll`, or the patterns is refused at the call, and so is a claim
|
|
676
|
+
with a key it does not have; write them as plain objects and arrays,
|
|
677
|
+
with the keys the spec names. Each shows as `step-file-import-failed`. A file that copied a step to change an
|
|
678
|
+
option passes the option to `defineStep` instead; a step listed in
|
|
679
|
+
`parts` is the one `defineStep` returned, too. A file that changed
|
|
680
|
+
another step's `parts` after the call throws at import, so `nuka check`
|
|
681
|
+
reports `step-file-import-failed` where it reported `part-cycle`.
|
|
682
|
+
|
|
683
|
+
- **`nuka tend` is removed; `nuka check` reports its findings.** `nuka
|
|
684
|
+
tend` now refuses with `removed-command`. A job that read
|
|
685
|
+
`nuka tend --json` runs `nuka check --json` on the whole project (no
|
|
686
|
+
feature targets) and keeps the findings whose `severity` is `"note"`,
|
|
687
|
+
for example `jq '.findings[] | select(.severity == "note")'`. A job that
|
|
688
|
+
ran `nuka tend --fail-on X` runs `nuka check --fail-on X`: the exit
|
|
689
|
+
code is 1 when the report contains `X`, and `--json` lists each hit in
|
|
690
|
+
`fail_on_hits`. `nuka check` with feature targets, and `nuka run`,
|
|
691
|
+
compute no notes, so a gate on a note runs a whole-project check.
|
|
692
|
+
`secrets-public-key-unknown` and `secrets-redact-key-unknown` are
|
|
693
|
+
warnings of every `nuka check`; neither changes the exit code unless
|
|
694
|
+
`--fail-on` lists it. The `scanned:` line and the field-description
|
|
695
|
+
totals of tend's summary have no replacement: `pattern-unbound` names
|
|
696
|
+
the directories it scanned in its own message.
|
|
697
|
+
|
|
698
|
+
- **`repeated-scenario-prefix` comes from `nuka run`.** Every `nuka run`
|
|
699
|
+
adds it to its own findings as a note, measured from that run: it is
|
|
700
|
+
in `run.json`'s `findings`, in the `--json` document, and on stderr
|
|
701
|
+
after the count line. It never changes the exit code. A job that read
|
|
702
|
+
it from the removed `nuka tend --json` reads the `findings` of the run
|
|
703
|
+
instead, and filters by `code`. A gate on it drops the code: `nuka
|
|
704
|
+
check --fail-on` refuses it with `fail-on-unknown-code`, because a
|
|
705
|
+
check report never contains it.
|
|
706
|
+
|
|
707
|
+
- **Four notes are gone.** `fixture-replaces-builtin`,
|
|
708
|
+
`fixture-touches-app`, `parameter-type-support-origin`, and
|
|
709
|
+
`post-navigation-read` are no longer reported. A job that gated on one
|
|
710
|
+
of them, or filtered `--json` for it, drops that gate: `nuka check
|
|
711
|
+
--fail-on` refuses the four codes with `fail-on-unknown-code`. Nothing
|
|
712
|
+
replaces them. The facts they named are still on disk for a person who
|
|
713
|
+
looks: a fixture's destructuring, a support-side `defineParameterType`,
|
|
714
|
+
a step record's `actions`.
|
|
715
|
+
|
|
716
|
+
- **`nuka run --probe` is removed.** Take the flag out of scripts and CI
|
|
717
|
+
jobs: it now refuses with `removed-flag`. A job that read
|
|
718
|
+
`then-passed-with-changed-capture` or `then-probe-not-measured` from
|
|
719
|
+
`findings`, or `probes` from run.json, drops that read. Nothing
|
|
720
|
+
replaces the note: read each Then's step record and step file.
|
|
721
|
+
|
|
722
|
+
- **The HTTP method counts are gone, and two version numbers moved.** A
|
|
723
|
+
reader of `observed.http_reads` or `observed.http_writes`, in a step
|
|
724
|
+
record or in run.json, drops them; the step record's `http.jsonl` lists
|
|
725
|
+
each request with its method. A reader that tests `schema_version`
|
|
726
|
+
accepts 4 for a step record, for run.json, and for every `--json`
|
|
727
|
+
document. `nuka report` refuses a run.json that an earlier release
|
|
728
|
+
wrote, so report a run with the release that ran it.
|
|
729
|
+
|
|
730
|
+
- **The run summary has no "Declared vs observed" section.** A job that
|
|
731
|
+
read it from `summary.md` drops that read.
|
|
732
|
+
|
|
733
|
+
- **`observed` has three more keys, and every one is always present.**
|
|
734
|
+
A reader that compares `observed` as a whole, such as
|
|
735
|
+
`{ "processes": null }`, compares
|
|
736
|
+
`{ "processes": null, "http": null, "files": null, "unmeasured": [] }`
|
|
737
|
+
instead; a reader that reads keys by name has nothing to do. A request
|
|
738
|
+
the step's own code sends through `fetch`, `node:http`, or
|
|
739
|
+
`node:https` is now a line in `http.jsonl`, so a job that counted
|
|
740
|
+
lines there counts these too, or filters on `via`.
|
|
741
|
+
|
|
742
|
+
- **`runCommand` keeps the `input` a step writes to stdin.** The new
|
|
743
|
+
`stdin` file is redacted only for a value loaded from an env file or
|
|
744
|
+
named in `redact`, the same rule as `command`, so a step that passes
|
|
745
|
+
a value it holds itself as `input` names it in `redact`. The content
|
|
746
|
+
in `observed.files` is redacted only for a value loaded from an env
|
|
747
|
+
file, so a secret a step writes to a file is one it loaded from an env
|
|
748
|
+
file.
|
|
749
|
+
|
|
750
|
+
- **Two more evidence names are the harness's.** `ctx.evidence.attach`
|
|
751
|
+
and `ctx.evidence.path` refuse `process-<n>.stdin.txt` and
|
|
752
|
+
`process-<n>.json` (the entry of a `runCommand` process that started
|
|
753
|
+
after its step ended) with `ReservedEvidenceNameError`, in any case. A
|
|
754
|
+
step that attached a file under either name picks another name.
|
|
755
|
+
|
|
756
|
+
- **The program under test moves to `nukadoko.program.ts`, and
|
|
757
|
+
`runServer` is gone.** A config or a step file that imports
|
|
758
|
+
`runServer` now fails to load. `nuka run` and `nuka check` print, for
|
|
759
|
+
a config:
|
|
760
|
+
|
|
761
|
+
```text
|
|
762
|
+
refused config-invalid - Could not import config at nukadoko.config.ts: The requested module 'nukadoko' does not provide an export named 'runServer' (nukadoko.config.ts:1); runServer was removed from nukadoko: nukadoko.program.ts describes the program under test now, and nukadoko starts it once per run with serve: { command, ready } and stops it after
|
|
763
|
+
fix: Remove runServer and the fixture that called it, and write the program's command in nukadoko.program.ts instead; docs/typescript/upgrading.md in the nukadoko package, under "The program under test moves to nukadoko.program.ts", shows the move.
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
A step file gets the same sentence and `fix:` line, as
|
|
767
|
+
`step-file-import-failed`. A config with `baseURL` or `environments`
|
|
768
|
+
is refused with `config-key-removed`:
|
|
769
|
+
|
|
770
|
+
```text
|
|
771
|
+
refused config-key-removed - Invalid config at nukadoko.config.ts: baseURL was removed: the program under test is described in nukadoko.program.ts. Write url there for a program nukadoko does not start (export default defineProgram({ url: "http://localhost:3000" })), or serve for one it starts; the system's URL is the baseURL every page and request resolves against. environments was removed: write each environment in nukadoko.program.ts, with its policy, envFiles, and version; its baseURL is url there, and --env starts that environment's system.
|
|
772
|
+
fix: Remove baseURL and environments from nukadoko.config.ts: write baseURL as url in nukadoko.program.ts (or serve, for a program nukadoko starts), and write each environment under environments in nukadoko.program.ts.
|
|
773
|
+
```
|
|
774
|
+
|
|
775
|
+
Write the program file beside the config and take those keys out of
|
|
776
|
+
the config. A server a fixture started with `runServer`:
|
|
777
|
+
|
|
778
|
+
```ts
|
|
779
|
+
// nukadoko.config.ts, before
|
|
780
|
+
import { defineConfig, defineFixtures, runServer } from "nukadoko";
|
|
781
|
+
|
|
782
|
+
export default defineConfig({
|
|
783
|
+
baseURL: "http://127.0.0.1:3000",
|
|
784
|
+
fixtures: defineFixtures({
|
|
785
|
+
server: async ({ baseURL }, use) => {
|
|
786
|
+
const server = await runServer("node", ["src/server.ts"], { url: baseURL });
|
|
787
|
+
await use(server);
|
|
788
|
+
await server.stop();
|
|
789
|
+
},
|
|
790
|
+
request: async ({ request, server }, use) => {
|
|
791
|
+
void server;
|
|
792
|
+
await use(request);
|
|
793
|
+
},
|
|
794
|
+
}),
|
|
795
|
+
});
|
|
796
|
+
```
|
|
797
|
+
|
|
798
|
+
```ts
|
|
799
|
+
// nukadoko.config.ts, after
|
|
800
|
+
import { defineConfig } from "nukadoko";
|
|
801
|
+
|
|
802
|
+
export default defineConfig({});
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
```ts
|
|
806
|
+
// nukadoko.config.ts
|
|
807
|
+
import { defineProgram } from "nukadoko";
|
|
808
|
+
|
|
809
|
+
export default defineProgram({
|
|
810
|
+
serve: { command: "node src/server.ts", ready: "/" },
|
|
811
|
+
env: { PORT: "{port}" },
|
|
812
|
+
});
|
|
813
|
+
```
|
|
814
|
+
|
|
815
|
+
Drop the `server` fixture, the `request` override that only started it,
|
|
816
|
+
and the `StepFixtures` declaration for `server`. nukadoko now picks the
|
|
817
|
+
port, so the program reads it from `PORT` (or from `{port}` in its
|
|
818
|
+
command) instead of listening at a fixed URL; `port: 3000` keeps a
|
|
819
|
+
fixed one, and nukadoko refuses it when something already answers
|
|
820
|
+
there. The program is ready when `ready` answers 2xx, not when the port
|
|
821
|
+
accepts a connection. It starts once per run instead of once per
|
|
822
|
+
scenario, so a scenario that relied on an empty server gets its state
|
|
823
|
+
from a Given, or the program's state goes in `{dir}` and `prepare`
|
|
824
|
+
resets it per system. A step that read `server.url` reads `baseURL`.
|
|
825
|
+
|
|
826
|
+
A `baseURL` and environments, with a server someone else starts:
|
|
827
|
+
|
|
828
|
+
```ts
|
|
829
|
+
// nukadoko.config.ts, before
|
|
830
|
+
export default defineConfig({
|
|
831
|
+
baseURL: "http://localhost:3000",
|
|
832
|
+
envFiles: [".env"],
|
|
833
|
+
environments: {
|
|
834
|
+
staging: { baseURL: "https://staging.acme.example", policy: "read-only", envFiles: [".env.staging"] },
|
|
835
|
+
},
|
|
836
|
+
});
|
|
837
|
+
```
|
|
838
|
+
|
|
839
|
+
```ts
|
|
840
|
+
// nukadoko.config.ts, after
|
|
841
|
+
export default defineConfig({ envFiles: [".env"] });
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
```ts
|
|
845
|
+
// nukadoko.config.ts
|
|
846
|
+
import { defineProgram } from "nukadoko";
|
|
847
|
+
|
|
848
|
+
export default defineProgram({
|
|
849
|
+
url: "http://localhost:3000",
|
|
850
|
+
environments: {
|
|
851
|
+
staging: { url: "https://staging.acme.example", policy: "read-only", envFiles: [".env.staging"] },
|
|
852
|
+
},
|
|
853
|
+
});
|
|
854
|
+
```
|
|
855
|
+
|
|
856
|
+
`nuka init --server` and `--server-url` refuse with `removed-flag`;
|
|
857
|
+
run `nuka init` and write the program file by hand. A reader of
|
|
858
|
+
run.json finds the new `systems` array, and each step record a new
|
|
859
|
+
`system_name`; both are additive. A CI step that started the app before
|
|
860
|
+
`nuka run` can go, once `serve` starts it.
|
|
861
|
+
|
|
862
|
+
A command-line tool whose steps run build output git ignores (`dist/`)
|
|
863
|
+
needs a program file too, for `--base`: the base and old trees hold
|
|
864
|
+
nothing git ignores, so give the file a `build` that makes the output
|
|
865
|
+
in each tree (`export default defineProgram({ build: ["npm run build"]
|
|
866
|
+
})`), and build at head before `nuka run` when a step file imports
|
|
867
|
+
it. Any tool configuration that names `nukadoko.config.ts`, such as a
|
|
868
|
+
`tsconfig.json` `include` or a lint or module-boundary checker's
|
|
869
|
+
exclude list, names `nukadoko.program.ts` beside it.
|
|
870
|
+
|
|
871
|
+
- **Requests to the system carry a `traceparent`, and `observed` has
|
|
872
|
+
`program_log` when the run has a system URL.** A step's requests to the
|
|
873
|
+
system's origin now carry a W3C `traceparent` header; a request that
|
|
874
|
+
sets its own keeps it. A reader that compares `observed` as a whole
|
|
875
|
+
adds `program_log` (`{ "trace_id", "lines", "file", "stamped" }`, or
|
|
876
|
+
`null` for a system at a `url`), and one that compares http.jsonl lines
|
|
877
|
+
as a whole adds `traceparent` to a line of a request nukadoko stamped.
|
|
878
|
+
To get each step's lines of the program's log, make the program write
|
|
879
|
+
the request's trace id into its log lines, and write them unbuffered:
|
|
880
|
+
docs/spec.md "Trace context and the program's log" shows the Rails and
|
|
881
|
+
Node lines. Until then, the run summary says once per system that the
|
|
882
|
+
log carries no trace ids, or that its lines arrived after the steps
|
|
883
|
+
ended.
|
|
884
|
+
|
|
885
|
+
- **A run without `--env` runs every environment that declares
|
|
886
|
+
`conditions`.** While no environment in `nukadoko.program.ts`
|
|
887
|
+
declares `conditions`, nothing changes: the run uses `default`. Once
|
|
888
|
+
one does, a run without `--env` runs each environment that declares
|
|
889
|
+
them, in the order the file lists them, and not `default`; an
|
|
890
|
+
environment with none, such as a deployment target, runs when `--env`
|
|
891
|
+
names it. A CI job that relied on `default` names `--env default`, or
|
|
892
|
+
the program file names the selection with `defaultEnvironments`.
|
|
893
|
+
`nuka do` without `--env` still uses `default`.
|
|
894
|
+
|
|
895
|
+
- **A tag that starts `@with:` or `@without:` names a condition.** A
|
|
896
|
+
suite that used such a tag for a meaning of its own gets
|
|
897
|
+
`condition-tag-malformed`, `condition-unknown`, or `condition-unmet`
|
|
898
|
+
from `nuka check`, and `nuka run` refuses to start. Rename the tag,
|
|
899
|
+
or declare the condition under the environments' `conditions`
|
|
900
|
+
(docs/spec.md "Verdicts").
|
|
901
|
+
|
|
902
|
+
- **run.json's `verdicts` is `table`.** A reader of `verdicts` reads
|
|
903
|
+
`table.rows`: one row per criterion, with `feature`, `line`, and
|
|
904
|
+
`name` (the old cell's `scenario`), one cell per environment in
|
|
905
|
+
`cells`, and the row's `verdict` (`held`, `proven`, or `failed`)
|
|
906
|
+
and `reason`. A cell's `outcome` (`pass`, `fail`, `broke`,
|
|
907
|
+
`flaky`, or `not-run`) replaces its `verdict`, and `runs` replaces
|
|
908
|
+
`executions`, and `conditions` names the conditions the cell's role
|
|
909
|
+
came from; there is no `passed`, so a reader that needs it counts
|
|
910
|
+
the passed entries in `scenarios`. A run with no condition tag has
|
|
911
|
+
only `required` cells, and its rows are `held` or `failed` as the
|
|
912
|
+
old cells were `passed` or `failed`. Each scenario entry has `role`,
|
|
913
|
+
and `counts` has `controls` and `controls_not_run`: `scenarios`,
|
|
914
|
+
`passed`, and `failed` count the executions of required cells only,
|
|
915
|
+
`not_run` counts the required cells that did not run, and a control
|
|
916
|
+
that failed has no `do`. The stderr count line counts required cells
|
|
917
|
+
alone too, and a run with a control adds a `<n> control runs` line
|
|
918
|
+
under it.
|
|
919
|
+
|
|
920
|
+
- **The run summary opens with the verdict table.** The per-feature
|
|
921
|
+
tables and the per-execution durations are gone; the title counts
|
|
922
|
+
criteria, and rows `held`, `proven`, and `failed`; and each red row
|
|
923
|
+
gets one line that says why. A job that parsed `summary.md` reads
|
|
924
|
+
run.json's `table` instead, and a duration from each scenario entry's
|
|
925
|
+
`started_at` and `finished_at`.
|
|
926
|
+
|
|
927
|
+
- **The Allure results and the messages stream carry the verdict.** Each
|
|
928
|
+
Allure result has one more parameter, `verdict`, `excluded`, so
|
|
929
|
+
`historyId` does not change, and one more label, `role`; a control's
|
|
930
|
+
result is named `<scenario> (control)`, with `fullName` unchanged. A
|
|
931
|
+
control that failed is a failed Allure result by design: gate CI on
|
|
932
|
+
`nuka run`'s exit code. The messages stream leaves out every control
|
|
933
|
+
execution, so a JUnit report counts required executions only, and each
|
|
934
|
+
test case has one more attachment, `verdict.json`, of media type
|
|
935
|
+
`application/vnd.nukadoko.verdict+json`. A consumer that counts a test
|
|
936
|
+
case's attachments counts one more.
|
|
937
|
+
|
|
938
|
+
- **`nuka run --since` is removed; `nuka run --base <ref>` judges what
|
|
939
|
+
`--since` reported.** `nuka run --since` is refused with
|
|
940
|
+
`removed-flag`. Replace it with `--base` and the same ref: `npx nuka
|
|
941
|
+
run --base "$(git merge-base HEAD origin/main)"` in place of `npx nuka
|
|
942
|
+
run --since "$(git merge-base HEAD origin/main)"`; the refusal's `do`
|
|
943
|
+
line is `nuka run --base` with the ref `--since` was given. Keep the
|
|
944
|
+
merge base rather than `origin/main`: once main has moved on since the
|
|
945
|
+
branch began, its tip holds criteria the branch never had, which read as
|
|
946
|
+
`removed`, and changes the branch never made, which read as the
|
|
947
|
+
branch's. Only a merge commit of the branch and main's tip, such as the
|
|
948
|
+
checkout of a GitHub `pull_request` event, compares with
|
|
949
|
+
`origin/main` as it is (docs/ci.md). `--since` only reported and never
|
|
950
|
+
failed a run; `--base` runs a new or changed criterion against the
|
|
951
|
+
base's code and an unchanged one under the base's steps when the
|
|
952
|
+
mapping changed, and exits 1 on an `unproven` or `moved` row
|
|
953
|
+
(docs/spec.md "Verdicts"). A CI job on a shallow clone fetches the base
|
|
954
|
+
first: the `base-shallow` refusal's `do` is the command. A project
|
|
955
|
+
whose `featuresDir` is the project root moves its features and steps
|
|
956
|
+
into a directory of their own before it can use `--base`.
|
|
957
|
+
|
|
958
|
+
The one commit that upgrades from 0.21.0 cannot pass `--base` with a
|
|
959
|
+
ref from before the upgrade. Its Thens become claim steps, so the
|
|
960
|
+
mapping changed, and every unchanged criterion runs in the old system:
|
|
961
|
+
the new release on the ref's step files, whose Thens still run code.
|
|
962
|
+
That tree does not pass `nuka check` (or its config does not load), so
|
|
963
|
+
every such row is `moved`, its `do:` line gives the same result, and
|
|
964
|
+
no edit at head can make it pass. Gate that commit with `nuka run`
|
|
965
|
+
without `--base`. The next change compares with a base that has the
|
|
966
|
+
new steps.
|
|
967
|
+
|
|
968
|
+
A scenario whose sentence the upgrade rewords is not `unchanged`, so
|
|
969
|
+
this does not apply to it: its row is `changed`, runs against the
|
|
970
|
+
base's code, and reads `unproven` when it passes there, never
|
|
971
|
+
`moved`, since nothing shows its Then failing without a change. When
|
|
972
|
+
only the wording changed and the base already has the behaviour, tag the
|
|
973
|
+
scenario `@held`; its row then reads `held` when it passes at the base.
|
|
974
|
+
|
|
975
|
+
- **run.json has no `since`, and a scenario entry has no `criteria`.**
|
|
976
|
+
A reader of `criteria.changed_since` reads the row's `change` in
|
|
977
|
+
`table.rows` (`unchanged`, `changed`, `new`, or `removed`, and
|
|
978
|
+
`renamed_from` for a criterion renamed or moved). `ambiguous` and
|
|
979
|
+
`unknown` are gone: a repeated name whose scenarios content cannot pair
|
|
980
|
+
is `new` and `removed`, and a base feature file that does not parse
|
|
981
|
+
gives a `base-feature-unparsed` warning and counts its criteria as
|
|
982
|
+
`new`. A reader of `since.removed` reads the `removed` rows, whose
|
|
983
|
+
`lines` hold the base's sentences. `since.step_files` has no
|
|
984
|
+
successor: the mapping is compared as one unit, and `table.mapping_changes`
|
|
985
|
+
names the files that changed. Under `--base`, `scenarios` also holds
|
|
986
|
+
the executions of the base and the old system, each with `system` and
|
|
987
|
+
`row`; a reader that counts head's executions skips the entries that
|
|
988
|
+
have `system`, as `counts` does.
|
|
989
|
+
|
|
990
|
+
- **The run summary has no "Criteria since" section.** Under `--base`,
|
|
991
|
+
one line above the table counts what changed and says whether the
|
|
992
|
+
mapping changed, the table has a `change` column and a column per base
|
|
993
|
+
and old environment, and "Removed criteria" quotes each removed
|
|
994
|
+
criterion.
|
|
995
|
+
|
|
996
|
+
- **The `since-*` refusal codes are gone.** `since-ref-unknown`,
|
|
997
|
+
`since-outside-git`, and `since-git-failed` are `base-ref-unknown`,
|
|
998
|
+
`base-outside-git`, and `base-git-failed`, and `base-shallow` and
|
|
999
|
+
`base-features-at-root` are new. A script that matched a `since-*`
|
|
1000
|
+
code matches the `base-*` one.
|
|
1001
|
+
|
|
1002
|
+
- **A step-file refactor runs every unchanged criterion in the old
|
|
1003
|
+
system.** The old system is head's code under the base's feature files and
|
|
1004
|
+
the base's steps, so a refactor that changes the mapping (a step file,
|
|
1005
|
+
a helper under the features directory, the config's `fixtures`, an
|
|
1006
|
+
environment's `conditions`) makes each unchanged row prove it still
|
|
1007
|
+
means what it meant: the base's steps run against head's code, and the
|
|
1008
|
+
row is `held` when they pass. The base's helpers under the features
|
|
1009
|
+
directory travel with the base's steps, so a helper moved or renamed
|
|
1010
|
+
there does not break them. What breaks them is code outside the
|
|
1011
|
+
features directory that the base's steps import and head changed: a
|
|
1012
|
+
module of the program they reach into, renamed or moved. The old
|
|
1013
|
+
mapping then does not load, every unchanged row is `moved`, and the
|
|
1014
|
+
reason names the import that failed. Keep that import working through
|
|
1015
|
+
the refactor (leave a re-export at the old path), or change what the
|
|
1016
|
+
steps import in one change and the program in a later one. A refactor
|
|
1017
|
+
that does neither leaves the gate red for its change, and a team that
|
|
1018
|
+
lands it anyway decides that outside nukadoko; the next change compares
|
|
1019
|
+
with a base that has the new steps.
|
|
1020
|
+
|
|
1021
|
+
- **A `url` function receives `tree`, and may return nothing for the
|
|
1022
|
+
base.** `tree` is `"base"` for the base system of `--base` and
|
|
1023
|
+
`"head"` otherwise. A function that has no URL for the base returns
|
|
1024
|
+
`undefined`, `null`, or `""`, and the base system runs no cell; a
|
|
1025
|
+
function that returns nothing for head fails the system with
|
|
1026
|
+
`program-start-failed`, as it did. A base system whose environment
|
|
1027
|
+
writes a fixed `url` runs no cell either, since that URL is head's.
|
|
1028
|
+
An existing `url` function has to branch on `tree` before `--base`
|
|
1029
|
+
can use it: one that returns head's URL for the base too leaves the
|
|
1030
|
+
base system's cells not run, with the reason `` the url function returned
|
|
1031
|
+
head's URL for the base tree; branch on `tree` ``.
|
|
1032
|
+
|
|
1033
|
+
- **A run that selects no scenario exits 1.** A CI job that runs
|
|
1034
|
+
`nuka run` on a target with no scenario yet, or with an `--env` that
|
|
1035
|
+
meets the conditions of none of the selected scenarios, went green
|
|
1036
|
+
and now fails with `nothing-selected`. Add the scenario, name a target
|
|
1037
|
+
that holds one, or name an environment that meets the scenarios; when
|
|
1038
|
+
`--env` left every scenario out, the finding's `do:` line is the run
|
|
1039
|
+
that does, with or without `--env`.
|
|
1040
|
+
|
|
1041
|
+
- **The `check-errors` refusal's `do:` line has no `:line`.** It names
|
|
1042
|
+
each targeted file once, so `nuka check` runs it; nothing changes in a
|
|
1043
|
+
project. A script that ran the old line got `line-not-supported`.
|
|
1044
|
+
|
|
1045
|
+
- **What a step prints is redacted on stderr.** A loaded secret that a
|
|
1046
|
+
step, hook, or fixture prints reads `{{secret.NAME}}` on stderr, as in
|
|
1047
|
+
its record. A script that read the value back from nukadoko's stderr
|
|
1048
|
+
reads it from the env file instead.
|
|
1049
|
+
|
|
1050
|
+
- **A system's progress lines name paths from the project root.** A
|
|
1051
|
+
`{dir}` or `{root}` in a command reads `.nukadoko/runs/<run_id>/systems/<environment>`
|
|
1052
|
+
or `.` on stderr; run.json's `systems[].commands` keeps the words the
|
|
1053
|
+
program received.
|
|
1054
|
+
|
|
1055
|
+
- **A step that calls `process.exit` fails.** `nuka run` and `nuka do`
|
|
1056
|
+
ended with the code the step passed; now the step fails with an error
|
|
1057
|
+
that names the call, and the run exits with its own code. A step that
|
|
1058
|
+
ended the run on purpose throws an error instead.
|
|
1059
|
+
|
|
1060
|
+
- **`nuka check <targets> --fail-on <note>` is refused.** A check with
|
|
1061
|
+
targets computes no notes, so the gate never fired and the job went
|
|
1062
|
+
green. Gate on a note with a check that names no target, as the
|
|
1063
|
+
refusal's `do:` line does, or leave the note out of `--fail-on`.
|
|
1064
|
+
|
|
1065
|
+
## 0.20.0 to 0.21.0
|
|
1066
|
+
|
|
1067
|
+
- **The skills have new names.** `acceptance` is `nukadoko`, and
|
|
1068
|
+
`verification` is `nukadoko-verification`. A host that installed them
|
|
1069
|
+
with `gh skill install meganemura/nukadoko --all` installs again and
|
|
1070
|
+
removes the copies under the old names. A path written as
|
|
1071
|
+
`<nuka skill path>/acceptance/` becomes `<nuka skill path>/nukadoko/`.
|
|
1072
|
+
|
|
1073
|
+
- **The migration skill is gone.** A host that installed it with
|
|
1074
|
+
`gh skill install meganemura/nukadoko --all` keeps the old copy until
|
|
1075
|
+
it is removed; remove it, and point an agent that is moving a suite at
|
|
1076
|
+
docs/typescript/migration.md instead. Its "Working rules" section carries what the
|
|
1077
|
+
skill said.
|
|
1078
|
+
|
|
1079
|
+
- **Two more evidence names are the harness's.** `ctx.evidence.attach`
|
|
1080
|
+
and `ctx.evidence.path` refuse `process-<n>.stdout.txt` and
|
|
1081
|
+
`process-<n>.stderr.txt` with `ReservedEvidenceNameError`, in any case:
|
|
1082
|
+
nukadoko now keeps what a `runCommand` process printed under those
|
|
1083
|
+
names. A step that attached a file under one of them picks another
|
|
1084
|
+
name. A step that attached a command's output only so a reviewer could
|
|
1085
|
+
read it can stop: the step record already names that file.
|
|
1086
|
+
|
|
1087
|
+
## 0.17.0 to 0.18.0
|
|
1088
|
+
|
|
1089
|
+
- **`nuka run --quiet` is removed.** It is refused with `removed-flag`.
|
|
1090
|
+
A CI step that wanted a short log runs `nuka run --json`: stderr is
|
|
1091
|
+
empty, and stdout is `run.json`.
|
|
1092
|
+
|
|
1093
|
+
- **Markdown oaths are removed.** The `oaths` config key is refused with
|
|
1094
|
+
`config-key-removed`, and a `.md` target of `nuka check` or `nuka run`
|
|
1095
|
+
is refused with `markdown-target`. Write the scenarios of each oath as
|
|
1096
|
+
Gherkin in a `.feature` file under `featuresDir`, then delete the
|
|
1097
|
+
`oaths` key.
|
|
1098
|
+
|
|
1099
|
+
- **Sessions are removed.** `nuka session list` and `nuka session clear`
|
|
1100
|
+
are refused with `removed-command`, and `nuka do --session` with
|
|
1101
|
+
`removed-flag`. Each `nuka do`
|
|
1102
|
+
call starts clean, as each scenario already did.
|
|
1103
|
+
- A step that needs login state gets it from a fixture. A project that
|
|
1104
|
+
keeps a Playwright storageState file names it in
|
|
1105
|
+
`browserContext.storageState` or `requestContext.storageState`, which
|
|
1106
|
+
the config now passes through to Playwright instead of refusing.
|
|
1107
|
+
- Run `nuka clean`, or delete `.nukadoko/cache/` by hand: nothing reads
|
|
1108
|
+
it, and `cache/sessions/` holds each session's browser storage state,
|
|
1109
|
+
cookies included, so a stale login stays on disk until it goes.
|
|
1110
|
+
`nuka clean` lists and removes it, and the `records/` directory an
|
|
1111
|
+
earlier release wrote, under `legacy` in its `--json` plan, beside
|
|
1112
|
+
`records` and `export`.
|
|
1113
|
+
- A step record's `schema_version` is 3, and the record has no
|
|
1114
|
+
`session` field. A reader that checks `schema_version === 2` checks 3.
|
|
1115
|
+
|
|
1116
|
+
- **`nuka experimental explore` and its model API are removed.** The
|
|
1117
|
+
command (and the older `nuka explore` spelling) is refused with
|
|
1118
|
+
`removed-command`. `experimental_defineModel`,
|
|
1119
|
+
`experimental_defineRelation`, `experimental_modelCommand`, and
|
|
1120
|
+
`experimental_relationEntry` are no longer exported from `nukadoko`, so
|
|
1121
|
+
a file that imports them fails to load. Write each sequence worth
|
|
1122
|
+
keeping as a scenario, then delete the model and relation files. The
|
|
1123
|
+
`explore-*` finding codes are gone.
|
|
1124
|
+
|
|
1125
|
+
- **`nukadoko/mcp` is removed**, with the optional peer dependency on
|
|
1126
|
+
`@modelcontextprotocol/client`. A fixture that called `connectMcpServer`
|
|
1127
|
+
or `callMcpTool` uses the SDK's own client: add
|
|
1128
|
+
`@modelcontextprotocol/client` to the project, build a `Client` with a
|
|
1129
|
+
`StdioClientTransport` (from `@modelcontextprotocol/client/stdio`) in
|
|
1130
|
+
the fixture's setup, and close it in its teardown. A later release
|
|
1131
|
+
measures that client's calls: see the MCP item under "0.24.0 to the next
|
|
1132
|
+
release".
|
|
1133
|
+
|
|
1134
|
+
- **Each run is one directory, `.nukadoko/runs/<run_id>/`, and
|
|
1135
|
+
`records/` is no longer written.** A script, a CI step, or a tool that
|
|
1136
|
+
reads the state directory changes these paths:
|
|
1137
|
+
- `.nukadoko/records/runs/<run_id>/run.json`, `summary.md`, and
|
|
1138
|
+
`exports` are `.nukadoko/runs/<run_id>/run.json`, `summary.md`, and
|
|
1139
|
+
`exports`.
|
|
1140
|
+
- `.nukadoko/records/steps/<id>/` is
|
|
1141
|
+
`.nukadoko/runs/<run_id>/steps/<id>/` for a step `nuka run` ran, and
|
|
1142
|
+
`.nukadoko/do/<id>/` for a `nuka do` call.
|
|
1143
|
+
- `.nukadoko/records/scenarios/<id>/` is
|
|
1144
|
+
`.nukadoko/runs/<run_id>/scenarios/<id>/`.
|
|
1145
|
+
- Every path inside `run.json` (a step's `record`, a `used` entry's
|
|
1146
|
+
`record`, a scenario's `evidence.dir`) is relative to the run
|
|
1147
|
+
directory: `steps/<id>`, not `.nukadoko/records/steps/<id>`. Join it
|
|
1148
|
+
with the directory that holds `run.json`. The run summary's `record`
|
|
1149
|
+
cell is the same path. A step record's own `evidence.dir` is still
|
|
1150
|
+
relative to the project root.
|
|
1151
|
+
- A CI step that uploaded `.nukadoko/records/` uploads
|
|
1152
|
+
`.nukadoko/runs/` (docs/ci.md has a pinned `actions/upload-artifact`
|
|
1153
|
+
step; `.nukadoko` is a hidden directory, so it sets
|
|
1154
|
+
`include-hidden-files: true`).
|
|
1155
|
+
- A script that matched the retention line's age clause matches
|
|
1156
|
+
`unfinished runs and nuka do records older than`.
|
|
1157
|
+
A `.nukadoko/records/` directory an earlier release left is not read,
|
|
1158
|
+
and neither retention nor `nuka clean` removes it: delete it by hand
|
|
1159
|
+
(`rm -rf .nukadoko/records`). `nuka do --use` with an id from
|
|
1160
|
+
that directory is refused as not found; run the producing step again.
|
|
1161
|
+
The export output does not move.
|
|
1162
|
+
|
|
1163
|
+
- **`run.json` holds the whole run, and scenario record files are gone.**
|
|
1164
|
+
A script that read `run.json` or `nuka run --json` changes these reads:
|
|
1165
|
+
- `schema_version` is 2, the envelope's, and the document starts with
|
|
1166
|
+
`command: "run"`, `verdict`, and `findings`, which now holds every
|
|
1167
|
+
warning the run raised as well as each failed scenario.
|
|
1168
|
+
- A scenario's `rerun` is its `do`, present only on a failed scenario.
|
|
1169
|
+
Its `record` (the path of a scenario record file) is gone; read its
|
|
1170
|
+
`steps` instead: each step has `line`, `text`, `step`, `status`,
|
|
1171
|
+
`step_record_id`, `record` (the step record's directory), and for a
|
|
1172
|
+
failure `error.kind`, `error.message`, and `used`.
|
|
1173
|
+
- The top-level `summary` path is gone. The summary is
|
|
1174
|
+
`summary.md` in the same directory as `run.json`.
|
|
1175
|
+
- `commit` (`sha`, `dirty`), `target_version`, and `selection` are new.
|
|
1176
|
+
A script that tested a scenario record's `git.clean` tests
|
|
1177
|
+
`!commit.dirty`.
|
|
1178
|
+
- A script that read `.nukadoko/records/scenarios/<id>/record.json`
|
|
1179
|
+
reads that scenario's entry in `run.json`; the file is no longer
|
|
1180
|
+
written, and a scenario that wrote no screenshot, hook trace, or
|
|
1181
|
+
attachment leaves no scenario evidence directory (see the run
|
|
1182
|
+
directory item above for where one now lives).
|
|
1183
|
+
- A script that matched the "Partial run" paragraph on stderr reads
|
|
1184
|
+
`selection` in `run.json`, `partial` or `full`, or the
|
|
1185
|
+
`- selection:` line of the run summary.
|
|
1186
|
+
- A `--records` line is now a scenario's `run.json` entry: it has no
|
|
1187
|
+
`run_id`, `environment`, `git`, `nukadoko`, or
|
|
1188
|
+
`schema_version`; read those from `run.json`.
|
|
1189
|
+
The run summary gains a `- selection:` line and a "Findings" section; a
|
|
1190
|
+
CI step that only posts it needs nothing.
|
|
1191
|
+
|
|
1192
|
+
- **Every command's `--json` is one envelope, and every finding has one
|
|
1193
|
+
grammar.** A script that reads `--json` reads
|
|
1194
|
+
`{ schema_version: 2, nukadoko, command, verdict, findings, ... }`:
|
|
1195
|
+
- `errors`, `warnings`, and `notes` are gone. Filter `findings` by
|
|
1196
|
+
`severity` (`error`, `warning`, `note`, `refused`, `failed`).
|
|
1197
|
+
- A refusal is no longer `{ error, do }`. It is a finding with severity
|
|
1198
|
+
`refused` and a code, and the exit is still 2. Switch on `code`, not on
|
|
1199
|
+
the message.
|
|
1200
|
+
- `nuka steps --json` keeps `steps` beside `findings`; its
|
|
1201
|
+
`import_failures` are `step-file-import-failed` or
|
|
1202
|
+
`playwright-missing` findings. `nuka describe` keeps its contract
|
|
1203
|
+
fields beside `findings`. `nuka tend --json` keeps `summary` and
|
|
1204
|
+
`fail_on_hits`. `nuka run --json` keeps the `run.json` fields.
|
|
1205
|
+
`nuka check --codes --json` and `nuka tend --codes --json` keep
|
|
1206
|
+
`codes`, and each entry is a finding: its meaning is `message`, not
|
|
1207
|
+
`description`, and its general edit is `fix`, not `do`.
|
|
1208
|
+
- `verdict` is `passed`, `failed`, or `refused`, for exit 0, 1, and 2.
|
|
1209
|
+
- **A finding's text is `<severity>\t<code>\t<where>\t<message>`, then
|
|
1210
|
+
` fix:` and ` do:` lines.** A parser of `nuka check` text reads the
|
|
1211
|
+
severity in the first column. ` do:` is now only a command a shell runs
|
|
1212
|
+
as written; a hint in words, such as "Escape the bare ( ) ...", is on a
|
|
1213
|
+
` fix:` line. A script that ran every `do:` line as prose stops reading
|
|
1214
|
+
it as prose; a script that runs it can run it as it is.
|
|
1215
|
+
- **A failed scenario is a `scenario-failed` finding.** The `failed` and
|
|
1216
|
+
`rerun` lines on stderr are gone. A script that grepped `rerun` reads
|
|
1217
|
+
the ` do: nuka run <feature>:<line>` line under each
|
|
1218
|
+
`failed\tscenario-failed\t` line, or each failed scenario's `do` in
|
|
1219
|
+
`run.json`.
|
|
1220
|
+
- **Warnings are findings with codes.** The no-config line is
|
|
1221
|
+
`warning\tconfig-missing\t-\t...` on stderr, and under `--json` it is
|
|
1222
|
+
in `findings`, with stderr empty. The same holds for a failed fixture
|
|
1223
|
+
teardown (`fixture-teardown-failed`), an emitter failure
|
|
1224
|
+
(`emitter-failed`), a version probe that did not answer
|
|
1225
|
+
(`version-probe-failed`), and the other run warnings `nuka check
|
|
1226
|
+
--codes` lists. A script that matched `Warning:` on stderr matches the
|
|
1227
|
+
`warning` column and the code.
|
|
1228
|
+
- **An `undefined-step` message no longer names the scaffold command.**
|
|
1229
|
+
The command is on the ` do:` line. Each line with an undefined step
|
|
1230
|
+
has its own finding now, also a second line with the same text, so a
|
|
1231
|
+
count of `undefined-step` findings is a count of lines.
|
|
1232
|
+
|
|
1233
|
+
- **`nuka run` writes scenario records to stdout only under `--records`.**
|
|
1234
|
+
A pipe, a file, a CI log, and an agent's shell no longer get one JSON
|
|
1235
|
+
record per line by default; stdout stays empty. A script that parsed
|
|
1236
|
+
that stream picks one of three: add `--records` to the `nuka run` it
|
|
1237
|
+
reads (each line is now a scenario's `run.json` entry, see the
|
|
1238
|
+
`run.json` item below), switch to `--json`, or read
|
|
1239
|
+
`.nukadoko/runs/<run_id>/run.json`, which the run writes either
|
|
1240
|
+
way. A CI step that only shows the log needs nothing. The run summary, the
|
|
1241
|
+
stderr lines, and `nuka do`'s stdout do not change.
|
|
1242
|
+
- **`evidence.attach` and `evidence.path` refuse `trace.<name>.zip` and
|
|
1243
|
+
`final.<name>.png`.** A `pageAs(name)` context writes those files beside
|
|
1244
|
+
a step's own `trace.zip` and `final.png`, so the names are reserved for
|
|
1245
|
+
every valid context name, in any case, with
|
|
1246
|
+
`ReservedEvidenceNameError`. A step that attached a file under such a
|
|
1247
|
+
name renames it, for example `trace-aki.zip` or `aki-final.png`.
|
|
1248
|
+
- **`nuka tend` reports every code, and `--all` is removed.** A plain
|
|
1249
|
+
`nuka tend` now reports `schema-field-undescribed` too, in text and in
|
|
1250
|
+
`--json`. `nuka tend --all` exits 2 and says so; drop the flag. A job
|
|
1251
|
+
that reads plain `--json` and acts on some codes only filters
|
|
1252
|
+
`findings` by `code`, or passes `--fail-on` for each code it acts on.
|
|
1253
|
+
`nuka tend --codes` prints each code as a finding (see the next item),
|
|
1254
|
+
with no `reportedByDefault` on an entry.
|
|
1255
|
+
- **A step record's `observed` channels are `null` when the step never
|
|
1256
|
+
reached them.** `http_reads` and `http_writes` are both `null` for a step
|
|
1257
|
+
that called none of `ctx.request()`, `ctx.page()`, and `pageAs()` and
|
|
1258
|
+
had no request recorded, and `observed.processes` is `null`, not absent,
|
|
1259
|
+
for a step that never called `runCommand`. The step record's
|
|
1260
|
+
`schema_version` is 2. A script that sums the counts treats `null` as
|
|
1261
|
+
"not measured", not as `0`; a script that tested for a missing
|
|
1262
|
+
`processes` key tests for `null`. A step whose zero count should mean
|
|
1263
|
+
something calls the server through the `request` fixture instead of
|
|
1264
|
+
`fetch`.
|
|
1265
|
+
- **`--json` prints one document and nothing around it.** A script that
|
|
1266
|
+
scraped `nuka run --json`'s stderr for the `run` path, the count line, or
|
|
1267
|
+
a `rerun` line reads them from the document instead: `counts` and each
|
|
1268
|
+
failed scenario's `do`. A script that split a `--json`
|
|
1269
|
+
refusal by lines parses stdout as one JSON value; it is pretty-printed
|
|
1270
|
+
now. A test that compared `nuka steps` text at a terminal width other
|
|
1271
|
+
than 80 compares at 80.
|
|
1272
|
+
- **`run.json` names every environment of the run, and holds one verdict
|
|
1273
|
+
per scenario and environment.** What changes for a reader of a run:
|
|
1274
|
+
- A script that read `run.json`'s `environment` reads
|
|
1275
|
+
`environments[0].name`, and `target_version` is
|
|
1276
|
+
`environments[0].target_version`. A run without `--env` has one entry,
|
|
1277
|
+
`default`.
|
|
1278
|
+
- A script that judged a scenario by its entries in `scenarios` reads
|
|
1279
|
+
`verdicts`, one cell per scenario and environment with `verdict`,
|
|
1280
|
+
`executions`, and `passed`. Each `scenarios` entry also names its
|
|
1281
|
+
`environment`.
|
|
1282
|
+
- A script that parsed the run summary's table reads the column named
|
|
1283
|
+
after the environment (`default` without `--env`) where it read
|
|
1284
|
+
`status`, and one row per scenario where `--repeat` gave one row per
|
|
1285
|
+
execution.
|
|
1286
|
+
- A CI job that ran `nuka run --env` once per environment can run
|
|
1287
|
+
`nuka run --env a --env b` as one step, with one summary.
|
|
1288
|
+
- An Allure history keyed on the old history ids starts over once: the
|
|
1289
|
+
environment is now part of a result's identity.
|
|
1290
|
+
|
|
1291
|
+
- **`nuka run` writes no Allure results or messages stream; `nuka report`
|
|
1292
|
+
renders them after the run.** The `allure` and `messages` config keys
|
|
1293
|
+
are refused with `config-key-removed`, and `nuka run --summary` with
|
|
1294
|
+
`removed-flag`.
|
|
1295
|
+
- Delete the `allure` and `messages` keys from the config.
|
|
1296
|
+
- Where a script or CI step read `.nukadoko/export/allure-results/`
|
|
1297
|
+
after `nuka run`, run `nuka report --format allure` after the run
|
|
1298
|
+
first. Where `allure.resultsDir` moved it, pass that directory as
|
|
1299
|
+
`--out`.
|
|
1300
|
+
- Where it read `messages.ndjson`, run `nuka report --format messages
|
|
1301
|
+
--out <path>`; where it read `messages.<run_id>.ndjson`, render that run
|
|
1302
|
+
with `nuka report .nukadoko/runs/<run_id> --format messages --out
|
|
1303
|
+
<path>`.
|
|
1304
|
+
- Where `nuka run --summary <path>` wrote a pull request comment, run
|
|
1305
|
+
`nuka report --format markdown --out <path>` in a step after the run,
|
|
1306
|
+
with `if: always()` so a red run is posted too.
|
|
1307
|
+
- A run from an earlier release has no `sources.json`, so its Allure or
|
|
1308
|
+
messages render is refused with `run-sources-missing`: run the
|
|
1309
|
+
scenarios again to render them.
|
|
1310
|
+
- An Allure history carries on: the result identity is unchanged. The
|
|
1311
|
+
`host` and `thread` labels are gone, and `allure watch` shows a run
|
|
1312
|
+
when it is rendered, not while it runs.
|
|
1313
|
+
- A JUnit or HTML report built from a messages stream of a run over
|
|
1314
|
+
several environments shows each scenario once per environment, named
|
|
1315
|
+
`<scenario> (<environment>)`.
|
|
1316
|
+
- A script that matched the `emitter-failed` or
|
|
1317
|
+
`export-path-outside-project` code matches `report-incomplete`; the
|
|
1318
|
+
second has no successor, since `nuka clean` no longer reads paths from
|
|
1319
|
+
the config. `emitter-failed` was a warning, and `report-incomplete`
|
|
1320
|
+
makes `nuka report` exit 1: a CI step that renders a run whose
|
|
1321
|
+
directory lost a file fails, so upload the whole run directory.
|
|
1322
|
+
- `nuka clean` removes under `.nukadoko/export/` only the files a run's
|
|
1323
|
+
exports manifest names and the contents of `allure-results/`. A file
|
|
1324
|
+
nukadoko did not write there, such as an `allure generate` report,
|
|
1325
|
+
stays; delete it yourself if a clean used to.
|
|
1326
|
+
|
|
1327
|
+
- **An env file that cannot be read is refused with
|
|
1328
|
+
`env-file-unreadable`, exit 2, under `nuka run --no-check` too.** It was
|
|
1329
|
+
`unexpected-error` under every command, and an `error` finding with exit
|
|
1330
|
+
1 under `--no-check`. A script that matched `unexpected-error` for an
|
|
1331
|
+
unreadable env file, or read exit 1 there as a failed run, matches
|
|
1332
|
+
`env-file-unreadable` and exit 2: nothing ran.
|
|
1333
|
+
|
|
1334
|
+
## 0.16.1 to 0.17.0
|
|
1335
|
+
|
|
1336
|
+
- **`nuka run` writes no scenario record to stdout when stdout is a
|
|
1337
|
+
terminal.** A pipe, a file, a CI log, and a shell an agent drives through
|
|
1338
|
+
a pipe still get one JSON record per line, unchanged. A tool that runs
|
|
1339
|
+
`nuka run` under a pseudo-terminal and parses its stdout passes
|
|
1340
|
+
`--records`, which writes them to a terminal too. The records on disk,
|
|
1341
|
+
the stderr lines, and `nuka do`'s stdout do not change.
|
|
1342
|
+
- **Node 22.18.0 or later on the 22 line, or 23.6.0 or later.**
|
|
1343
|
+
`engines.node` is `^22.18.0 || >=23.6.0`. These are the first releases
|
|
1344
|
+
in which Node strips TypeScript types with no flag, and nukadoko now
|
|
1345
|
+
loads the config, the step files, and everything they import through
|
|
1346
|
+
Node itself. It no longer depends on tsx. A CI job pinned to Node 20 or
|
|
1347
|
+
to an earlier 22 moves to a supported version: `docs/ci.md` uses 24.
|
|
1348
|
+
Node 23.6 to 23.x prints an `ExperimentalWarning` the first time it
|
|
1349
|
+
loads a `.ts` file; 22.18 and 24 and later do not.
|
|
1350
|
+
- **Only TypeScript that erasing its types leaves intact loads.** An
|
|
1351
|
+
`enum`, a `namespace` with values in it, and a constructor parameter
|
|
1352
|
+
property have run-time behavior, so Node refuses the file. This holds
|
|
1353
|
+
for a project file a step file imports too. `nuka check` reports
|
|
1354
|
+
`step-file-import-failed` with the file, the line, and what to write
|
|
1355
|
+
instead: an enum becomes an object with `as const`, and a parameter
|
|
1356
|
+
property becomes a field assigned in the constructor. Set
|
|
1357
|
+
`"erasableSyntaxOnly": true` (TypeScript 5.8 and later) in
|
|
1358
|
+
`tsconfig.json`, and `tsc` reports each one before nuka does. On Node
|
|
1359
|
+
23.x, Node's report names no file. The finding still names the line
|
|
1360
|
+
when the step file itself holds the syntax; when an imported module
|
|
1361
|
+
holds it, the finding has no line and says so.
|
|
1362
|
+
- **A type imported without `type` fails to load.** Node cannot tell that
|
|
1363
|
+
`import { Options } from "./options.ts"` names only a type, so the import
|
|
1364
|
+
fails with "does not provide an export named 'Options'". Write
|
|
1365
|
+
`import type { Options }` or `import { type Options }`. With
|
|
1366
|
+
`"verbatimModuleSyntax": true`, `tsc` requires that spelling. For a
|
|
1367
|
+
type that nukadoko exports, such as `IWorldOptions` from
|
|
1368
|
+
`nukadoko/compat`, `nuka check`'s finding says to write `import type`.
|
|
1369
|
+
- **`nuka scaffold` imports a `--from` producer by its `.ts` name when
|
|
1370
|
+
`tsc` accepts one.** A step scaffolded with `--from run-greet.<key>`
|
|
1371
|
+
imports `./run-greet.ts` when `tsconfig.json`, or a file it extends,
|
|
1372
|
+
sets `rewriteRelativeImportExtensions` or `allowImportingTsExtensions`
|
|
1373
|
+
to true, and when the project has no `tsconfig.json`. Otherwise it
|
|
1374
|
+
imports `./run-greet.js` and prints a `note:` line on stderr that names
|
|
1375
|
+
the option. A step file that already imports by the `.js` name keeps
|
|
1376
|
+
loading under nuka, which falls back to the `.ts` file when no `.js` file
|
|
1377
|
+
exists, so renaming is optional. A plain `node` run of that file does not
|
|
1378
|
+
fall back. For `tsc` to accept a `.ts` name, `tsconfig.json` needs
|
|
1379
|
+
`"rewriteRelativeImportExtensions": true` (TypeScript 5.7 and later) or
|
|
1380
|
+
`"allowImportingTsExtensions": true` (which `tsc` accepts only with
|
|
1381
|
+
`noEmit`). `nuka init` now adds the first one to a `tsconfig.json` that
|
|
1382
|
+
has `compilerOptions` of its own and names neither option, unless a
|
|
1383
|
+
file it `extends` names one. A `tsconfig.json` whose options come only
|
|
1384
|
+
through `extends` gets a line on stderr instead. A project initialized
|
|
1385
|
+
before this release adds it by hand.
|
|
1386
|
+
- **`paths` and `baseUrl` in `tsconfig.json` no longer resolve at run
|
|
1387
|
+
time.** tsx read them; Node does not. A step file that imports
|
|
1388
|
+
`@app/server` through `paths` fails to import. Use a relative path, or a
|
|
1389
|
+
`#app/*` entry in `package.json`'s `imports`, which Node and `tsc` both
|
|
1390
|
+
read.
|
|
1391
|
+
- **A `package.json` with no `"type"` now loads a `.ts` file written as an
|
|
1392
|
+
ES module.** Node reparses it, and prints a `MODULE_TYPELESS_PACKAGE_JSON`
|
|
1393
|
+
warning for each such file. `nuka init` still writes
|
|
1394
|
+
`nukadoko.config.mts` there, and `.mts` step files load with no warning.
|
|
1395
|
+
Add `"type": "module"` to `package.json` to keep `.ts` names with no
|
|
1396
|
+
warning. `nuka tend` reports this as `package-type-missing`. With `"type": "commonjs"`, a `.ts` file still fails to import,
|
|
1397
|
+
and the error says to rename it to `.mts`.
|
|
1398
|
+
- **`undefined-step`'s message names `nuka scaffold --feature <file>`.**
|
|
1399
|
+
It used to end with "run `nuka scaffold <name>` to add one"; it now
|
|
1400
|
+
names the feature file the line is in, so the command writes a stub for
|
|
1401
|
+
every undefined line of that file. The code and its `file` and `line`
|
|
1402
|
+
are unchanged. Under `nuka run --no-check`, an undefined step's
|
|
1403
|
+
`error.message` in the scenario record changes the same way. A script
|
|
1404
|
+
that matches the old sentence matches on the code instead, or on the
|
|
1405
|
+
step's `status: "undefined"` in a scenario record.
|
|
1406
|
+
- **A step record that passed says `"status": "passed"`, not `"ok"`.** The
|
|
1407
|
+
same word now means success in a step record, in a scenario record's
|
|
1408
|
+
`steps[]` and `hooks[]`, and in `nuka experimental explore --json`'s
|
|
1409
|
+
`steps[]`. A
|
|
1410
|
+
script or a jq filter that tests `.status == "ok"` tests `"passed"`. A
|
|
1411
|
+
record that nukadoko 0.16.1 or earlier wrote still says `"ok"` on disk; `nuka do
|
|
1412
|
+
--use` and the emitters read it as `"passed"`, so it can
|
|
1413
|
+
stay until retention removes it. The exported TypeScript type
|
|
1414
|
+
`StepRecordOk` is now `StepRecordPassed`.
|
|
1415
|
+
- **`nuka run`'s step lines on stderr say `passed`, `failed`, and
|
|
1416
|
+
`skipped`, not `ok`, `FAIL`, and `skip`.** They now use the word the
|
|
1417
|
+
step record uses for the same outcome. A script that searches a CI log
|
|
1418
|
+
for ` FAIL ` searches for ` failed `.
|
|
1419
|
+
- **`nuka tend --json` names its summary keys in snake_case.**
|
|
1420
|
+
`typedSteps`, `compatSteps`, `compatStepNames`, `scannedFeatureDirs`, and
|
|
1421
|
+
`readOnlySteps` become `typed_steps`, `compat_steps`,
|
|
1422
|
+
`compat_step_names`, `scanned_feature_dirs`, and `read_only_steps`.
|
|
1423
|
+
`describe` keeps its name.
|
|
1424
|
+
- **`nuka describe` shows `from` in the shape `nuka steps --json` uses.**
|
|
1425
|
+
A key with one producer is `{ "step": "create-project", "key": "id" }`
|
|
1426
|
+
instead of the string `"create-project.id"`, and a key with several is
|
|
1427
|
+
an array of those objects instead of `"either of A or B"`.
|
|
1428
|
+
- **`nuka run --session` is gone.** It exits 2 and writes nothing. A
|
|
1429
|
+
scenario that needs login state gets it from a fixture or a Given step
|
|
1430
|
+
its feature names, so each scenario starts clean whatever ran before it
|
|
1431
|
+
and at any `--concurrency`. A fixture that signs in with `scope: "process"`
|
|
1432
|
+
logs in once per process, not once per scenario. `nuka do
|
|
1433
|
+
--session <name>` is unchanged.
|
|
1434
|
+
- **`nuka init` takes `--allure` only.** `--base-url`, `--features-dir`,
|
|
1435
|
+
and `--env` exit 2, name what replaces them, and write nothing. Set
|
|
1436
|
+
`baseURL` in the generated config after `init`. For a features
|
|
1437
|
+
directory other than `features/`, set `featuresDir` in the config and
|
|
1438
|
+
move `features/steps/` there. `init` now always adds `.env`, `.env.*`,
|
|
1439
|
+
and `!.env.example` to `.gitignore`; delete those lines if the project
|
|
1440
|
+
commits a `.env` on purpose. (`--env` was briefly spelled
|
|
1441
|
+
`--env-files` before this release; that spelling is refused the same
|
|
1442
|
+
way.)
|
|
1443
|
+
- **`nuka clean` takes `--dry-run` and `--json` only.** `--records`,
|
|
1444
|
+
`--cache`, and `--export` exit 2 and remove nothing. `nuka clean`
|
|
1445
|
+
always removes records, cache, and export together. To keep one of
|
|
1446
|
+
them, copy it out of `.nukadoko/` first, or let retention remove old
|
|
1447
|
+
runs on its own at the end of every `nuka run`.
|
|
1448
|
+
- **`nuka check --codes --json` and `nuka session list --json` print an
|
|
1449
|
+
object, not a bare array.** Every JSON document now starts with
|
|
1450
|
+
`schema_version`, and an array has no place for it. The list moved under
|
|
1451
|
+
one key: `{ "schema_version": 1, "codes": [...] }` and
|
|
1452
|
+
`{ "schema_version": 1, "sessions": [...] }`. A jq filter `.[]` becomes
|
|
1453
|
+
`.codes[]` or `.sessions[]`. Every other document only gained the
|
|
1454
|
+
`schema_version` key in front, and the step and scenario records also
|
|
1455
|
+
gained `nukadoko`.
|
|
1456
|
+
- **`records/runs/<run_id>/complete.json` is now `run.json`.** The run's
|
|
1457
|
+
completion marker grew into its whole result: `verdict`, `finished_at`,
|
|
1458
|
+
and `counts.failed` hold what `complete.json` held as `verdict`,
|
|
1459
|
+
`finished_at`, and `failed_scenarios`, beside the run id, every scenario
|
|
1460
|
+
with its record and rerun command, and the summary path. A script that
|
|
1461
|
+
read `complete.json` reads `run.json`, or runs `nuka run --json` and
|
|
1462
|
+
reads stdout. Runs written by 0.16.1 or earlier have only `complete.json`, which
|
|
1463
|
+
retention no longer reads as proof that they ended, so it keeps them
|
|
1464
|
+
until they are older than `retention.adHocDays`; `nuka clean` removes
|
|
1465
|
+
them now (it also removes the cache and the export, so copy out what you
|
|
1466
|
+
keep first).
|
|
1467
|
+
- **`nuka scaffold` refuses to write below a directory that holds the
|
|
1468
|
+
config.** Run where neither `nukadoko.config.ts` nor
|
|
1469
|
+
`nukadoko.config.mts` exists, while a parent directory up to the nearest
|
|
1470
|
+
`.git` has one, it exits 2 with `Refusing to scaffold:` and the relative
|
|
1471
|
+
path to that config, where it used to write a step file the config never
|
|
1472
|
+
read. Run `nuka scaffold` from the directory that holds the config; in a
|
|
1473
|
+
workspace that is the package. A script that scaffolded from a
|
|
1474
|
+
subdirectory moves its `cd`. Every other command keeps its exit code and
|
|
1475
|
+
stdout, and adds one stderr line that names the missing config.
|
|
1476
|
+
- **A project on a later Playwright 1.x keeps it.** The `playwright` peer
|
|
1477
|
+
range is `^1.61.1` now, not the exact `1.61.1`, so npm installs nukadoko
|
|
1478
|
+
beside any later 1.x without `ERESOLVE`. A project that pinned its own
|
|
1479
|
+
`playwright` to 1.61.1 only for nukadoko can move it forward. nukadoko is
|
|
1480
|
+
still tested against 1.61.1, and the `playwright-missing` install line
|
|
1481
|
+
still names that version.
|
|
1482
|
+
- **`defineStep` no longer takes `rationale`.** Delete the `rationale:`
|
|
1483
|
+
lines from your step files. Until you do, `nuka check` warns
|
|
1484
|
+
`step-option-ignored` once for each, naming the step file, and `tsc`
|
|
1485
|
+
reports each one as an excess property where `tsconfig.json` includes
|
|
1486
|
+
the step files. `nuka` ignores the value at run time, so runs do
|
|
1487
|
+
not change. A reason worth keeping can move into a comment above
|
|
1488
|
+
`defineStep`. `nuka describe` prints no `rationale` key, and `nuka
|
|
1489
|
+
tend --json` has no `summary.rationale`.
|
|
1490
|
+
- **A step with no `returns` fails when `run` returns an object with
|
|
1491
|
+
keys.** The value used to be dropped and the step record held `{}`
|
|
1492
|
+
while the step passed. Now the step fails with `result_invalid`, and
|
|
1493
|
+
the message names the keys. Declare `returns` with those keys if the
|
|
1494
|
+
value is worth keeping in the record, or stop returning it. `tsc`
|
|
1495
|
+
already rejected such a return where `tsconfig.json` includes the step
|
|
1496
|
+
files, so a project that typechecks them sees no change.
|
|
1497
|
+
- **`nuka tend` no longer reports `step-rationale-missing`,
|
|
1498
|
+
`additional-feature-dir-missing`, or `import-failures-unseen`.** The
|
|
1499
|
+
first went with `rationale`. The other two said what `nuka check` already
|
|
1500
|
+
reports, as `additional-feature-dir-missing` (an error) and
|
|
1501
|
+
`step-file-import-failed`, so gate on `nuka check`'s exit code instead.
|
|
1502
|
+
`nuka tend --fail-on` with any of the three exits 2 and says what to do
|
|
1503
|
+
instead, so a CI job that names one fails until it is edited. The
|
|
1504
|
+
`declared:` line reads `declared: describe <n>/<total>`; a script that
|
|
1505
|
+
reads the `rationale` count reads the `describe` count instead.
|
|
1506
|
+
- **`nuka harvest` is removed.** It exits 2 and names this note. Write
|
|
1507
|
+
the scenario from the `nuka do` calls you ran: one line per step in the
|
|
1508
|
+
order they ran, worded to match its pattern, with `Given`, `When`, or
|
|
1509
|
+
`Then` chosen by what the line tells a reader. Leave a value an earlier
|
|
1510
|
+
step produced off the line, since the step's `from` supplies it. Then
|
|
1511
|
+
run `nuka check`, which reads every line back against the vocabulary.
|
|
1512
|
+
The acceptance skill's "Where to start" route for an exploration says
|
|
1513
|
+
the same.
|
|
1514
|
+
- **Live sessions are removed: `nuka session start`, `nuka session stop`,
|
|
1515
|
+
and `--idle-timeout`.** `nuka session start` and `nuka session stop`
|
|
1516
|
+
exit 2 and name this note. `nuka do <step> --session <name>` still
|
|
1517
|
+
carries login state across calls as a saved storageState file, and
|
|
1518
|
+
`nuka session list` and `nuka session clear` still list and delete
|
|
1519
|
+
those files. What a live session was for, exploring a browser app whose
|
|
1520
|
+
state cannot be repeated, now goes through the agent host's Playwright
|
|
1521
|
+
MCP server: a Claude Code host adds it with
|
|
1522
|
+
`claude mcp add playwright npx @playwright/mcp@latest`, and the
|
|
1523
|
+
acceptance skill says how to tell whether it is connected and how to
|
|
1524
|
+
turn what it found into a scenario. Its `--isolated
|
|
1525
|
+
--storage-state=<file>` options start it from a session that
|
|
1526
|
+
`nuka do --session` saved. With live sessions gone, a step record no
|
|
1527
|
+
longer carries `session_execution`, `nuka do --session` no longer
|
|
1528
|
+
prints a line saying the session is not live, and `nuka run` no longer
|
|
1529
|
+
reports a live session or skips retention for one. `nuka clean` no
|
|
1530
|
+
longer refuses while a session lock is held. A script that started a
|
|
1531
|
+
session, drove it with `nuka do --session`, and stopped it gets the
|
|
1532
|
+
same login state from `nuka do --session` alone; state beyond login
|
|
1533
|
+
does not carry across calls.
|
|
1534
|
+
- **`recordStep` is no longer exported, and neither are
|
|
1535
|
+
`RecordStepOptions`, `StepExecution`, or
|
|
1536
|
+
`UnsupportedExternalFixtureError`.** A Playwright Test spec that imports
|
|
1537
|
+
`recordStep` fails to compile. Call the shared function the step's `run`
|
|
1538
|
+
calls directly from the spec, and delete the `nukadoko` import: the spec
|
|
1539
|
+
then depends only on Playwright again (docs/typescript/migration-playwright-test.md,
|
|
1540
|
+
"Share the implementation, not the runner"). Records `recordStep` wrote
|
|
1541
|
+
stay on disk with `kind: "external"` until retention removes them.
|
|
1542
|
+
- **The text output of `nuka check` and `nuka tend` prints a `do:` line
|
|
1543
|
+
under each finding, and names the step file of a step finding.** The
|
|
1544
|
+
line starts with two spaces (` do: nuka scaffold --feature
|
|
1545
|
+
features/greet.feature`). For a finding about one step, the third column
|
|
1546
|
+
now holds the step file, not the step name; the message still names the
|
|
1547
|
+
step. `--codes` text has a fourth column, the code's general `do`. A
|
|
1548
|
+
script that reads text output skips the lines that start with two
|
|
1549
|
+
spaces, or reads `--json`, where `file` and `do` are fields and nothing
|
|
1550
|
+
else changed.
|
|
1551
|
+
- **`nuka explore` is now `nuka experimental explore`.** Same flags, same
|
|
1552
|
+
output. `nuka explore` exits 2 and names the new spelling, so a script
|
|
1553
|
+
that ran `nuka explore features/explore/add-model.ts` becomes
|
|
1554
|
+
`nuka experimental explore features/explore/add-model.ts`. A model or a
|
|
1555
|
+
relation file imports the renamed functions: `defineModel` is
|
|
1556
|
+
`experimental_defineModel`, `modelCommand` is
|
|
1557
|
+
`experimental_modelCommand`, `defineRelation` is
|
|
1558
|
+
`experimental_defineRelation`, and `relationEntry` is
|
|
1559
|
+
`experimental_relationEntry`. The type names do not change. Under
|
|
1560
|
+
`experimental`, the command and the functions can change shape or go in
|
|
1561
|
+
a later release without a deprecation notice.
|
|
1562
|
+
- **`nuka experimental webmcp-tools`, `experimental_callWebmcpTool`, and
|
|
1563
|
+
`nuka experimental mcp-tools` are removed.** Each was experimental. To
|
|
1564
|
+
list an MCP server's tools, use the agent's own MCP host or an MCP
|
|
1565
|
+
client such as the MCP Inspector. A step that called
|
|
1566
|
+
`experimental_callWebmcpTool` calls the page's tool itself through
|
|
1567
|
+
`page.evaluate`. `connectMcpServer` and `callMcpTool` from
|
|
1568
|
+
`nukadoko/mcp` are unchanged.
|
|
1569
|
+
- **A `--json` command that refuses writes `{ "schema_version", "error",
|
|
1570
|
+
"do" }` on stdout.** It used to write prose on stderr and nothing on stdout. A
|
|
1571
|
+
script that reads stdout only after a zero exit is unaffected. One that
|
|
1572
|
+
reads stderr for the reason reads `error` from the JSON line instead,
|
|
1573
|
+
and `do` names the command to run next. `nuka describe` always answers
|
|
1574
|
+
this way, with or without `--json`. A refusal without `--json` keeps
|
|
1575
|
+
its stderr message and adds a last line, `do: <command>`.
|
|
1576
|
+
- **A command that refused exits 2, not 1.** Exit 1 used to mean both
|
|
1577
|
+
"the suite is red" and "nothing ran". It now means only the first: a
|
|
1578
|
+
`nuka check` error, a failed scenario, a failed `nuka do` step, a
|
|
1579
|
+
`nuka tend --fail-on` hit. A refusal (an unknown flag, an invalid
|
|
1580
|
+
config, a missing target, an unknown step, a missing peer dependency,
|
|
1581
|
+
and `nuka run` stopped by the errors `nuka check` reports) exits 2. A
|
|
1582
|
+
script or CI step that tests `!= 0` keeps working. One that tests
|
|
1583
|
+
`== 1` to mean "red" now misses a refusal: test `!= 0` for "not green",
|
|
1584
|
+
or `== 2` for "fix the invocation". The table is in docs/spec.md
|
|
1585
|
+
"Streams and exit codes".
|
|
1586
|
+
|
|
1587
|
+
## 0.15.0 to 0.16.1
|
|
1588
|
+
|
|
1589
|
+
- **`nuka tend` leaves out `step-rationale-missing` and
|
|
1590
|
+
`schema-field-undescribed` unless asked.** A missing `rationale` or
|
|
1591
|
+
`.describe()` is a gap a project may keep, and reporting both on every
|
|
1592
|
+
run buried the findings about real rot. `nuka tend --all` reports them
|
|
1593
|
+
again, in text and in `--json`. A job that runs `nuka tend --fail-on
|
|
1594
|
+
step-rationale-missing` (or `schema-field-undescribed`) keeps working
|
|
1595
|
+
unchanged, since naming a code in `--fail-on` reports it. A job or
|
|
1596
|
+
script that reads either code from plain `nuka tend --json` adds
|
|
1597
|
+
`--all`. A placeholder `rationale: ""` written only to quiet the note
|
|
1598
|
+
can go.
|
|
1599
|
+
- **`nuka tend` reports `step-description-todo` by default.** A typed step
|
|
1600
|
+
whose description still begins with `TODO: describe`, the placeholder
|
|
1601
|
+
`nuka scaffold` writes without `--description`, gets one note naming
|
|
1602
|
+
its file. The exit code does not change unless `--fail-on` names the
|
|
1603
|
+
code. A job or script that treats any note from plain `nuka tend` as a
|
|
1604
|
+
failure, or waits for `ok: nothing to tend`, sees one note per such
|
|
1605
|
+
step: write what each step does in its `description`.
|
|
1606
|
+
- **`nuka mcp-tools` is now `nuka experimental mcp-tools`.** Same flags,
|
|
1607
|
+
same output. The old spelling exits 1 and names the new one, so a
|
|
1608
|
+
script that ran `nuka mcp-tools -- <command>` becomes
|
|
1609
|
+
`nuka experimental mcp-tools -- <command>`. Under `experimental`, its
|
|
1610
|
+
shape may change in a later release without a deprecation notice. 0.17.0
|
|
1611
|
+
removes both spellings; see "0.16.1 to 0.17.0".
|
|
1612
|
+
|
|
1613
|
+
`nuka run` now refuses what `nuka check` refuses, which a project that runs a feature `check` reports an error for has to act on.
|
|
1614
|
+
|
|
1615
|
+
**`nuka run` performs the static check first.** Before it executes
|
|
1616
|
+
anything, `nuka run` reports what `nuka check` reports for the scenarios it
|
|
1617
|
+
selected. When one finding is an error, it prints the errors on stderr,
|
|
1618
|
+
writes no record, and exits 1. What to do:
|
|
1619
|
+
|
|
1620
|
+
- **A script that chains `nuka check && nuka run features` keeps
|
|
1621
|
+
working.** It checks twice, which costs one more step discovery. It can
|
|
1622
|
+
shrink to `nuka run`: with no target, `nuka run` now runs `featuresDir`
|
|
1623
|
+
(it used to exit 1 asking for a target). Keep the separate `nuka check`
|
|
1624
|
+
where `additionalFeatureDirs` holds features, since `nuka run` with no
|
|
1625
|
+
target does not walk them.
|
|
1626
|
+
- **A feature `nuka check` rejects no longer runs.** Fix the finding, or
|
|
1627
|
+
pass `--no-check` for a deliberate run of it, for example while a
|
|
1628
|
+
migrating suite still has an `undefined-step`. A run-scope error, such
|
|
1629
|
+
as a `duplicate-pattern` or a step file that fails to import, now stops
|
|
1630
|
+
every `nuka run` in the project, not only the scenarios that reach it.
|
|
1631
|
+
- **A script that matched a run-time failure for one of these now sees
|
|
1632
|
+
the refusal.** An undefined step used to fail its scenario with a record;
|
|
1633
|
+
now no scenario runs, and stderr carries the `nuka check` line instead.
|
|
1634
|
+
|
|
1635
|
+
`playwright` is no longer installed with nukadoko, which a project with a browser or HTTP step has to act on.
|
|
1636
|
+
|
|
1637
|
+
**Playwright is an optional peer dependency.** It and `playwright-core`
|
|
1638
|
+
were most of the install, and a project whose steps never use `page`,
|
|
1639
|
+
`context`, or `request` never needed them. nukadoko now declares
|
|
1640
|
+
`playwright` as an optional peer dependency and loads it only when one of
|
|
1641
|
+
those fixtures is first built. What to do:
|
|
1642
|
+
|
|
1643
|
+
- **A project with a step or fixture that uses `page`, `context`, or
|
|
1644
|
+
`request` adds `playwright` to its own `devDependencies`,** at the exact
|
|
1645
|
+
version nukadoko is tested against:
|
|
1646
|
+
`npm install -D -E playwright@1.61.1`. Without it, `nuka check` reports
|
|
1647
|
+
`playwright-missing` with one line that names the step and this command,
|
|
1648
|
+
and `nuka run` stops before any step runs, as it does for any `nuka check`
|
|
1649
|
+
error. `nuka run --no-check` runs anyway, and the first such step fails
|
|
1650
|
+
with the same line. `nuka experimental webmcp-tools` needs it the same way.
|
|
1651
|
+
- **CI changes only by that one line in `package.json`.** `npm ci` installs
|
|
1652
|
+
`playwright` once it is a devDependency of the project, and
|
|
1653
|
+
`npx playwright install --with-deps chromium` keeps downloading the
|
|
1654
|
+
browser in the job that runs browser steps, as [docs/ci.md](../ci.md) shows.
|
|
1655
|
+
A job that runs only `nuka check`, or a project with no browser step, can
|
|
1656
|
+
drop any browser install line.
|
|
1657
|
+
- **A project without a browser or HTTP step typechecks without
|
|
1658
|
+
`playwright`, with any `skipLibCheck`.** nukadoko's own type
|
|
1659
|
+
declarations name Playwright's `Page` and `APIRequestContext` for the
|
|
1660
|
+
`page` and `request` fixtures. When `playwright` is missing, those types
|
|
1661
|
+
are `any` and `tsc` passes. When it is installed, they are Playwright's
|
|
1662
|
+
own types.
|
|
1663
|
+
- **A project whose own `playwright` is at another version pins it to
|
|
1664
|
+
1.61.1.** npm refuses (`ERESOLVE`) to install nukadoko beside a
|
|
1665
|
+
different `playwright`, where it used to install a second copy.
|
|
1666
|
+
|
|
1667
|
+
## 0.14.1 to 0.15.0
|
|
1668
|
+
|
|
1669
|
+
`nuka accept` and every sign-off finding are removed, which a project that signs off features, or gates CI on a sign-off, has to act on.
|
|
1670
|
+
Compat behaviour a project can notice, one redaction change, and one evidence-name change.
|
|
1671
|
+
`nuka session clear --env` and `nuka session stop` also name a typo that used to exit 0 with no output.
|
|
1672
|
+
The Allure and messages emitters are off by default now, which a project that reads either export has to act on.
|
|
1673
|
+
|
|
1674
|
+
**`nuka accept` is gone, and the run summary replaces it.** No project kept
|
|
1675
|
+
the records it wrote, and the run summary carries the same claim ("green
|
|
1676
|
+
at this commit") as evidence bound to its commit; the approval itself is
|
|
1677
|
+
recorded wherever the team records approvals. Every `nuka run` now writes that summary; [docs/ci.md](../ci.md) shows
|
|
1678
|
+
how to post it on the pull request. What to do:
|
|
1679
|
+
|
|
1680
|
+
- **Remove `nuka accept` from scripts and CI.** The command no longer
|
|
1681
|
+
exists, so `nuka accept <feature>` exits 1 with yargs' unknown-argument
|
|
1682
|
+
error (exit 2 from the release after 0.16.1 on, where every refusal
|
|
1683
|
+
exits 2). Where a job ran it after a green `nuka run`, post the run summary
|
|
1684
|
+
instead: `nuka run <features> --summary <path>`, then a step that comments
|
|
1685
|
+
that file on the pull request (the workflow in [docs/ci.md](../ci.md) has
|
|
1686
|
+
one).
|
|
1687
|
+
- **Replace a PR check that a feature has a sign-off record.** A job that
|
|
1688
|
+
looked for a `<feature>.*.md` file beside each changed feature, or ran
|
|
1689
|
+
`nuka tend --fail-on feature-never-signed`, has nothing left to check.
|
|
1690
|
+
The reviewer now reads the `.feature` in the diff and the run summary on
|
|
1691
|
+
the pull request; the run is the evidence, and where the approval is
|
|
1692
|
+
recorded is the team's process (see "Review" in
|
|
1693
|
+
[docs/spec.md](../spec.md#review)). `nuka
|
|
1694
|
+
tend --fail-on` with any of the removed codes (`feature-never-signed`,
|
|
1695
|
+
`signed-feature-unscanned`, `signoff-condition-mismatch`,
|
|
1696
|
+
`signoff-feature-changed`, `signoff-feature-missing`,
|
|
1697
|
+
`signoff-record-old-format`, `signoff-record-unreadable`,
|
|
1698
|
+
`signoff-result-invalid`, `signoff-step-missing`) exits 1 (2 from the
|
|
1699
|
+
release after 0.16.1 on) before analyzing anything, and stderr names the code and says the run summary
|
|
1700
|
+
replaced it. Drop the flag, or gate on a code `nuka tend` still reports.
|
|
1701
|
+
- **Old `*.feature.*.md` records are inert.** Nothing reads them any more:
|
|
1702
|
+
`nuka tend` says nothing about them, and they are not scenarios unless
|
|
1703
|
+
`oaths` names them. Delete them, or keep them as history; either is
|
|
1704
|
+
safe.
|
|
1705
|
+
- **`nuka tend` exits 0 unless `--fail-on` fires.** Its one error used to
|
|
1706
|
+
be a stale sign-off. Every finding is now a note, and `--json` keeps
|
|
1707
|
+
`errors` as an empty array, so a reader of that field needs no change.
|
|
1708
|
+
- **A `:line` run's stderr notice changed.** It used to say a partial run
|
|
1709
|
+
could not be accepted. It now says the run summary covers only the
|
|
1710
|
+
selected scenarios. A script matching the old sentence has to match the
|
|
1711
|
+
new one.
|
|
1712
|
+
|
|
1713
|
+
The env file parser now follows dotenv for comments, quotes, escapes, and
|
|
1714
|
+
values that span lines. A project whose env files relied on the old reading
|
|
1715
|
+
has to look at those values before the next run.
|
|
1716
|
+
|
|
1717
|
+
- **`nuka tend --json` names a fixture in `fixture`, not `step`.** The
|
|
1718
|
+
`fixture-unused` and `fixture-touches-app` notes used to carry the fixture
|
|
1719
|
+
name in `step`. They now carry it in a new `fixture` field and leave `step`
|
|
1720
|
+
unset. A script that selected these notes by `.step` should select by
|
|
1721
|
+
`.fixture`. Text output is unchanged.
|
|
1722
|
+
- **`this.link`'s second argument is another URL, not a display name.**
|
|
1723
|
+
`this.link(a, b)` used to record one link whose name was `b`. It now
|
|
1724
|
+
records one declared link per argument, and none of them has a name,
|
|
1725
|
+
which is what cucumber-js does with a URL list. A call that passed a
|
|
1726
|
+
display name should drop that argument. An allure `link(url, name)` call
|
|
1727
|
+
is unchanged: that name still lands on the declared link.
|
|
1728
|
+
- **`this.attach` now follows the cucumber-js payload forms.** A `base64:`
|
|
1729
|
+
media type is decoded before the file is written. `{ mediaType, fileName }`
|
|
1730
|
+
uses that file name. A readable stream is read, and the call returns a
|
|
1731
|
+
promise the step must await. A project that read the old base64 text, or
|
|
1732
|
+
the JSON of a stream object, out of the attachment file will now read the
|
|
1733
|
+
decoded bytes or the stream's contents.
|
|
1734
|
+
- **`defineWorld` refuses `page` and `request`.** Those names are harness
|
|
1735
|
+
getters. A declaration of either used to pass `nuka check` and then crash
|
|
1736
|
+
`nuka run` with `WorldNotOpenedError`. Remove the key from `defineWorld`.
|
|
1737
|
+
A subclass can still assign `this.page` and `this.request`.
|
|
1738
|
+
`await this.openPage()` and `await this.openRequest()` are unchanged.
|
|
1739
|
+
`nuka check` reports a leftover declaration as `step-file-import-failed`,
|
|
1740
|
+
and `nuka run` stops with the same message, which names the field.
|
|
1741
|
+
- **Encoded forms of a loaded secret disappear from records, and two keys can newly collide.**
|
|
1742
|
+
The percent-encoded form and the JSON-escaped form are replaced with
|
|
1743
|
+
`{{secret.NAME}}`, same as the raw value. A script that searched a
|
|
1744
|
+
record for the encoded secret was reading a leak. It now finds the
|
|
1745
|
+
token. Two object keys that are the raw value and one of those forms
|
|
1746
|
+
redact to one string, and `redact` throws and names both keys instead
|
|
1747
|
+
of dropping one. A JSON number equal to a numeric secret is unchanged.
|
|
1748
|
+
Nothing in config has to move.
|
|
1749
|
+
- **`ctx.evidence.attach` and `ctx.evidence.path` refuse a harness file name.**
|
|
1750
|
+
`record.json`, `final.png`, `trace.zip`, and `http.jsonl` now throw
|
|
1751
|
+
`ReservedEvidenceNameError`, including a spelling that differs only by
|
|
1752
|
+
case. A step that attached one of those and read that path back has to
|
|
1753
|
+
pick a different name. Two other names that differ only by case are kept
|
|
1754
|
+
as two files, the same way two identical names already were: the second
|
|
1755
|
+
gets `-2` before the extension (`Report.txt`, then `report-2.txt`). On a
|
|
1756
|
+
case-sensitive volume those two names used to be two files. On a
|
|
1757
|
+
case-insensitive volume they used to be one file, and the first body was
|
|
1758
|
+
lost.
|
|
1759
|
+
- **A `#` in an unquoted value is a comment.** `TOKEN=abc123 # rotated` used
|
|
1760
|
+
to load `abc123 # rotated`. It now loads `abc123`. The `#` needs no space
|
|
1761
|
+
in front of it. To keep a `#` in the value, put the value in quotes.
|
|
1762
|
+
- **Double quotes expand `\n` and `\r`.** `KEY="line1\nline2"` used to load
|
|
1763
|
+
the two characters `\` and `n`. It now loads a newline. Single quotes and
|
|
1764
|
+
backticks do not expand escapes, so use those when the backslash must stay.
|
|
1765
|
+
A backslash before `\n` is not special: `\\n` in double quotes is a
|
|
1766
|
+
backslash followed by a newline.
|
|
1767
|
+
- **A quoted value may span lines, and backticks are quotes.** A private key
|
|
1768
|
+
written across lines used to be split, and a line inside it could become
|
|
1769
|
+
its own key. The secret then sat in neither `ctx.env` nor the secret set.
|
|
1770
|
+
It is now one value. `` KEY=`backtick` `` used to keep the backtick
|
|
1771
|
+
characters. It now loads `backtick`.
|
|
1772
|
+
- **`nuka check` warns with `env-file-skipped-line`.** The finding names the
|
|
1773
|
+
file and the line number, not the text. The run still loads every binding
|
|
1774
|
+
it could read, and the warning does not by itself fail `nuka check`. A
|
|
1775
|
+
line that was never a binding was already not loaded. The warning is how
|
|
1776
|
+
you see it. The separator is `=`. A line that uses `:` is this warning.
|
|
1777
|
+
- **`nuka session clear --env <name>` refuses an environment the config
|
|
1778
|
+
does not define, when that environment has no session files left.** It
|
|
1779
|
+
used to exit 0 and print nothing, so a typo looked like the sessions
|
|
1780
|
+
were gone. The message is the same one `nuka do --env` already uses.
|
|
1781
|
+
Session files left under an environment removed from the config are
|
|
1782
|
+
still cleared, and the command still exits 0. stderr names that
|
|
1783
|
+
environment. Omitting `--env` is unchanged: it clears the implicit
|
|
1784
|
+
`default` environment, which does not have to be listed.
|
|
1785
|
+
- **`nuka session stop <name>` of a name that was never a session still
|
|
1786
|
+
exits 0, and now writes one stderr line** naming the session and the
|
|
1787
|
+
environment. A script that treats any stderr as failure will see that
|
|
1788
|
+
line. Stopping a live session, or cleaning up a stale lock, is
|
|
1789
|
+
unchanged and still quiet on success.
|
|
1790
|
+
- **`returns` is optional, and `nuka scaffold` takes `--pattern` and
|
|
1791
|
+
`--then`. Nothing a project already has changes meaning.** A step that
|
|
1792
|
+
declares `returns` still has to return the value it validates, and a
|
|
1793
|
+
one-parameter `run({ page })` still names a fixture. A step whose
|
|
1794
|
+
`returns` is `z.object({})` may drop that line and its `return {}`, and
|
|
1795
|
+
does not have to. An early `return {}` inside an `if` becomes `return;`,
|
|
1796
|
+
or the step falls through to the code after it.
|
|
1797
|
+
- **The Allure and messages emitters are off until their config key is
|
|
1798
|
+
present.** `nuka run` used to write `.nukadoko/export/allure-results/`
|
|
1799
|
+
and `.nukadoko/export/messages.ndjson` with no configuration. A project
|
|
1800
|
+
that reads Allure results adds `allure: {}` to `nukadoko.config.ts`, and
|
|
1801
|
+
a project that feeds cucumber messages to a formatter or JUnit-based CI
|
|
1802
|
+
adds `messages: {}`. A project that already sets `allure.resultsDir` or
|
|
1803
|
+
`messages.output` changes nothing, since the key is already there. A
|
|
1804
|
+
project that reads neither can delete `allurerc.mjs` and the export
|
|
1805
|
+
directory; `nuka clean --export` still removes what earlier runs wrote.
|
|
1806
|
+
From the release after 0.16.1 on, `--export` exits 2 and plain
|
|
1807
|
+
`nuka clean` removes the export together with the records and the
|
|
1808
|
+
cache.
|
|
1809
|
+
- **`nuka init` writes less and wires more.** It no longer writes
|
|
1810
|
+
`allurerc.mjs`, the results directory, or the `.env` lines in
|
|
1811
|
+
`.gitignore` unless `--allure` or `--env` asks for them, and it adds a
|
|
1812
|
+
`test:scenarios` script to `package.json`. This changes only what a new
|
|
1813
|
+
`init` writes; a project already initialized needs nothing.
|
|
1814
|
+
|
|
1815
|
+
**Optional after upgrading from 0.14.x or earlier.** Three things a
|
|
1816
|
+
project often wrote by hand are built in since 0.15.0. `nuka check` and
|
|
1817
|
+
`nuka run` accept the hand-written copies, so nothing fails until they go.
|
|
1818
|
+
From the release after 0.16.1 on, `nuka tend` reports the first one as
|
|
1819
|
+
`fixture-replaces-builtin`.
|
|
1820
|
+
|
|
1821
|
+
- **`scratch` is a builtin fixture.** A `scratch` entry in
|
|
1822
|
+
`config.fixtures` and its `StepFixtures` declaration can go when
|
|
1823
|
+
`scratch.dir(prefix)` and `scratch.copy(source)` cover what they did.
|
|
1824
|
+
Each returns a new temporary directory, which is removed when the
|
|
1825
|
+
scenario ends, pass or fail, and is listed in the step record's
|
|
1826
|
+
`evidence.scratch`. While the project's own entry exists, it replaces
|
|
1827
|
+
the builtin.
|
|
1828
|
+
- **`runCommand` replaces a `spawnSync` wrapper, and an `execFileSync` or
|
|
1829
|
+
`execSync` call.** `import { runCommand } from "nukadoko"`, then
|
|
1830
|
+
`await runCommand(command, args, { cwd, env, input, timeout })`. Each
|
|
1831
|
+
call inside a step adds an entry to the step record's
|
|
1832
|
+
`observed.processes`. Two differences from `spawnSync` cost a
|
|
1833
|
+
run if they are missed. It returns a Promise, so each caller gains
|
|
1834
|
+
`await` and becomes `async`: a caller without `await` passes
|
|
1835
|
+
`nuka check` and fails at run time with `returns validation failed`
|
|
1836
|
+
(`tsc` reports it first). And `exitCode` is `number | null`, `null`
|
|
1837
|
+
when a signal ended the process, so a step whose `returns` declares
|
|
1838
|
+
`exitCode: z.number()` returns `exitCode ?? 1`, or declares
|
|
1839
|
+
`z.number().nullable()`. A failed run prints the `used <step> exit
|
|
1840
|
+
<code> <first stderr line>` line only when the step that ran the
|
|
1841
|
+
program returns both `exitCode` and `stderr`.
|
|
1842
|
+
A third difference applies to `execFileSync` and `execSync`, and
|
|
1843
|
+
missing it fails nothing: they throw on a nonzero exit, and `runCommand`
|
|
1844
|
+
resolves. A step that relied on that throw as its assertion passes when
|
|
1845
|
+
the program failed, and `nuka check` stays green. Where the step needs
|
|
1846
|
+
the program to succeed, check `exitCode` yourself:
|
|
1847
|
+
`if (exitCode !== 0) throw new Error(stderr)`. `runCommand` returns
|
|
1848
|
+
`{ exitCode, signal, stdout, stderr }`, not the stdout text, and it runs
|
|
1849
|
+
no shell, so an `execSync` string becomes a command and its arguments.
|
|
1850
|
+
- **An empty `returns` can go.** A step whose `returns` is
|
|
1851
|
+
`z.object({})` may drop that line and its final `return {}`. An early
|
|
1852
|
+
`return {}` inside an `if` becomes `return;`: deleting it makes the step
|
|
1853
|
+
fall through to the code after it, such as the next assertion.
|
|
1854
|
+
|
|
1855
|
+
## 0.14.0 to 0.14.1
|
|
1856
|
+
|
|
1857
|
+
- **`nuka check` can newly report `outline-does-not-run`, an error.** A
|
|
1858
|
+
Scenario Outline with no Examples table, and an Examples table with a
|
|
1859
|
+
header and no body row, used to pass `check`. The first ran once with
|
|
1860
|
+
the placeholder text left in, and the second produced no scenario at
|
|
1861
|
+
all. Add an Examples row for each case that must run, or remove the
|
|
1862
|
+
empty Examples table. This is the only reason a `check` that was green
|
|
1863
|
+
on 0.14.0 turns red on 0.14.1.
|
|
1864
|
+
|
|
1865
|
+
## 0.12.0 to 0.13.0
|
|
1866
|
+
|
|
1867
|
+
Behaviour changes worth knowing before upgrading.
|
|
1868
|
+
|
|
1869
|
+
- **A typed step that runs longer than twenty minutes now fails.** It used
|
|
1870
|
+
to run forever, taking the run with it. The limit is `stepTimeout` in
|
|
1871
|
+
`nukadoko.config.ts`; one step raises its own with
|
|
1872
|
+
`defineStep({ timeout })`. If a step in this project legitimately takes
|
|
1873
|
+
longer, set the number before upgrading, since the failure looks like an
|
|
1874
|
+
ordinary step failure with `error.kind: "timeout"`. There is no value
|
|
1875
|
+
meaning "no limit". Compat steps are unaffected: they still run unbounded
|
|
1876
|
+
unless their own glue declares `{ timeout }` or calls `setDefaultTimeout`.
|
|
1877
|
+
- **A `--concurrency <n>` run writes one extra line per scenario**, naming
|
|
1878
|
+
the worker and the scenario as it starts. A script parsing stderr for the
|
|
1879
|
+
existing `scenario <n>/<total>` line is unaffected; one matching every
|
|
1880
|
+
line starting with `scenario ` now sees both. `--quiet` suppresses both.
|
|
1881
|
+
- **A config file with no default export, or a Promise as its default, now fails and names the file.**
|
|
1882
|
+
It used to be read as `{}`, so the keys in the file were ignored.
|
|
1883
|
+
Export the object: `export default defineConfig({ ... })`.
|
|
1884
|
+
- **An env file that cannot be read, or a directory at that path, now
|
|
1885
|
+
stops setup.** It used to be skipped, and the first `requireEnv` blamed
|
|
1886
|
+
the key. The refusal names the configured path and the errno. A path
|
|
1887
|
+
that is not on disk still contributes nothing, and `nuka check` still
|
|
1888
|
+
warns about that absence. Fix the path or its permissions before
|
|
1889
|
+
upgrading if a run was depending on the skip.
|
|
1890
|
+
|
|
1891
|
+
## 0.11.0 to 0.12.0
|
|
1892
|
+
|
|
1893
|
+
Additions, one fix, and one name.
|
|
1894
|
+
|
|
1895
|
+
- **New acceptance records are named `<feature-filename>.<date>-<sha>...`,
|
|
1896
|
+
extension included.** Records already written keep their old name and
|
|
1897
|
+
keep working: nothing reads a record by its name. A script that globs
|
|
1898
|
+
`<basename>.*.md` matches both forms; one that globs `<basename>.20*.md`
|
|
1899
|
+
matches only the old one and needs `<basename>.feature.*.md` as well.
|
|
1900
|
+
- **A step can take one key from `from` and another from a table or
|
|
1901
|
+
docstring on the same line.** A suite that had made the chained key
|
|
1902
|
+
optional to get past `table-docstring-key-mismatch` can make it required
|
|
1903
|
+
again, which restores the from-order check for that step.
|
|
1904
|
+
- **`nuka run --repeat <n>`, `nuka tend --fail-on <code>`, and the Condition
|
|
1905
|
+
section's declared-vs-observed count** are additions; nothing already in
|
|
1906
|
+
place changes.
|
|
1907
|
+
|
|
1908
|
+
## 0.10.1 to 0.11.0
|
|
1909
|
+
|
|
1910
|
+
`nuka run` now removes old records on its own, and a trace file exists once
|
|
1911
|
+
on disk instead of twice.
|
|
1912
|
+
|
|
1913
|
+
- **The first `nuka run` after upgrading removes every run older than the
|
|
1914
|
+
newest 20.** Runs are read from the scenario records already on disk,
|
|
1915
|
+
so a state directory that grew for weeks shrinks at the end of that first
|
|
1916
|
+
run, and the run prints one `retention:` line saying how many runs went.
|
|
1917
|
+
If that is not wanted, set `retention.runs` in `nukadoko.config.ts`
|
|
1918
|
+
before running; there is no "keep everything" value, only a larger
|
|
1919
|
+
number. `retention.adHocDays` (default 7) is the separate lifetime of a
|
|
1920
|
+
record no run owns, such as a `nuka do` record.
|
|
1921
|
+
- **`nuka accept` and `nuka tend` see only the retained runs.** A feature
|
|
1922
|
+
whose last green run is older than the newest `retention.runs` runs now
|
|
1923
|
+
reads as never run; run it again before accepting it. Sign-off records
|
|
1924
|
+
already written are unaffected: they live beside the feature, not under
|
|
1925
|
+
`.nukadoko/`.
|
|
1926
|
+
- **`nuka do --use <id>` and `nuka harvest <id>` can now refuse an id that
|
|
1927
|
+
used to resolve.** The refusal says the record may have aged out and
|
|
1928
|
+
names the policy in force, rather than only "no such step record".
|
|
1929
|
+
- **`allure-results/` written by 0.10 and earlier is not pruned.**
|
|
1930
|
+
Retention removes an export file only through the manifest the run that
|
|
1931
|
+
wrote it left under `.nukadoko/records/runs/<run_id>/`, and older runs
|
|
1932
|
+
left none. Every run from now on removes its own files when it ages out,
|
|
1933
|
+
so what stays forever is only what was written before the upgrade.
|
|
1934
|
+
|
|
1935
|
+
`nuka clean --export` empties the whole directory, which also drops the
|
|
1936
|
+
reports of the runs kept since the upgrade. (From the release after
|
|
1937
|
+
0.16.1 on, `--export` exits 2, and plain `nuka clean` also removes the
|
|
1938
|
+
records and the cache.) To keep those, delete only
|
|
1939
|
+
what predates the upgrade instead, which nothing tracks either way:
|
|
1940
|
+
|
|
1941
|
+
```sh
|
|
1942
|
+
find .nukadoko/export/allure-results -type f ! -newermt '<the day you upgraded>' -delete
|
|
1943
|
+
```
|
|
1944
|
+
- **A trace or screenshot under `allure-results/` is now a hard link to
|
|
1945
|
+
the file under `records/steps/<id>/`.** Nothing reads differently.
|
|
1946
|
+
Copying `.nukadoko/` with a tool that does not preserve links makes two
|
|
1947
|
+
files again, as before; `allure.resultsDir` on another filesystem falls
|
|
1948
|
+
back to a copy on its own.
|
|
1949
|
+
- **`nuka clean --records` also removes `.nukadoko/records/runs/`.** A
|
|
1950
|
+
project that scripted a clean by path should include that directory.
|
|
1951
|
+
From the release after 0.16.1 on, `--records` exits 2, and plain
|
|
1952
|
+
`nuka clean` removes the records, the cache, and the export together.
|
|
1953
|
+
|
|
1954
|
+
## 0.10.0 to 0.10.1
|
|
1955
|
+
|
|
1956
|
+
One fix, with two things a project could notice.
|
|
1957
|
+
|
|
1958
|
+
- **A record's own object keys can now read differently.** `redact` used to
|
|
1959
|
+
walk object values and copy keys through untouched, so a secret spelled
|
|
1960
|
+
inside a key reached a step record verbatim. Keys go through the same
|
|
1961
|
+
replacements now. A script that reads a record by a key holding a secret
|
|
1962
|
+
was reading a leaked secret; it now reads `{{secret.NAME}}` in that
|
|
1963
|
+
position. Nothing else about a record moves, and the fixed-shape fields
|
|
1964
|
+
never carried a secret in a key to begin with.
|
|
1965
|
+
- **`redact` can now throw where it silently dropped data before.** Two
|
|
1966
|
+
distinct keys can redact to one string, and the old code would have let
|
|
1967
|
+
the second overwrite the first and take a whole subtree with it. It
|
|
1968
|
+
throws and names both keys instead. The shape that reaches this is one
|
|
1969
|
+
key already spelling `{{secret.TOKEN}}` as ordinary data beside a sibling
|
|
1970
|
+
holding the raw value that token stands for. A run that hits it was
|
|
1971
|
+
losing data before this release without saying so.
|
|
1972
|
+
|
|
1973
|
+
## 0.9.0 to 0.10.0
|
|
1974
|
+
|
|
1975
|
+
`nuka run` writes more on stderr, and `nuka tend` reports one new note.
|
|
1976
|
+
Why is in [CHANGELOG.md](https://github.com/meganemura/nukadoko/blob/main/typescript/CHANGELOG.md) under `## 0.10.0`.
|
|
1977
|
+
|
|
1978
|
+
- **`nuka run` names each failed scenario on stderr, after the summary
|
|
1979
|
+
line.** One line per scenario that did not pass, carrying its feature
|
|
1980
|
+
path, line, and name, and `--quiet` keeps them the same way it keeps the
|
|
1981
|
+
summary. Anything parsing this command's stderr sees lines it has not
|
|
1982
|
+
seen before. stdout is unchanged: still one scenario record per line,
|
|
1983
|
+
and still the channel to parse.
|
|
1984
|
+
- **`nuka tend` gains a `repeated-scenario-prefix` note.** It never
|
|
1985
|
+
changes the exit code, like every tend finding except sign-off
|
|
1986
|
+
staleness, so a periodic job that acts on tend's exit status is
|
|
1987
|
+
unaffected.
|
|
1988
|
+
|
|
1989
|
+
## 0.8.0 to 0.9.0
|
|
1990
|
+
|
|
1991
|
+
The acceptance record has one breaking change. `nuka tend`'s
|
|
1992
|
+
`post-navigation-read` note also reads from a different place now. Why is
|
|
1993
|
+
in [CHANGELOG.md](https://github.com/meganemura/nukadoko/blob/main/typescript/CHANGELOG.md) under `## 0.9.0`.
|
|
1994
|
+
|
|
1995
|
+
- **A record `nuka accept` writes from now on drops `actions`,
|
|
1996
|
+
`page_events`, `sections`, `polls`, `declared`, `http_omitted`, and
|
|
1997
|
+
`truncated` from each step.** A script reading a newly accepted record
|
|
1998
|
+
needs to stop expecting these keys. Every one of them still lands on
|
|
1999
|
+
the step record under `.nukadoko/`; only the copy embedded in the
|
|
2000
|
+
committed record narrows. The committed record's own text names each
|
|
2001
|
+
key it dropped, so a reader is never left guessing.
|
|
2002
|
+
- **A record already committed keeps working, unchanged.** Reading an
|
|
2003
|
+
existing acceptance record needs no change.
|
|
2004
|
+
- **Each scenario in a record written from now on also carries a summary
|
|
2005
|
+
table**: step, status, ms, mutates, reads, writes.
|
|
2006
|
+
- **`nuka tend`'s `post-navigation-read` note now reads step records under
|
|
2007
|
+
`.nukadoko/records/steps/`, not a committed one.** Nothing to do on the
|
|
2008
|
+
project side. To get the note back for a step, run the feature again.
|
|
2009
|
+
|
|
2010
|
+
## 0.7.0 to 0.8.0
|
|
2011
|
+
|
|
2012
|
+
The Allure report structure has one breaking change. One other behavior
|
|
2013
|
+
change affects consumers of `nuka tend --json`.
|
|
2014
|
+
|
|
2015
|
+
- **Allure now writes one result for each scenario pickle.** Gherkin steps
|
|
2016
|
+
are entries inside that result. The Suites tab no longer groups results
|
|
2017
|
+
by `parentSuite` and `suite`, so a saved Suites view appears flat.
|
|
2018
|
+
Find Features in the Behaviors tab through the `feature` label, or use
|
|
2019
|
+
the result's `titlePath` hierarchy. A plain scenario keeps its existing
|
|
2020
|
+
history. Each Scenario Outline row starts a new history once because
|
|
2021
|
+
its Examples cells are now visible parameters. Live reports still
|
|
2022
|
+
update after each step, but temporary progress snapshots now provide
|
|
2023
|
+
those updates. During a live session, a running scenario's retries can
|
|
2024
|
+
show older unknown snapshots. Nukadoko removes them when the scenario
|
|
2025
|
+
ends, so they do not appear in a report generated after the run.
|
|
2026
|
+
A consumer that reads `allure-results` during a run must treat
|
|
2027
|
+
`*-progress-result.json` as a temporary file. These files do not exist
|
|
2028
|
+
after a completed run.
|
|
2029
|
+
|
|
2030
|
+
- **`nuka tend`'s `post-navigation-read` notes are grouped now.** One note
|
|
2031
|
+
used to be emitted per step record, so a Background step in a suite with
|
|
2032
|
+
two dozen scenarios produced two dozen notes that differed only by file
|
|
2033
|
+
name. Matches that share a step, its navigation call, and the call that
|
|
2034
|
+
followed it are one note now, carrying how many step records it happened
|
|
2035
|
+
in and the range the gaps fell in. A script that counted notes to count
|
|
2036
|
+
occurrences counts distinct shapes instead; the occurrence count is in
|
|
2037
|
+
the note's own text.
|
|
2038
|
+
|
|
2039
|
+
## 0.6.0 to 0.7.0
|
|
2040
|
+
|
|
2041
|
+
One breaking change, plus a behavior change that is not breaking but is
|
|
2042
|
+
worth knowing about, since it changes what a script watching `nuka run`'s
|
|
2043
|
+
output actually sees. The breaking one: why is in
|
|
2044
|
+
[CHANGELOG.md](https://github.com/meganemura/nukadoko/blob/main/typescript/CHANGELOG.md) under `## 0.7.0`.
|
|
2045
|
+
|
|
2046
|
+
- **An args key a step's schema does not declare is refused now, not
|
|
2047
|
+
silently dropped.** `nuka describe` already published each object
|
|
2048
|
+
schema's own `additionalProperties: false`; the runtime now enforces
|
|
2049
|
+
the same shape everywhere a step can be called: `nuka do`, `nuka do
|
|
2050
|
+
--session <live>`, `nuka run`, `recordStep`, and the `call`
|
|
2051
|
+
fixture a part is invoked through. A key `from` or `--use` fills is
|
|
2052
|
+
never flagged, since either can only ever name a key the step already
|
|
2053
|
+
declared. **A successful step record's own `args` also changed shape**:
|
|
2054
|
+
it is now the schema-validated value, not the raw one, so a key filled
|
|
2055
|
+
by the schema's own `.default(...)` shows up in it even where the
|
|
2056
|
+
caller never typed it. A script comparing a step record's `args`
|
|
2057
|
+
against what it sent needs to allow for that: an added default is not a
|
|
2058
|
+
sign anything went wrong. A failed record is unaffected, and neither is
|
|
2059
|
+
a part's own `CallEntry.args`, which stays raw on both outcomes either
|
|
2060
|
+
way.
|
|
2061
|
+
- **Not breaking, but worth knowing: `nuka run` no longer writes straight
|
|
2062
|
+
into `messages.output` while a run is in progress.** Each invocation now
|
|
2063
|
+
writes its own file (the configured path's own name with the run id
|
|
2064
|
+
spliced in, `messages.<run_id>.ndjson` under the default path) beside
|
|
2065
|
+
the configured path, and only replaces the configured path, atomically,
|
|
2066
|
+
once the run finishes; the change closes a real bug where two `nuka run`
|
|
2067
|
+
invocations against the same path used to interleave into one broken
|
|
2068
|
+
file. A script
|
|
2069
|
+
that tailed `messages.ndjson` to watch a run live no longer sees
|
|
2070
|
+
anything until the run ends; watch Allure instead (`npx allure watch`)
|
|
2071
|
+
for that. A script that treated the file being truncated as "a run just
|
|
2072
|
+
started" needs a different signal, since the configured path is not
|
|
2073
|
+
touched until the run's own end now. `messages.output` still ends up
|
|
2074
|
+
holding the newest completed run's own stream either way, so nothing
|
|
2075
|
+
that only reads it once the run is done needs to change. One thing to
|
|
2076
|
+
add to housekeeping: each run's own file accumulates beside the
|
|
2077
|
+
configured path now, removed only by `nuka clean [--export]`, a new
|
|
2078
|
+
command this release also adds (see the command's own `--help`).
|
|
2079
|
+
|
|
2080
|
+
## 0.4.1 to 0.5.0
|
|
2081
|
+
|
|
2082
|
+
Additive, with one narrow exception. Why is in
|
|
2083
|
+
[CHANGELOG.md](https://github.com/meganemura/nukadoko/blob/main/typescript/CHANGELOG.md) under `## 0.5.0`.
|
|
2084
|
+
|
|
2085
|
+
- **`Step` now always carries `parts`, so a hand-written `Step` object
|
|
2086
|
+
literal no longer typechecks.** `Step` is an exported type and `parts`
|
|
2087
|
+
is required on it, the same way `from` already is, so every reader can
|
|
2088
|
+
iterate it without checking for `undefined` first. Nothing built by
|
|
2089
|
+
`defineStep` is affected, and neither is code that only annotates or
|
|
2090
|
+
passes a `Step` around; the one thing that breaks is constructing the
|
|
2091
|
+
object by hand, which a test double is the usual reason to do. Add
|
|
2092
|
+
`parts: []` to it, or better, build it with `defineStep`.
|
|
2093
|
+
- **Nothing else needs doing.** A step record gained an optional `calls`
|
|
2094
|
+
field, `nuka steps --json` and `nuka describe` gained `parts`, and
|
|
2095
|
+
`needs`/`needs_browser` now account for a step's parts. No field was
|
|
2096
|
+
renamed or removed, so an existing acceptance record stays valid and a
|
|
2097
|
+
script reading either JSON keeps working.
|
|
2098
|
+
|
|
2099
|
+
## 0.3.0 to 0.4.0
|
|
2100
|
+
|
|
2101
|
+
One breaking change, plus one action that is not breaking. Each entry
|
|
2102
|
+
says what to fix; why is in [CHANGELOG.md](https://github.com/meganemura/nukadoko/blob/main/typescript/CHANGELOG.md) under
|
|
2103
|
+
`## 0.4.0`.
|
|
2104
|
+
|
|
2105
|
+
- **A step record's and a scenario record's id-bearing field names
|
|
2106
|
+
changed again, following one rule now: `<grain>_record_id`, or `run_id`
|
|
2107
|
+
for a run.** A script reading either JSON needs the current names: a
|
|
2108
|
+
step record's `record_id` is `step_record_id`; the owning scenario
|
|
2109
|
+
record's id on a step record, formerly `scenario`, is
|
|
2110
|
+
`scenario_record_id`; a scenario record's own `scenario_id` is
|
|
2111
|
+
`scenario_record_id`; a scenario record's `steps[].record` is
|
|
2112
|
+
`steps[].step_record_id`. A scenario record's own `scenario` field (the
|
|
2113
|
+
pickle's name, never an id) and `run_id` did not change, and neither
|
|
2114
|
+
did the `step-`/`scn-`/`run-` id prefixes. An existing acceptance
|
|
2115
|
+
record may need re-creating: `nuka run` the feature again and `nuka
|
|
2116
|
+
accept` it. Run `nuka tend` before upgrading to find out whether yours
|
|
2117
|
+
does, rather than assuming: it names every acceptance record that is
|
|
2118
|
+
actually affected (`signoff-record-old-format`), and names none for a
|
|
2119
|
+
feature that already lives inside `featuresDir`, since that feature
|
|
2120
|
+
runs unattended and its sign-off is no longer what carries the
|
|
2121
|
+
guarantee. Two more spots
|
|
2122
|
+
followed the old, bare convention and now match the same rule: a step
|
|
2123
|
+
record's `used[]` entries carried the upstream id under `record`,
|
|
2124
|
+
formerly; a script reading it needs `used[].step_record_id` now. And
|
|
2125
|
+
the Allure emitter's step parameter that used to be named just
|
|
2126
|
+
`"record"` is `"step record id"` now, so a script parsing Allure
|
|
2127
|
+
output by parameter name needs the new label.
|
|
2128
|
+
- **Not breaking: a step record now also carries `run_id: string |
|
|
2129
|
+
null`.** Nothing stops working without reading it. A script that wants
|
|
2130
|
+
to know which run a step record belongs to, without opening the
|
|
2131
|
+
scenario record beside it first, can read this field instead.
|
|
2132
|
+
|
|
2133
|
+
## 0.2.0 to 0.3.0
|
|
2134
|
+
|
|
2135
|
+
Five breaking changes, plus one action that is not breaking but is needed
|
|
2136
|
+
to opt in to a new capability. Each entry says what to fix; why is in
|
|
2137
|
+
[CHANGELOG.md](https://github.com/meganemura/nukadoko/blob/main/typescript/CHANGELOG.md) under `## 0.3.0`.
|
|
2138
|
+
|
|
2139
|
+
- **A step record's JSON changed field names and id prefix.** A script
|
|
2140
|
+
reading a step record's or scenario record's JSON needs the current
|
|
2141
|
+
names: `receipt_id` is now `record_id`, an id starts `step-` rather
|
|
2142
|
+
than `rcpt-`, and a `used` entry's upstream key is `record`, not
|
|
2143
|
+
`receipt`.
|
|
2144
|
+
- **`.nukadoko/` now splits into three directories, by purpose:
|
|
2145
|
+
`records/`, `export/`, and `cache/`.** A step record's own directory is
|
|
2146
|
+
now under `records/steps/<id>/`, a scenario record's under
|
|
2147
|
+
`records/scenarios/<id>/`; the Allure and messages emitters now write
|
|
2148
|
+
under `export/`; a session now lives under `cache/sessions/`.
|
|
2149
|
+
`.nukadoko/` is gitignored working state, so the old directories can
|
|
2150
|
+
simply be deleted; the next `nuka run` writes the new layout, nothing
|
|
2151
|
+
needs migrating out of them.
|
|
2152
|
+
- **`--use` takes a `step-...` id now.** An id minted before this release
|
|
2153
|
+
points at a directory layout the tool no longer reads; re-run the
|
|
2154
|
+
producing step (`nuka do` or `nuka run`) to get one in the current
|
|
2155
|
+
shape.
|
|
2156
|
+
- **An existing acceptance record may need re-creating.** Run `nuka
|
|
2157
|
+
tend` before upgrading and let it answer: it names every acceptance
|
|
2158
|
+
record actually affected (`signoff-record-old-format`), and names none
|
|
2159
|
+
for a feature inside `featuresDir`, whose sign-off it stopped
|
|
2160
|
+
reporting on in 0.3.0. For the ones it names, `nuka run` the feature
|
|
2161
|
+
again and `nuka accept` it.
|
|
2162
|
+
- **`nuka tend` stops reporting a stale sign-off or a drifted condition
|
|
2163
|
+
for a feature that already lives inside `featuresDir`.** If a project
|
|
2164
|
+
relied on that finding for such a feature, the coverage moved: running
|
|
2165
|
+
that feature, already running unattended, is what confirms the same
|
|
2166
|
+
thing now. `signoff-record-unreadable` is unaffected. No code change is
|
|
2167
|
+
needed either way.
|
|
2168
|
+
- **Not breaking, but needed to opt in: a project with its own
|
|
2169
|
+
`allurerc.mjs` needs `historyPath` added by hand to get Allure's
|
|
2170
|
+
history, trend, and flaky-across-runs views at scenario grain.** Nothing
|
|
2171
|
+
stops working without it, the same as before this release; the new
|
|
2172
|
+
scenario-level Allure test result just never shows up in those views.
|
|
2173
|
+
Add `historyPath: ".nukadoko/export/allure-history.jsonl"` (adjusted if
|
|
2174
|
+
`stateDir` in `nukadoko.config.ts` points elsewhere) alongside the
|
|
2175
|
+
existing `categories` array; `examples/allure/allurerc.mjs` shows the
|
|
2176
|
+
field in place. A project created with `nuka init` on this release
|
|
2177
|
+
already has it.
|
|
2178
|
+
|
|
2179
|
+
## 0.1.0 to 0.2.0
|
|
2180
|
+
|
|
2181
|
+
Three breaking changes. Each entry says what to fix; why is in
|
|
2182
|
+
[CHANGELOG.md](https://github.com/meganemura/nukadoko/blob/main/typescript/CHANGELOG.md) under `## 0.2.0`.
|
|
2183
|
+
|
|
2184
|
+
- **`nuka steps --json`'s top level changed from a bare array to `{ steps,
|
|
2185
|
+
import_failures }`.** Anything reading the old bare array needs to read
|
|
2186
|
+
`.steps` now; `import_failures` (`{ file, message }`) is new alongside
|
|
2187
|
+
it, always present, `[]` when nothing failed.
|
|
2188
|
+
- **Allure now writes one test per step, not one test per scenario.** A
|
|
2189
|
+
report's test count is now a step count, not a scenario count. Read a
|
|
2190
|
+
scenario's own pass/fail from its `suite` row, not from a single test.
|
|
2191
|
+
Allure's history, trend, and flaky-across-runs views no longer work: if
|
|
2192
|
+
CI carried `history.jsonl` forward from a run's generated report into
|
|
2193
|
+
the next run's `allure-results/`, that carry-forward no longer does
|
|
2194
|
+
anything, since nothing in this emitter's output links a step to itself
|
|
2195
|
+
in an earlier run.
|
|
2196
|
+
- **`nuka steps` now exits non-zero when the project has no features
|
|
2197
|
+
directory.** A script that ran it outside a nukadoko project, or after
|
|
2198
|
+
`featuresDir` was renamed without the config following, used to get an
|
|
2199
|
+
empty vocabulary and a clean exit. It now gets the resolved path it
|
|
2200
|
+
looked for on stderr and a non-zero exit, with nothing on stdout. If a
|
|
2201
|
+
pipeline was relying on the clean exit, point it at the right directory
|
|
2202
|
+
or fix `featuresDir` in `nukadoko.config.ts`. A project whose features
|
|
2203
|
+
directory exists but holds no steps is unaffected, and still exits `0`.
|
|
2204
|
+
|
|
2205
|
+
## 0.0.5 to 0.1.0
|
|
2206
|
+
|
|
2207
|
+
Three breaking changes. Each entry says what to fix; why is in
|
|
2208
|
+
[CHANGELOG.md](https://github.com/meganemura/nukadoko/blob/main/typescript/CHANGELOG.md) under `## 0.1.0`.
|
|
2209
|
+
|
|
2210
|
+
- **A typed step's `run` takes a fixture bag now, not `ctx`.** Collect
|
|
2211
|
+
every `ctx.foo` a step reads into a destructured first argument
|
|
2212
|
+
(`run({ page, section }, args)`), then drop `await` and the call
|
|
2213
|
+
parentheses on `page`/`request`: they are values now, not functions. No
|
|
2214
|
+
codemod ships for this.
|
|
2215
|
+
- **`evidence.trace` moved off the scenario record onto each step's own
|
|
2216
|
+
record.** Anything reading the scenario record's `evidence.trace` needs
|
|
2217
|
+
to read the step record of the step that opened a page instead.
|
|
2218
|
+
- **A sign-off record's filename now carries its condition.** Anything
|
|
2219
|
+
reading the old `<feature-basename>.<date>-<sha>.md` shape needs to read
|
|
2220
|
+
`<feature-basename>.<date>-<sha>.<environment>.<browser>.md` instead.
|
|
2221
|
+
|
|
2222
|
+
## Before 0.0.5
|
|
2223
|
+
|
|
2224
|
+
See [CHANGELOG.md](https://github.com/meganemura/nukadoko/blob/main/typescript/CHANGELOG.md).
|