
rspec-tracer 2.0.0.pre.2 — flaky-test detection restored + Rails-specific fixes from field testing
Follow-up to the pre.1 announcement on r/ruby a few weeks back. After field-testing pre.1 against several Rails apps, 15 issues surfaced; two more turned up during fix-verification. All 17 closed before the pre.2 tag this week.
What rspec-tracer is, briefly: test-skip caching for RSpec. Tracks which inputs each example depends on; second run skips examples whose inputs didn't change. Cold runs full; warm runs skip everything that wasn't affected by your edit.
Headline — flaky-test detection restored (#194). A top-line README feature present in 1.x since v1.0.0; silently dropped in the 2.0 rewrite. The :flaky registry status, the filter reason, the snapshot field, and the HTML reporter's Flaky tab were all retained, but no code path transitioned an example into :flaky. Caught by an attentive field tester noticing "no flakes reported across N CI runs where I know flakes exist." Would have shipped in 2.0.0 final without it.
Rails-specific fixes:
track_ar_schema_notificationsnow actually fires under the canonical README setup order (RSpecTracer.startBEFORErequire_relative '../config/environment'). Pre-fix:defined?(::Rails::VERSION)was false at engine.setup time, so the entire Rails-observer install path short-circuited —sql.active_recordsubscriber never attached, AND the documenteduse_transactional_fixtureswidening warn never fired. Two silent failures on one code path. Fix is abefore(:suite)late-bind. (#192)- README per-example-precision section now covers Rails engines — an engine's own
lib/isrequired at gem-load time and lands in the boot set regardless ofeager_load. COOKBOOK gains atransitive_load_tracking falseopt-out recipe. (#189) - Engine + dummy-app two-rspec-summary explainer in COOKBOOK. (#190)
parallel_testscache_hit_reasoncounts no longer inflated by worker count (was sum-merging identical per-worker tallies). (#193)
Identity-hash stability (long-standing bugs since v1.0.0):
example_idstable across runs when multiple files share adescribename (the load-order-dependentRSpec::ExampleGroups::Name_Ndisambiguator suffix is no longer in the digest). (#196)example_idstable across line-shift edits forit { ... }/specify { ... }/example { ... }unnamed one-liners. Pervasive in shoulda-matchers model specs. (#210)- Companion fix to the duplicate-detection redesign: NPE in
RSpec.world.example_countfor suites with intermediate describe groups. (#218)
Cache + CLI:
storage_backend :json, serializer: :msgpackno longer crashes onTimevalues. (#182)bin/rspec-tracer cache:info+explaincompose withstorage_backend :sqlite. (#183)bin/rspec-tracer doctorno longer false-reportsSimpleCov/Rails: not loaded. (#184)cache:clear --force/-fsynonym for--yes. (#191)remote_cachesuccess now emits visible INFO lines on download/upload/prune_all. (#188)- New
coverage_modesconfig DSL for standalone Coverage runs. (#195)
Behavior changes worth knowing:
- Cache
schema_versionbumps 3 → 5 cumulatively (one cold-run on upgrade). - Duplicate-example-identity detection now drops the colliders and runs the rest of the suite instead of aborting.
fail_on_duplicatesbecomes purely an exit-code lever.
Both covered in UPGRADING.md.
Install:
# Gemfile
gem 'rspec-tracer', '= 2.0.0.pre.2', group: :test, require: false
Release notes: https://github.com/avmnu-sng/rspec-tracer/releases/tag/v2.0.0.pre.2 CI recipes (CircleCI / GitLab CI / Buildkite / Heroku CI): https://github.com/avmnu-sng/rspec-tracer/blob/main/docs/CI_RECIPES.md COOKBOOK (13 recipes): https://github.com/avmnu-sng/rspec-tracer/blob/v2.0.0.pre.2/COOKBOOK.md Discussion: https://github.com/avmnu-sng/rspec-tracer/discussions/180
2.0.0 rc.1 in ~1-2 weeks if pre.2 is clean. Feedback welcome — 2.0-feedback label on issues feeds straight into the rc.1 triage.