rspec-tracer 2.0.0.pre.1 → 2.0.0.rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +311 -0
  3. data/README.md +211 -143
  4. data/lib/rspec_tracer/cli/blast_radius.rb +318 -0
  5. data/lib/rspec_tracer/cli/cache_clear.rb +21 -5
  6. data/lib/rspec_tracer/cli/cache_info.rb +27 -24
  7. data/lib/rspec_tracer/cli/doctor.rb +49 -17
  8. data/lib/rspec_tracer/cli/explain.rb +193 -66
  9. data/lib/rspec_tracer/cli/report_open.rb +13 -5
  10. data/lib/rspec_tracer/cli/snapshot_helpers.rb +119 -0
  11. data/lib/rspec_tracer/cli.rb +116 -13
  12. data/lib/rspec_tracer/configuration.rb +103 -8
  13. data/lib/rspec_tracer/defaults.rb +7 -1
  14. data/lib/rspec_tracer/engine.rb +159 -67
  15. data/lib/rspec_tracer/example.rb +128 -13
  16. data/lib/rspec_tracer/line_stub.rb +3 -2
  17. data/lib/rspec_tracer/logger.rb +27 -8
  18. data/lib/rspec_tracer/remote_cache/user_tasks.rb +47 -8
  19. data/lib/rspec_tracer/reporters/html/package-lock.json +213 -200
  20. data/lib/rspec_tracer/reporters/html/package.json +2 -2
  21. data/lib/rspec_tracer/rspec/metadata.rb +1 -1
  22. data/lib/rspec_tracer/rspec/runner_hook.rb +87 -9
  23. data/lib/rspec_tracer/source_file.rb +3 -3
  24. data/lib/rspec_tracer/storage/backend.rb +62 -0
  25. data/lib/rspec_tracer/storage/json_backend.rb +32 -14
  26. data/lib/rspec_tracer/storage/lazy_snapshot.rb +1 -1
  27. data/lib/rspec_tracer/storage/schema.rb +13 -6
  28. data/lib/rspec_tracer/storage/serializer/msgpack.rb +81 -4
  29. data/lib/rspec_tracer/storage/snapshot.rb +15 -1
  30. data/lib/rspec_tracer/storage/sqlite_backend.rb +12 -5
  31. data/lib/rspec_tracer/tracker/env_matcher.rb +5 -5
  32. data/lib/rspec_tracer/tracker/loaded_files_tracker.rb +1 -1
  33. data/lib/rspec_tracer/tracker/new_file_detector.rb +3 -3
  34. data/lib/rspec_tracer/version.rb +1 -1
  35. data/lib/rspec_tracer.rb +8 -1
  36. metadata +12 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04d2e3c76b8351f5f71f93cd722af23975f80da067f19970471455b3b2ed16aa
4
- data.tar.gz: 0ab86f0d744275db42ed0d355d5781d25a6f65ed49a76fcd70d3df1acd7e01b4
3
+ metadata.gz: 0b2339c836852122ba3d8e4ca1e36a430ed9fe3950de724a74cc608f1dd8a524
4
+ data.tar.gz: e76654936dae948f7ca4b20cf1feab82aa977c63608c69f0051776b36fb3b2b8
5
5
  SHA512:
