rspec-tracer 1.0.5 → 1.1.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 +44 -237
- data/README.md +152 -161
- data/lib/rspec_tracer/cache.rb +32 -25
- data/lib/rspec_tracer/configuration.rb +169 -30
- data/lib/rspec_tracer/coverage_merger.rb +1 -2
- data/lib/rspec_tracer/coverage_reporter.rb +1 -1
- data/lib/rspec_tracer/coverage_writer.rb +2 -2
- data/lib/rspec_tracer/defaults.rb +0 -11
- data/lib/rspec_tracer/example.rb +6 -55
- data/lib/rspec_tracer/html_reporter/reporter.rb +2 -2
- data/lib/rspec_tracer/load_config.rb +15 -0
- data/lib/rspec_tracer/load_default_config.rb +38 -0
- data/lib/rspec_tracer/load_global_config.rb +33 -0
- data/lib/rspec_tracer/load_local_config.rb +17 -0
- data/lib/rspec_tracer/logger.rb +25 -0
- data/lib/rspec_tracer/remote_cache/Rakefile +8 -9
- data/lib/rspec_tracer/remote_cache/aws.rb +11 -19
- data/lib/rspec_tracer/remote_cache/cache.rb +7 -15
- data/lib/rspec_tracer/remote_cache/repo.rb +86 -51
- data/lib/rspec_tracer/remote_cache/validator.rb +2 -4
- data/lib/rspec_tracer/report_generator.rb +2 -2
- data/lib/rspec_tracer/report_merger.rb +2 -15
- data/lib/rspec_tracer/report_writer.rb +21 -21
- data/lib/rspec_tracer/reporter.rb +1 -1
- data/lib/rspec_tracer/rspec_reporter.rb +2 -4
- data/lib/rspec_tracer/rspec_runner.rb +24 -6
- data/lib/rspec_tracer/runner.rb +15 -39
- data/lib/rspec_tracer/source_file.rb +1 -9
- data/lib/rspec_tracer/version.rb +1 -1
- data/lib/rspec_tracer.rb +56 -202
- metadata +12 -20
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b7f283b4a6ab3d0d2616f7dca4bac721906d36b4296ba1d64446937db1503dd5
|
|
4
|
+
data.tar.gz: 2922f96420e344603a472b4e67bb5f2c58c16e8bf798e13098eec8f8096434c5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 222031b5d7b0a6b01cad104fda83347a9e10af957c7a5d1dfede9f46cf8a275435c3e0c9dfb02ad7788b3dfc2d4c3b9513a60ee3ccf0d3bfd68a692758a38f1e
|
|
7
|
+
data.tar.gz: f2828567b26b580ffc66568f8b14581cb160f4bdf14a61622b605b5832d5d3bc86cff211190628c5480604f0ec1c758609ec8aa490b357016e3565615c635be2
|
data/CHANGELOG.md
CHANGED
|
@@ -1,247 +1,54 @@
|
|
|
1
|
-
## [1.0
|
|
1
|
+
## [1.1.0] - 2026-04-20
|
|
2
2
|
|
|
3
|
-
###
|
|
4
|
-
|
|
5
|
-
- **`example_id` is now stable across runs and across no-op edits** —
|
|
6
|
-
`Example.from` previously fed `example.example_group.name` and
|
|
7
|
-
line numbers into the identity-hash payload. Two unrelated effects
|
|
8
|
-
shifted the resulting MD5 across runs that should have been
|
|
9
|
-
identical:
|
|
10
|
-
|
|
11
|
-
- `example_group.name` is RSpec's generated class name with a
|
|
12
|
-
load-order-dependent `_2` / `_3` suffix when two spec files share
|
|
13
|
-
a `describe` name (very common — e.g. `describe User do` in
|
|
14
|
-
`user_spec.rb` and `models/user_spec.rb`). The same example got
|
|
15
|
-
a different id depending on rspec's file load order, silently
|
|
16
|
-
thrashing the cache and breaking failed / pending always-re-run
|
|
17
|
-
guarantees.
|
|
18
|
-
- For unnamed examples (`it { }` / `specify { }` / `example { }`),
|
|
19
|
-
`example.description` falls back to RSpec's line-bearing
|
|
20
|
-
`"example at <path>:<line>"` string, so a no-op blank-line edit
|
|
21
|
-
above the example flipped its id and orphaned its cache entry.
|
|
22
|
-
|
|
23
|
-
The digest now uses `example_group.description` (the user's
|
|
24
|
-
string, not the generated class name), strips the trailing `:LINE`
|
|
25
|
-
from `shared_group_inclusion_backtrace` entries, and for unnamed
|
|
26
|
-
examples substitutes a line-independent positional discriminator
|
|
27
|
-
(the example's 0-based ordinal among the unnamed examples of its
|
|
28
|
-
group). `line_number` / `rerun_file_name` / `rerun_line_number`
|
|
29
|
-
still ride along in the stored payload for the reporter's location
|
|
30
|
-
columns but no longer enter the digest. Contract: *rename = new
|
|
31
|
-
identity; restructure = same identity.*
|
|
32
|
-
|
|
33
|
-
Affected since v1.0.0 (2021). One-time cold run on upgrade: every
|
|
34
|
-
cached `example_id` changes shape, so the first 1.0.5 run misses
|
|
35
|
-
the 1.0.4 cache uniformly and treats every example as no-cache;
|
|
36
|
-
the second run is warm again. Surfaced by the 2.0.0.pre.1 field
|
|
37
|
-
test against third-party Rails apps; ports
|
|
38
|
-
[#209](https://github.com/avmnu-sng/rspec-tracer/pull/209) and
|
|
39
|
-
[#211](https://github.com/avmnu-sng/rspec-tracer/pull/211) onto
|
|
40
|
-
this 1.0.x line. Closes
|
|
41
|
-
[#196](https://github.com/avmnu-sng/rspec-tracer/issues/196) and
|
|
42
|
-
[#210](https://github.com/avmnu-sng/rspec-tracer/issues/210).
|
|
43
|
-
|
|
44
|
-
- **`RSpecTracer.start` no longer crashes when the user pre-started
|
|
45
|
-
`::Coverage`** — users who want branch coverage typically call
|
|
46
|
-
`Coverage.start(lines: true, branches: true)` before loading the
|
|
47
|
-
tracer. On the previous code path, `setup_coverage` called bare
|
|
48
|
-
`::Coverage.start` unconditionally, which raised
|
|
49
|
-
`RuntimeError: coverage measurement is already setup` and crashed
|
|
50
|
-
the tracer init. `setup_coverage` now guards on `Coverage.running?`
|
|
51
|
-
(Ruby 2.7+) and rescues `RuntimeError` for older Rubies; the
|
|
52
|
-
tracer attaches to the already-running `::Coverage` instance
|
|
53
|
-
instead of raising. Ports
|
|
54
|
-
[#207](https://github.com/avmnu-sng/rspec-tracer/pull/207)'s
|
|
55
|
-
Coverage-guard half (the 2.0-only `coverage_modes` DSL is not
|
|
56
|
-
backported). Closes
|
|
57
|
-
[#195](https://github.com/avmnu-sng/rspec-tracer/issues/195).
|
|
58
|
-
|
|
59
|
-
- **`remote_cache` download and upload now log on success** — the
|
|
60
|
-
success paths on `RemoteCache::Cache#download` / `#upload` returned
|
|
61
|
-
silently, so a successful `rake rspec_tracer:remote_cache:download`
|
|
62
|
-
produced zero output and users couldn't tell from CI logs whether
|
|
63
|
-
the cache restored. Two `puts` lines now announce success:
|
|
64
|
-
`rspec-tracer remote_cache: restored cache from <sha>` after a
|
|
65
|
-
successful download, and `rspec-tracer remote_cache: uploaded cache
|
|
66
|
-
to <ref>` after a successful upload. Ports the basic-INFO portion of
|
|
67
|
-
[#201](https://github.com/avmnu-sng/rspec-tracer/pull/201) (the
|
|
68
|
-
cross-branch-fallback qualifier and `prune_all!` line are
|
|
69
|
-
2.0-only — 1.x has neither a multi-tier cache nor a prune_all
|
|
70
|
-
path). Closes
|
|
71
|
-
[#188](https://github.com/avmnu-sng/rspec-tracer/issues/188).
|
|
72
|
-
|
|
73
|
-
### Changed
|
|
74
|
-
|
|
75
|
-
- **Gemspec now requires MFA for publishing** — adds
|
|
76
|
-
`spec.metadata['rubygems_mfa_required'] = 'true'`. Pure packaging
|
|
77
|
-
metadata; no runtime impact for gem consumers. Ports
|
|
78
|
-
[#214](https://github.com/avmnu-sng/rspec-tracer/pull/214).
|
|
79
|
-
|
|
80
|
-
## [1.0.4] - 2026-05-06
|
|
81
|
-
|
|
82
|
-
### Fixed
|
|
83
|
-
|
|
84
|
-
- **Parallel-tests purge race when a sibling worker is still mid-flush**
|
|
85
|
-
— the elected worker trusted only `parallel_tests`'s pid-file barrier
|
|
86
|
-
(`ParallelTests.wait_for_other_processes_to_finish`), which under
|
|
87
|
-
specific scheduling/I/O timing on GHA Linux x86_64 can return while a
|
|
88
|
-
sibling's `parallel_tests_N/` dir hasn't fully flushed. The elected
|
|
89
|
-
then merged + purged, racing the in-progress sibling. Symptoms:
|
|
90
|
-
intermittent leftover `parallel_tests_N/` dir post-purge AND/OR
|
|
91
|
-
silently dropped peer caches in the merge.
|
|
92
|
-
|
|
93
|
-
Backport of upstream PR
|
|
94
|
-
[#168](https://github.com/avmnu-sng/rspec-tracer/pull/168). Adds a
|
|
95
|
-
filesystem barrier layered on top of the pid-file wait. Each worker
|
|
96
|
-
writes a `.rspec_tracer_boot` marker at `RSpecTracer.start` time and
|
|
97
|
-
a `.rspec_tracer_done` marker as the first step of its at_exit tasks;
|
|
98
|
-
the elected worker waits for every booted peer's `.done` to
|
|
99
|
-
materialize before proceeding to merge + purge. Two independent
|
|
100
|
-
signals (pid file + filesystem) must agree before the elected worker
|
|
101
|
-
declares the peer set stable. Bounded at 5 s with a graceful warn
|
|
102
|
-
for crashed peers — their dirs are purged regardless of completion
|
|
103
|
-
state, and the merge accepts whatever's on disk.
|
|
104
|
-
|
|
105
|
-
## [1.0.3] - 2026-05-04
|
|
106
|
-
|
|
107
|
-
### Fixed
|
|
3
|
+
### Added
|
|
108
4
|
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
A user adding a new filter mid-development saw the filter take
|
|
114
|
-
effect only for fresh attributions on cold runs; previously-cached
|
|
115
|
-
paths matching the new filter persisted in `all_files` and
|
|
116
|
-
`dependency` until the next cold run. Filter additions now take
|
|
117
|
-
effect on the very next warm run. (from upstream
|
|
118
|
-
[PR #161](https://github.com/avmnu-sng/rspec-tracer/pull/161))
|
|
119
|
-
|
|
120
|
-
### Note on exclusions
|
|
121
|
-
|
|
122
|
-
The companion default-filter expansion shipped in upstream PR #161
|
|
123
|
-
(adds `rspec_tracer_cache/`, `rspec_tracer_coverage/`,
|
|
124
|
-
`rspec_tracer_report/`, `rspec_tracer.lock` to the default
|
|
125
|
-
`add_filter` / `add_coverage_filter` lists) is intentionally NOT
|
|
126
|
-
backported to this 1.0.x line, for the same reason the broader
|
|
127
|
-
1.1.0 default-filter expansion was excluded from 1.0.1: changing
|
|
128
|
-
the default filter set shifts the files present in `all_files.json`
|
|
129
|
-
for users who track tracer-self paths, which would invalidate their
|
|
130
|
-
existing caches on upgrade. Users on 1.0.x who want this default
|
|
131
|
-
hygiene can either upgrade to 1.2.x / 2.0.x OR add the four paths
|
|
132
|
-
to their own `.rspec-tracer` config explicitly. The carry-forward
|
|
133
|
-
filter check shipped here MAKES that user-side `add_filter` take
|
|
134
|
-
effect on the next warm run.
|
|
135
|
-
|
|
136
|
-
## [1.0.2] - 2026-05-01
|
|
5
|
+
- Ruby 3.1, 3.2, 3.3, 3.4, 4.0 are now CI-gated.
|
|
6
|
+
- Rails 7.0, 7.1, 7.2 are CI-gated via a reference sample app.
|
|
7
|
+
- Regression specs for four crash bugs (B1–B4) under
|
|
8
|
+
`spec/lib/rspec_tracer/`.
|
|
137
9
|
|
|
138
10
|
### Fixed
|
|
139
11
|
|
|
140
|
-
- **
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
`
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
`
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
the iteration call-sites kept the buggy bound. Each method now globs
|
|
161
|
-
the actual `parallel_tests_*` subdirectories under its base path,
|
|
162
|
-
making the merge + purge robust to whatever count parallel_tests
|
|
163
|
-
spawned. (from v1.2.1) No cache format change.
|
|
164
|
-
|
|
165
|
-
## [1.0.1] - 2026-04-24
|
|
166
|
-
|
|
167
|
-
Long-tail maintenance release. Backports high-impact crash and correctness
|
|
168
|
-
fixes from 1.1.x / 1.2.x onto the v1.0.0 foundation so users on Ruby 2.5 -
|
|
169
|
-
3.0 who can't upgrade can still pick them up via `gem 'rspec-tracer', '~> 1.0'`.
|
|
12
|
+
- **B1** — `Cache#cached_examples_coverage` returns `{}` (not `nil`)
|
|
13
|
+
when `last_run.json` is present but `examples_coverage.json` is
|
|
14
|
+
missing; previously this leaked nil into the missed-coverage merge.
|
|
15
|
+
- **B2** — `Runner#generate_missed_coverage` tolerates a nil cached
|
|
16
|
+
coverage map and nil line-strength entries; both are treated as
|
|
17
|
+
empty / zero.
|
|
18
|
+
- **B3** — `Runner#register_{file,example_file}_dependency` skips
|
|
19
|
+
(logs debug, returns false) when `SourceFile.from_path` /
|
|
20
|
+
`.from_name` cannot resolve the file (e.g. gem-generated examples
|
|
21
|
+
or files deleted between runs).
|
|
22
|
+
- **B4** — `CoverageReporter#merge_coverage` treats nil existing
|
|
23
|
+
line coverage as 0 when summing skipped-test contributions.
|
|
24
|
+
- Custom filter and coverage-filter blocks now reach
|
|
25
|
+
`RSpecTracer::Filter.register` — the DSL wrappers were dropping
|
|
26
|
+
the block, causing `add_filter { |sf| … }` to raise
|
|
27
|
+
`ArgumentError`.
|
|
28
|
+
- `load_global_config.rb` wraps `Dir.home` / `Etc.getpwuid.dir` /
|
|
29
|
+
`File.expand_path("~user")` in `rescue ArgumentError` so gem
|
|
30
|
+
load never crashes in minimal containers where HOME is unset and
|
|
31
|
+
the passwd database has no matching entry.
|
|
170
32
|
|
|
171
|
-
###
|
|
33
|
+
### Changed
|
|
172
34
|
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
multibyte spec descriptions. Cache (11), report_writer (12), and nine
|
|
191
|
-
other lib/ call sites covered. (from v1.1.2)
|
|
192
|
-
- `SourceFile.from_path` computes the file digest via `File.binread`, hashing
|
|
193
|
-
raw bytes regardless of Encoding.default_external. (from v1.1.2)
|
|
194
|
-
- `SourceFile.file_path` returns an absolute-external path unchanged when
|
|
195
|
-
the referenced file exists on disk (e.g. shared examples from vendored
|
|
196
|
-
gems at `/opt/bundle/gems/...`), preventing silent drop of dependency
|
|
197
|
-
registration. The guard is narrow — `start_with?('/') &&
|
|
198
|
-
!start_with?(root) && File.file?(path)` — so stripped-root cache forms
|
|
199
|
-
like `/spec/foo.rb` continue through the existing expand_path branch and
|
|
200
|
-
cache `file_name` keys stay byte-identical to v1.0.0. (C1, from v1.2.0)
|
|
201
|
-
- `RemoteCache::Aws#upload_dir` error message corrected from
|
|
202
|
-
"Failed to download files from" to "Failed to upload files from". (C3,
|
|
203
|
-
from v1.2.0)
|
|
204
|
-
- `RemoteCache::Validator::ValidationError` declared as a proper
|
|
205
|
-
`StandardError` subclass inside `Validator`; previously the
|
|
206
|
-
`TEST_SUITE_ID ^ TEST_SUITES` XOR-guard raised a `NameError:
|
|
207
|
-
uninitialized constant` instead of the intended validation error.
|
|
208
|
-
(from v1.2.0)
|
|
209
|
-
- `enviornment` → `environment` typo in the same XOR-guard raise message.
|
|
210
|
-
(from v1.2.0)
|
|
211
|
-
- `RemoteCache::Validator`'s single-suite `@cached_files_regex` anchored
|
|
212
|
-
with a trailing `$` so files with extensions beyond `.json` (e.g.
|
|
213
|
-
`.json.backup`) no longer match as cache files. (from v1.2.0)
|
|
214
|
-
- `RemoteCache::Repo#initialize` guards `ENV['GIT_BRANCH']` for nil
|
|
215
|
-
before calling `.chomp`; previously a `NoMethodError: undefined
|
|
216
|
-
method 'chomp' for nil:NilClass` crashed the init path and masked
|
|
217
|
-
the intended `RepoError` message when `GIT_BRANCH` was not set in
|
|
218
|
-
the environment. (from v1.1.0 PR #51)
|
|
219
|
-
- `RemoteCache::Repo#download_branch_refs` uses `FileUtils.rm_f`
|
|
220
|
-
(not `File.rm_f`) to clean up a partial `branch_refs.json` on a
|
|
221
|
-
failed AWS download. `File.rm_f` is undefined — `rm_f` is a
|
|
222
|
-
FileUtils method — so the failing-download branch would crash with
|
|
223
|
-
`NoMethodError` instead of cleaning up and logging. (from v1.1.0
|
|
224
|
-
PR #65)
|
|
225
|
-
|
|
226
|
-
### Note on exclusions
|
|
227
|
-
|
|
228
|
-
The following items from 1.1.x / 1.2.0 are intentionally NOT in this
|
|
229
|
-
release to preserve the 1.0.0 cache-format contract and Ruby 2.5+ floor:
|
|
230
|
-
|
|
231
|
-
- Default-filter expansion (1.1.0 — adds `/lib/rspec_tracer/`,
|
|
232
|
-
`/usr/local/lib/ruby/`, etc. to the default filters). Changing the
|
|
233
|
-
default filter set shifts the files present in `all_files.json` for
|
|
234
|
-
most users, which would invalidate existing caches on upgrade.
|
|
235
|
-
- `USE_TEST_SUITE_ID_CACHE` opt-in ENV flag (1.2.0). This is a new
|
|
236
|
-
feature, not a bug fix; users who want it can upgrade to 1.2.x.
|
|
237
|
-
- The 1.1+ configuration DSL refactor (anonymous block forwarding,
|
|
238
|
-
alias_method wrapping, ENV.fetch normalizations). These are
|
|
239
|
-
Ruby-3.1-exclusive in places and orthogonal to the crash-fix scope.
|
|
240
|
-
|
|
241
|
-
### Ruby support
|
|
242
|
-
|
|
243
|
-
Gemspec `required_ruby_version` unchanged at `>= 2.5.0`. CI gates
|
|
244
|
-
Ruby 2.5 - 4.0 inclusive on `ubuntu-latest`.
|
|
35
|
+
- **Behavior change (default filters)** — the default dependency
|
|
36
|
+
and coverage filter lists now exclude Ruby installation /
|
|
37
|
+
toolchain paths: `/lib/rspec_tracer/`, `/lib/rspec_tracer.rb`,
|
|
38
|
+
`/usr/local/lib/ruby/`, `/usr/local/bundle/`,
|
|
39
|
+
`/opt/hostedtoolcache/`, `/.rbenv/versions/`,
|
|
40
|
+
`/.asdf/installs/ruby/`, `/.rvm/`. Previously only
|
|
41
|
+
`/vendor/bundle/` was filtered. A test that previously recorded
|
|
42
|
+
a dependency on a gem file or Ruby stdlib file (because of a
|
|
43
|
+
custom install path like rbenv or asdf) will no longer record
|
|
44
|
+
that dependency — those paths are handled by `Gemfile.lock` /
|
|
45
|
+
the Ruby version file, not by coverage tracking. If you relied
|
|
46
|
+
on the old narrow default, add your own `add_filter` /
|
|
47
|
+
`add_coverage_filter` to clear the extras.
|
|
48
|
+
|
|
49
|
+
### Removed
|
|
50
|
+
|
|
51
|
+
- Support for Ruby ≤ 3.0 and Rails ≤ 6.x (EOL).
|
|
245
52
|
|
|
246
53
|
## [1.0.0] - 2021-10-21
|
|
247
54
|
|