rspec-turbo 0.1.3 → 0.1.4
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 +9 -0
- data/lib/rspec_turbo/batch_planner.rb +17 -7
- data/lib/rspec_turbo/config.rb +2 -0
- data/lib/rspec_turbo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 915f14e1ce936aad9171d3f51648306816375e92d2cdf71183d98f6d868d7de6
|
|
4
|
+
data.tar.gz: 82daa10ee176a8a6a7227da969747b3e457185991e610947b5156def763af756
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7cfacafd7fbb69cf930b0d49e14d5d4c05564d6fb5a5ab4ecd2be91ada9ba3e7bee8f768bf71547718bfd02ef900ca17a0b3d6724bdeae6b8b3a46689665299d
|
|
7
|
+
data.tar.gz: 5bf8dfacac64cbea244b5173ed5ebc948e9711e3457acd47270be2a3c85f4aeddea2128b9bfaeb22732816a8b4a445787ff47be3920338519e68e6d3c41106e1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.4] - 2026-09-29
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- Dry-run no longer falls back to equal-weight distribution when the app prints
|
|
7
|
+
to stdout during the run (e.g. SimpleCov's "Coverage report generated…"
|
|
8
|
+
summary, emitted even with `COVERAGE=0` by apps that start it
|
|
9
|
+
unconditionally). The JSON formatter now writes to its own file
|
|
10
|
+
(`--out tmp/rspec-turbo/dry_run.json`), so stdout noise can't corrupt it.
|
|
11
|
+
|
|
3
12
|
## [0.1.3] - 2026-06-12
|
|
4
13
|
|
|
5
14
|
### Fixed
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "fileutils"
|
|
3
4
|
require "json"
|
|
4
5
|
|
|
5
6
|
module RSpecTurbo
|
|
@@ -41,13 +42,10 @@ module RSpecTurbo
|
|
|
41
42
|
return empty_result if @files.empty?
|
|
42
43
|
|
|
43
44
|
t0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
44
|
-
|
|
45
|
+
capture_dry_run
|
|
45
46
|
@dry_run_elapsed = (Process.clock_gettime(Process::CLOCK_MONOTONIC) - t0).round
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
raise "No JSON in dry-run output" unless json_start
|
|
49
|
-
|
|
50
|
-
parse_examples(JSON.parse(raw[json_start..]))
|
|
48
|
+
parse_examples(read_dry_run_json)
|
|
51
49
|
rescue => e
|
|
52
50
|
warn " ⚠ dry-run failed (#{e.message}) — using equal-weight distribution"
|
|
53
51
|
log_dry_run_error
|
|
@@ -55,18 +53,30 @@ module RSpecTurbo
|
|
|
55
53
|
empty_result
|
|
56
54
|
end
|
|
57
55
|
|
|
56
|
+
# The JSON goes to its own file (`--out`), never stdout: apps that start
|
|
57
|
+
# SimpleCov unconditionally print their coverage summary to stdout right
|
|
58
|
+
# after the formatter, which would make the JSON unparseable.
|
|
58
59
|
def capture_dry_run
|
|
60
|
+
FileUtils.mkdir_p(Config.log_dir)
|
|
61
|
+
FileUtils.rm_f(Config.dry_run_json)
|
|
62
|
+
|
|
59
63
|
File.open(Config.dry_run_log, "w") do |err_file|
|
|
60
64
|
IO.popen(
|
|
61
|
-
# COVERAGE=0 keeps SimpleCov from contaminating the JSON on stdout.
|
|
62
65
|
[{"RAILS_ENV" => "test", "COVERAGE" => "0", "TEST_ENV_NUMBER" => "1"},
|
|
63
|
-
"bundle", "exec", "rspec", "--dry-run", "--format", "json",
|
|
66
|
+
"bundle", "exec", "rspec", "--dry-run", "--format", "json", "--out", Config.dry_run_json,
|
|
64
67
|
*@rspec_options, *@files.map { |f| "spec/#{f}" }],
|
|
65
68
|
err: err_file, &:read
|
|
66
69
|
)
|
|
67
70
|
end
|
|
68
71
|
end
|
|
69
72
|
|
|
73
|
+
def read_dry_run_json
|
|
74
|
+
raw = File.exist?(Config.dry_run_json) ? File.read(Config.dry_run_json) : ""
|
|
75
|
+
raise "No JSON in dry-run output" if raw.strip.empty?
|
|
76
|
+
|
|
77
|
+
JSON.parse(raw)
|
|
78
|
+
end
|
|
79
|
+
|
|
70
80
|
def parse_examples(parsed)
|
|
71
81
|
counts = Hash.new(0)
|
|
72
82
|
ids = Hash.new { |hash, key| hash[key] = [] }
|
data/lib/rspec_turbo/config.rb
CHANGED
data/lib/rspec_turbo/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rspec-turbo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- thadeu
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-09-30 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rspec-core
|