6
- metadata.gz: e802e4c67a41d1d1ebd16df2fd4ee874f0993678097563f38b5bd3e443024662040547df140dd45196c0e81e7d510ecfe79dbf4a3e01ab1a4685f380f9ec829f
7
- data.tar.gz: 72435a0282503ff2c90b6b80168fb810bd48412bc162043b4d70780b35f74478fc5236c43710bb9e948657b2c6c17734a59406fc617cb712eaba7e1a3c2e4dfb
6
+ metadata.gz: 9dfec94b0a6674ac1921dae16611342df860cfd4d988b9c9761c84cd1d1b09060a40501a86cedb09fd8f87cc597aa2bda2650ba0702181756eaab906c1245869
7
+ data.tar.gz: 3adc8e2c46a2a400a03d672f15b6e706480bd83b17cc201b3e83ee9f61adde36e5cce7f76b1ae69fbd9e1ad693f2bfb5c762fedd3f7da8998e59b980a8f77d95
data/CHANGELOG.md CHANGED
@@ -1,3 +1,314 @@
1
+ ## [2.0.0.rc.1] - 2026-07-13
2
+
3
+ The first release candidate of the 2.0 line. Fixes the
4
+ duplicate-example drop discarding spec files whose examples live in
5
+ nested `describe` groups
6
+ ([#262](https://github.com/avmnu-sng/rspec-tracer/issues/262), fixed
7
+ in [#265](https://github.com/avmnu-sng/rspec-tracer/pull/265)); adds
8
+ a `blast-radius` CLI sub-command
9
+ ([#230](https://github.com/avmnu-sng/rspec-tracer/issues/230)) and an
10
+ `explain --not-run` flag
11
+ ([#231](https://github.com/avmnu-sng/rspec-tracer/issues/231)), both
12
+ shipped in [#273](https://github.com/avmnu-sng/rspec-tracer/pull/273);
13
+ and repositions the README and docs around the soundness model, CI
14
+ cost framing, and maintenance policy
15
+ ([#266](https://github.com/avmnu-sng/rspec-tracer/pull/266), closing
16
+ [#223](https://github.com/avmnu-sng/rspec-tracer/issues/223)–[#229](https://github.com/avmnu-sng/rspec-tracer/issues/229)).
17
+ CI and maintenance hardening alongside: exact dev-tool gem pins
18
+ ([#267](https://github.com/avmnu-sng/rspec-tracer/pull/267)), a lint
19
+ gate against internal planning vocabulary shipping in public files
20
+ ([#272](https://github.com/avmnu-sng/rspec-tracer/pull/272)), a weekly
21
+ non-gating Ruby-HEAD canary
22
+ ([#269](https://github.com/avmnu-sng/rspec-tracer/pull/269)), a
23
+ `release:preflight` task
24
+ ([#270](https://github.com/avmnu-sng/rspec-tracer/pull/270)), removal
25
+ of the unused 1.x sample-project tree
26
+ ([#268](https://github.com/avmnu-sng/rspec-tracer/pull/268)), and
27
+ security dependency updates across the sample Rails app and CI
28
+ actions ([#257](https://github.com/avmnu-sng/rspec-tracer/pull/257),
29
+ [#259](https://github.com/avmnu-sng/rspec-tracer/pull/259)–[#261](https://github.com/avmnu-sng/rspec-tracer/pull/261),
30
+ [#263](https://github.com/avmnu-sng/rspec-tracer/pull/263),
31
+ [#264](https://github.com/avmnu-sng/rspec-tracer/pull/264)).
32
+
33
+ The cache `schema_version` is unchanged at `5`: a pre.2 cache carries
34
+ forward warm -- no cold run on this upgrade. See
35
+ [`UPGRADING.md`](UPGRADING.md).
36
+
37
+ ### Added
38
+
39
+ - **Soundness model documentation.** New ARCHITECTURE.md section
40
+ classifying what the tracer guarantees (content digests, explicit
41
+ declarations, env snapshots), where it is deliberately
42
+ conservative, where it relies on heuristics, and what it cannot
43
+ observe at all -- with the `tracks:` DSL as the escape hatch
44
+ ([#226](https://github.com/avmnu-sng/rspec-tracer/issues/226)).
45
+ - **Cost framing for CI.** New README section with measured cold/warm
46
+ timings and a formula for estimating CI-minute and dollar savings
47
+ from your own suite's numbers and your provider's rate
48
+ ([#227](https://github.com/avmnu-sng/rspec-tracer/issues/227)).
49
+ - **Maintenance and Ruby EOL policy.** New README Maintenance
50
+ section: each Ruby is supported until at least upstream EOL plus
51
+ 6 months, with a per-version table
52
+ ([#229](https://github.com/avmnu-sng/rspec-tracer/issues/229)).
53
+ - **COOKBOOK recipes for flaky-test detection and file-to-test
54
+ dependency mapping**, placed ahead of the acceleration recipes
55
+ ([#224](https://github.com/avmnu-sng/rspec-tracer/issues/224)).
56
+ - **`blast-radius` CLI sub-command.** `bundle exec rspec-tracer
57
+ blast-radius <file> [<file> ...]` reports how many examples a
58
+ change to each file would re-run (`450 examples across 12 spec
59
+ files`), with `--list` to enumerate them (location + description)
60
+ and `--json` for tooling. Multiple files compose with a
61
+ deduplicated total, so `git diff --name-only main | xargs bundle
62
+ exec rspec-tracer blast-radius` shows what a PR invalidates;
63
+ untracked paths report as such and exit 0 to keep that pipeline
64
+ unbroken. Whole-suite invalidators and boot-set files report
65
+ `re-runs all N examples`
66
+ ([#230](https://github.com/avmnu-sng/rspec-tracer/issues/230)).
67
+ - **`explain --not-run` flag.** The skip-side view of `explain`:
68
+ whether the example was skipped on the last run (and the
69
+ derivation of why no run trigger fired), its last recorded
70
+ status, and what would make it run on the next invocation, plus
71
+ the tracked dependency files
72
+ ([#231](https://github.com/avmnu-sng/rspec-tracer/issues/231)).
73
+ - **Doctor CI-environment line.** `rspec-tracer doctor` prints an
74
+ INFO line naming the CI env var it detected and pointing at the
75
+ cache-persistence recipes in
76
+ [`docs/CI_RECIPES.md`](docs/CI_RECIPES.md); never affects the
77
+ exit status
78
+ ([#228](https://github.com/avmnu-sng/rspec-tracer/issues/228)).
79
+
80
+ ### Changed
81
+
82
+ - **README restructured as a landing page**
83
+ ([#223](https://github.com/avmnu-sng/rspec-tracer/issues/223)):
84
+ measured, attributed numbers, quick start, safety summary, and
85
+ data-stays-local positioning
86
+ ([#225](https://github.com/avmnu-sng/rspec-tracer/issues/225)) up
87
+ front; the input-taxonomy depth moved to ARCHITECTURE.md and the
88
+ eager-load precision guidance to COOKBOOK.md; per-provider CI
89
+ cache recipes ([`docs/CI_RECIPES.md`](docs/CI_RECIPES.md)) linked
90
+ from the quick start
91
+ ([#228](https://github.com/avmnu-sng/rspec-tracer/issues/228)).
92
+ - **Gem summary and description repositioned** to lead with
93
+ flaky-test detection and dependency mapping, with
94
+ re-run-only-what-changed as the closing step
95
+ ([#224](https://github.com/avmnu-sng/rspec-tracer/issues/224)).
96
+
97
+ ### Fixed
98
+
99
+ - **CLI degrades cleanly when the project config itself is broken.**
100
+ A `.rspec-tracer` that raises at load time (including a
101
+ `SyntaxError`, which is not a `StandardError`) used to crash every
102
+ `rspec-tracer` sub-command with the raw backtrace plus a second
103
+ `NoMethodError` backtrace from the library's `at_exit` hook firing
104
+ against the half-loaded module. The binary now prints a one-line
105
+ `could not load configuration` message and exits 1, and `--help` /
106
+ `--version` answer without booting the config at all
107
+ ([#273](https://github.com/avmnu-sng/rspec-tracer/pull/273)).
108
+
109
+ - **Duplicate-example drop no longer discards nested spec files**
110
+ ([#262](https://github.com/avmnu-sng/rspec-tracer/issues/262)).
111
+ With at least one pair of colliding example identities anywhere in
112
+ the suite, the drop path rebuilt RSpec's top-level group list by
113
+ requiring each top-level group to directly own surviving examples,
114
+ so every spec file whose examples live inside nested `describe`
115
+ blocks was removed wholesale (a 399-example suite with one
116
+ colliding pair ran only 68 examples; with
117
+ `fail_on_duplicates false` that under-run exited zero). The group
118
+ filter now maps each surviving example back to its top-level
119
+ group, so exactly the colliding examples are dropped — the
120
+ behavior UPGRADING.md documents.
121
+
122
+ ## [2.0.0.pre.2] - 2026-05-16
123
+
124
+ Bug-fix + interop release after the field-test pass that followed
125
+ `v2.0.0.pre.1`. 15 issues filed publicly
126
+ ([#182](https://github.com/avmnu-sng/rspec-tracer/issues/182)–[#196](https://github.com/avmnu-sng/rspec-tracer/issues/196))
127
+ plus two follow-on findings
128
+ ([#210](https://github.com/avmnu-sng/rspec-tracer/issues/210) and
129
+ [#218](https://github.com/avmnu-sng/rspec-tracer/issues/218))
130
+ surfaced during fix-verification; all 17 are closed at tag. No CI
131
+ surface drops, no Ruby / Rails / RSpec floor changes.
132
+
133
+ The cumulative cache `schema_version` path is `3 → 5` (two bumps
134
+ across [#209](https://github.com/avmnu-sng/rspec-tracer/pull/209)
135
+ and [#211](https://github.com/avmnu-sng/rspec-tracer/pull/211));
136
+ a pre.1 cache cold-loads cleanly on the pre.2 upgrade in one cold
137
+ run, then warm caches resume. See [`UPGRADING.md`](UPGRADING.md).
138
+
139
+ ### Added
140
+
141
+ - **`coverage_modes` config DSL** for the standalone Coverage
142
+ path (no SimpleCov). Pass any subset of
143
+ `[:lines, :branches, :methods, :oneshot_lines, :eval]`; default
144
+ `[:lines]` keeps byte-compatibility with prior runs. Threaded
145
+ through both `RSpecTracer.setup_coverage` and
146
+ `Engine#ensure_coverage_started`; inert when SimpleCov drives
147
+ Coverage. New COOKBOOK recipe "Coverage modes (rspec-tracer +
148
+ SimpleCov interop)" under recipe 9 documents the per-mode
149
+ interop matrix.
150
+ - **`bin/rspec-tracer cache:clear --force` / `-f`** as a synonym
151
+ for `--yes` / `-y`. Matches the common Unix-CLI convention.
152
+ - **COOKBOOK recipe for the `:msgpack` serializer** documenting
153
+ the `storage_backend :json, serializer: :msgpack` option for
154
+ ~3.5× smaller caches than `:json` on dependency-heavy suites.
155
+ Notes that `.msgpack.gz` payloads are raw `Zlib::Deflate`
156
+ streams (not gzip format) — the suffix is cosmetic and may
157
+ change in a future major release.
158
+
159
+ ### Changed
160
+
161
+ - **Cache `schema_version` bump 3 → 5** (cumulative). The
162
+ `example_id` digest now drops the load-order-dependent
163
+ generated-class-name suffix and the line-number fields, and
164
+ substitutes a positional discriminator for unnamed
165
+ `it { }` / `specify { }` / `example { }` examples that
166
+ previously picked up RSpec's `"example at <path>:<line>"`
167
+ description fallback. First run on pre.2 is cold; subsequent
168
+ runs return to warm. See [`UPGRADING.md`](UPGRADING.md)
169
+ "Schema-version cold runs."
170
+ - **Duplicate-example-identity detection now prune-and-continue.**
171
+ When the runner detects two examples with the same identity,
172
+ it drops the colliders from the run and lets the rest of the
173
+ suite proceed, instead of aborting the entire run to zero
174
+ examples. `fail_on_duplicates` becomes purely an exit-code
175
+ lever — the non-colliding remainder always runs. The error log
176
+ names the colliding examples (file:line + description) with a
177
+ remediation hint. See [`UPGRADING.md`](UPGRADING.md)
178
+ "Duplicate example identities."
179
+
180
+ ### Fixed
181
+
182
+ - **Restored flaky-test detection across runs.** A top-line
183
+ README feature present in 1.x since v1.0.0; silently dropped
184
+ in the 2.0 rewrite — the registry `:flaky` status, the
185
+ `:flaky_example` filter reason, the `flaky_examples` snapshot
186
+ field, and the HTML reporter's Flaky tab were all retained,
187
+ but no production code path transitioned an example into
188
+ `:flaky`. `on_example_passed` now promotes a
189
+ previously-failed-or-flaky example into `:flaky`;
190
+ `on_example_failed` keeps a previously-flaky example sticky.
191
+ Closes [#194](https://github.com/avmnu-sng/rspec-tracer/issues/194).
192
+ - **`run_reason` field in `report.json` (and the terminal
193
+ `by reason:` line) now persists the correct reason on warm
194
+ runs for every reason path** — `Failed previously`,
195
+ `Pending previously`, `Interrupted previously`, `Files changed`,
196
+ `Environment changed`. Previously displayed as `No cache` on
197
+ every warm-run case because `Engine#register_example`
198
+ short-circuited on the entry already seeded from the previous
199
+ snapshot. Single-character fix closing all five reason paths.
200
+ Closes [#186](https://github.com/avmnu-sng/rspec-tracer/issues/186).
201
+ - **Parallel-`tests` `cache_hit_reason` counts no longer inflated
202
+ by worker count.** Each worker independently computed an
203
+ identical `filtered_examples` hash against the global
204
+ previous-run snapshot; the pre-fix sum-merge inflated
205
+ always-re-run buckets N-fold. The merge now keys on
206
+ `example_id` (first-write-wins), then re-tallies. Closes
207
+ [#193](https://github.com/avmnu-sng/rspec-tracer/issues/193).
208
+ - **`example_id` stable across runs when multiple files share a
209
+ `describe` name** (the load-order-dependent
210
+ `RSpec::ExampleGroups::Name_N` disambiguator suffix is no
211
+ longer in the digest) **and stable across line-shift edits for
212
+ unnamed one-liner examples** (`it { is_expected.to eq(7) }`,
213
+ `specify { ... }`, `example { ... }`). Long-standing bugs since
214
+ v1.0.0; pervasive in shoulda-matchers model specs which are
215
+ almost entirely one-liner matcher syntax. Closes
216
+ [#196](https://github.com/avmnu-sng/rspec-tracer/issues/196)
217
+ + [#210](https://github.com/avmnu-sng/rspec-tracer/issues/210).
218
+ - **NPE in `RSpec.world.example_count` for suites with
219
+ intermediate describe groups after rspec-tracer drops a
220
+ duplicate-identity example.** Companion fix to the
221
+ duplicate-detection prune-and-continue redesign above — the
222
+ kept-map needed a default block so descendants of an
223
+ intermediate describe (a describe containing only nested
224
+ describes, no direct `it`s) resolve to an empty array on the
225
+ `filtered_examples` lookup instead of `nil`. Closes
226
+ [#218](https://github.com/avmnu-sng/rspec-tracer/issues/218).
227
+ - **`storage_backend :json, serializer: :msgpack` no longer
228
+ crashes on `Time` values** (and `Symbol` values now round-trip
229
+ losslessly across the cache). Registered
230
+ `MessagePack::Factory` type extensions for `Time` (12-byte
231
+ `tv_sec + tv_nsec`, UTC-canonicalized on decode) and `Symbol`
232
+ (UTF-8 body). Users who followed rspec-tracer's own 50 MiB
233
+ cache warning's `:msgpack` recommendation no longer brick
234
+ their cache silently on the first run that writes a `Time`.
235
+ Closes [#182](https://github.com/avmnu-sng/rspec-tracer/issues/182).
236
+ - **`bin/rspec-tracer cache:info` and `explain` now compose with
237
+ `storage_backend :sqlite`.** Previously hardcoded the
238
+ JsonBackend on-disk layout and reported `no last_run.json yet`
239
+ on every sqlite run, even after a successful rspec. Both CLI
240
+ sub-commands now dispatch through a shared
241
+ `Storage::Backend.build` factory; sqlite metadata-table reads
242
+ surface alongside JSON manifest reads behind the same
243
+ protocol. Closes
244
+ [#183](https://github.com/avmnu-sng/rspec-tracer/issues/183).
245
+ - **`bin/rspec-tracer doctor` no longer false-reports `SimpleCov:
246
+ not loaded` / `Rails: not loaded`** when those gems ARE in the
247
+ Gemfile (doctor runs in its own process; app code doesn't load
248
+ there). Three states are now reported: loaded-in-this-process
249
+ (`OK`), installed-but-not-loaded
250
+ (`INFO ... installed (<version>; not loaded in doctor's process)`),
251
+ and not-installed (`INFO ... not installed`). Closes
252
+ [#184](https://github.com/avmnu-sng/rspec-tracer/issues/184).
253
+ - **`bin/rspec-tracer` invocation guidance flipped to
254
+ `bundle exec rspec-tracer`** across README, COOKBOOK, and
255
+ UPGRADING. The bare `bin/rspec-tracer` form required users to
256
+ run `bundle binstubs rspec-tracer` first; `bundle exec
257
+ rspec-tracer` works out of the box. Closes
258
+ [#185](https://github.com/avmnu-sng/rspec-tracer/issues/185).
259
+ - **`reports_s3_path` deprecation warning no longer false-flags
260
+ on the probe path** — when no `remote_cache_backend` /
261
+ `remote_cache_uri` is configured AND the user runs
262
+ `rake rspec_tracer:remote_cache:download` / `:upload` /
263
+ `:prune_all`. A new non-warning predicate gates the probe; the
264
+ deprecation now fires only on legitimate use of the legacy
265
+ DSL. Closes
266
+ [#187](https://github.com/avmnu-sng/rspec-tracer/issues/187).
267
+ - **`remote_cache` success now emits visible INFO lines** for
268
+ `download!` (`restored cache from <ref>` — with a
269
+ `(cross-branch fallback)` qualifier when a PR-tier download
270
+ falls through to a commit-ancestry ref successfully),
271
+ `upload!` (`uploaded cache to <ref>`), and `prune_all!`
272
+ (`prune_all removed N refs`). One fix covers all three
273
+ backends (s3 / redis / file) + the cron-driven `prune_all`
274
+ admin task. Closes
275
+ [#188](https://github.com/avmnu-sng/rspec-tracer/issues/188).
276
+ - **`track_ar_schema_notifications` now installs correctly under
277
+ the canonical README setup order** (`RSpecTracer.start` BEFORE
278
+ `require_relative '../config/environment'`). Previously,
279
+ `defined?(::Rails::VERSION)` was false at engine.setup time
280
+ and the entire Rails-observer install path short-circuited —
281
+ the `sql.active_record` subscriber never attached AND the
282
+ documented `use_transactional_fixtures`-widening warn never
283
+ fired. Now late-binds via a `before(:suite)` hook that
284
+ re-checks Rails-loaded state after `rails_helper.rb` has
285
+ required the environment. Closes
286
+ [#192](https://github.com/avmnu-sng/rspec-tracer/issues/192).
287
+ - **`RSpecTracer.start` no longer crashes** when the user
288
+ pre-starts `::Coverage` (e.g. to opt into branch coverage for
289
+ SimpleCov-free runs). The `setup_coverage` entry point now
290
+ matches `Engine#ensure_coverage_started`'s `Coverage.running?`
291
+ guard + `RuntimeError` rescue. Closes
292
+ [#195](https://github.com/avmnu-sng/rspec-tracer/issues/195).
293
+ - **`InvalidUsageError` raised on conflicting
294
+ `remote_cache_backend` / `remote_cache_uri` configuration now
295
+ names both DSLs and explains they are alternatives.** The
296
+ previous `<dsl> already configured` message was confusing when
297
+ the user only typed `remote_cache_uri` (which dispatches
298
+ internally to `remote_cache_backend`).
299
+ - **README per-example-precision section now covers Rails
300
+ engines.** An engine's own `lib/` is `require`d at gem-load
301
+ time via the Gemfile.lock cascade and lands in the boot set
302
+ **regardless of `eager_load`**. COOKBOOK gains a
303
+ `transitive_load_tracking false` opt-out recipe with the
304
+ trade-off documented. Closes
305
+ [#189](https://github.com/avmnu-sng/rspec-tracer/issues/189).
306
+ - **Engine + dummy-app two-rspec-summary explainer** added to
307
+ COOKBOOK — clarifies which of the two terminal summary totals
308
+ is authoritative when an engine fixture invokes RSpec against
309
+ its dummy app. Closes
310
+ [#190](https://github.com/avmnu-sng/rspec-tracer/issues/190).
311
+
1
312
  ## [2.0.0.pre.1] - 2026-05-06
2
313
 
3
314
  The first pre-release of the 2.0 line. Architecture rewrite around