USE_TEST_SUITE_ID_CACHEenv flag for per-suite remote-cache validation. When set to the exact string"true", the validator accepts the currentTEST_SUITE_ID's cache independently of peer suites' state — so an aborted suite on one CI run no longer forces a cold run across every suite on the next. Default unset preserves 1.1.x behaviour byte-for-byte. Ports upstream PR #70 (kirpalsangha), with credit to the interviewstreet fork (PR #1) where the same fix was shipped to HackerRank's production CI in 2024.
SourceFile#file_pathsilently dropped dependencies on external absolute paths (closes the issue behind upstream PRs #37 and #67). When a spec'smetadata[:file_path]resolved to an absolute path outsideRSpecTracer.root— typical for shared examples from vendored gems (/opt/bundle/gems/rspec-rails-X/lib/shared_examples/...) or for monorepo spec files adjacent to the project tree — the method stripped the leading/and expanded againstRSpecTracer.root, producing a non-existent path like<root>/opt/bundle/....File.file?returned false,from_pathreturned nil, and the tracer silently skipped dependency registration for that file. Cache-staleness silent- correctness bug: shared examples from external gems never appeared as dependencies, so changes to them never invalidated the cache. The fix returns the input unchanged only when it's an absolute path to an existing file outsideRSpecTracer.root; all other inputs (relative paths, stripped-root forms, in-root absolute paths) continue through the existing project-relative expansion, preserving byte-for-byte behaviour for 1.1.x configurations.ValidationErrorconstant now defined.remote_cache/validator.rbpreviously referencedValidationErrorin its XOR-guardraisebut the constant was never declared anywhere. Tripping the guard (setting exactly one ofTEST_SUITE_ID/TEST_SUITES) raisedNameError: uninitialized constantinstead of the intended error class. Addedclass ValidationError < StandardErrorinsideValidator, mirroringAws::AwsError.- Typo in the XOR-guard error message —
"enviornment"→"environment". - Single-suite
@cached_files_regexnow anchored —$appended so the pattern no longer matches extraneous-extension files like/ref/hash/foo.json.backup. Multi-suite regex was already anchored in 1.1.x. remote_cache/aws.rb#upload_direrror message — reported"Failed to download files from …"when the upload failed. Closes upstream PR #64 (C3).
- Encoding crash on locale-unset shells — legacy cache, report, and
coverage paths called
File.read/File.writewithout an explicit encoding. Ruby fell back toEncoding.default_external, which resolves toUS-ASCIIon shells launched withoutLANGset (the default for macOS GUI terminals and many LaunchAgent contexts). Any spec description containing a non-ASCII byte (e.g.§, typographic quotes) wrote UTF-8 intoall_examples.json; the next warm run crashed atCache#load_*_cachewithEncoding::InvalidByteSequenceError: "\xC2" on US-ASCII, takingspec_helperdown before any example ran. Every legacy JSON / ERB / Ruby-source read and write now pinsencoding: 'UTF-8';SourceFile.from_pathswitches toFile.binreadso the MD5 digest hashes raw bytes regardless of process locale.
- parallel_tests at-exit deadlock —
parallel_tests_last_process?relied on a lock file written duringRSpecTracer.startto identify the last worker. If a fast worker reachedat_exitbefore a slower peer had loadedspec_helperand registered itsTEST_ENV_NUMBER, both workers could self-elect as the last process, both entered::ParallelTests.wait_for_other_processes_to_finish, and deadlocked on each other's pid. The elector now delegates to::ParallelTests.first_process?, which reads immutable env vars set by the parent at worker spawn. Exactly one worker is elected per run, regardless of boot-time ordering or runner CPU count. No public-API change — therspec_tracer.lockfile is still written and cleaned up, just no longer consulted.
- Ruby 3.1, 3.2, 3.3, 3.4, 4.0 are now CI-gated.
- Rails 7.0, 7.1, 7.2 are CI-gated via a reference sample app.
- Regression specs for four crash bugs (B1–B4) under
spec/lib/rspec_tracer/.
- B1 —
Cache#cached_examples_coveragereturns{}(notnil) whenlast_run.jsonis present butexamples_coverage.jsonis missing; previously this leaked nil into the missed-coverage merge. - B2 —
Runner#generate_missed_coveragetolerates a nil cached coverage map and nil line-strength entries; both are treated as empty / zero. - B3 —
Runner#register_{file,example_file}_dependencyskips (logs debug, returns false) whenSourceFile.from_path/.from_namecannot resolve the file (e.g. gem-generated examples or files deleted between runs). - B4 —
CoverageReporter#merge_coveragetreats nil existing line coverage as 0 when summing skipped-test contributions. - Custom filter and coverage-filter blocks now reach
RSpecTracer::Filter.register— the DSL wrappers were dropping the block, causingadd_filter { |sf| … }to raiseArgumentError. load_global_config.rbwrapsDir.home/Etc.getpwuid.dir/File.expand_path("~user")inrescue ArgumentErrorso gem load never crashes in minimal containers where HOME is unset and the passwd database has no matching entry.
- Behavior change (default filters) — the default dependency
and coverage filter lists now exclude Ruby installation /
toolchain paths:
/lib/rspec_tracer/,/lib/rspec_tracer.rb,/usr/local/lib/ruby/,/usr/local/bundle/,/opt/hostedtoolcache/,/.rbenv/versions/,/.asdf/installs/ruby/,/.rvm/. Previously only/vendor/bundle/was filtered. A test that previously recorded a dependency on a gem file or Ruby stdlib file (because of a custom install path like rbenv or asdf) will no longer record that dependency — those paths are handled byGemfile.lock/ the Ruby version file, not by coverage tracking. If you relied on the old narrow default, add your ownadd_filter/add_coverage_filterto clear the extras.
- Support for Ruby ≤ 3.0 and Rails ≤ 6.x (EOL).
- JRuby support
- Parallel Tests support
The first run on this version will not use any cache on the CI because the number of files changed from eight to eleven, so there will be no appropriate cache to use.
Generate reports ignoring duplicate examples (#42)
Caches getting corrupted on interrupts (#39)
Flaky and failed examples dependency check (#38)
- Handling all examples filtered by RSpec (#34)
- Warn on incorrect analysis to stop using RSpec Tracer (#35)
- Run
SimpleCov.at_exithook (#36)
Unable to find cache in case of history rewrites (#33)
Missing spec files for the gem
Improvements towards reducing dependency and coverage processing time (#26)
Bug in time formatter (#24)
Environment variable to control verbose output (#25)
- Improved dependency change detection (#18)
- Flaky tests detection (#19)
- Exclude vendor files from analysis (#21)
- Report elapsed time at various stages (#23)
The first run on this version will not use any cache on the CI because the number of files changed from eight to nine, so there will be no appropriate cache to use.
- Limit number of cached files download (#16)
- Support for CI
docileversion compatability withsimplecov
- Failures when RSpec required files are outside of project
Initial Release
- Ability to run RSpec Tracer with SimpleCov and without SimpleCov
- Support for HTML reports