riptide 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/riptide/selector.rb +16 -13
- data/lib/riptide/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4a947805ecb7172ad0027b1038e7f0d98d856dddf7e2606df1489c637dd21808
|
|
4
|
+
data.tar.gz: 133eb45f92218e6776182e4e6cc58f2d281d057b825192bc679dbc4f02998137
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f7e5a9e5ab4c3aa490757b599aae3d1be8146d44e0c07a58ce467a43396d75d9ac986e9d207884a4154f47f92fad5d3604f7a8cf1035f4c6978ade6fab1c2a01
|
|
7
|
+
data.tar.gz: 18137a6557ea637fe7bee482203940ed85f5445ed299813aa107cac1d8082e26c5448dd2d9eb9671dac164b6b9b7034fd2ae428a77e7c098cac6add274ca3a9b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.1](https://github.com/nallenscott/riptide/compare/v0.1.0...v0.1.1) (2026-11-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* let runs recorded after a top-level change hold ([6510159](https://github.com/nallenscott/riptide/commit/6510159da4508a1c5da50e4676b402310d87a330))
|
|
9
|
+
|
|
3
10
|
## 0.1.0 (2026-11-18)
|
|
4
11
|
|
|
5
12
|
|
data/lib/riptide/selector.rb
CHANGED
|
@@ -61,10 +61,6 @@ module Riptide
|
|
|
61
61
|
{ "test" => entry[:test], "reason" => entry[:reason], "change" => KINDS.fetch(entry[:kind]), "through" => entry[:via] && VIA.fetch(entry[:via]) }.compact
|
|
62
62
|
end }
|
|
63
63
|
end
|
|
64
|
-
|
|
65
|
-
def self.full(tests, cause)
|
|
66
|
-
new(mode: :full, total: tests.size, selected: tests.map { |test| { test: test, reason: cause.reason, kind: cause.kind, via: cause.via } })
|
|
67
|
-
end
|
|
68
64
|
end
|
|
69
65
|
|
|
70
66
|
# +indexes+ hold the recorded runs and open failures, from every unit
|
|
@@ -79,7 +75,7 @@ module Riptide
|
|
|
79
75
|
@tests = tests
|
|
80
76
|
@pseudo = pseudo
|
|
81
77
|
@current = {}
|
|
82
|
-
@
|
|
78
|
+
@top_level = {}
|
|
83
79
|
end
|
|
84
80
|
|
|
85
81
|
# { index => { run id => Cause } } for the runs that don't hold here,
|
|
@@ -88,10 +84,7 @@ module Riptide
|
|
|
88
84
|
|
|
89
85
|
def select
|
|
90
86
|
@hits = @indexes.to_h { |index| [index, hits_in(index)] }
|
|
91
|
-
|
|
92
|
-
@hits = @indexes.to_h { |index| [index, index.run_ids.to_h { |id| [id, @suite_cause] }] }
|
|
93
|
-
return Decision.full(@tests, @suite_cause) unless @tests.empty?
|
|
94
|
-
end
|
|
87
|
+
@top_level.each { |path, cause| hit_all_but_current(path, cause) }
|
|
95
88
|
|
|
96
89
|
selected = @tests.filter_map do |test|
|
|
97
90
|
cause = cause_to_run(test)
|
|
@@ -131,7 +124,6 @@ module Riptide
|
|
|
131
124
|
changed(index, path, version, current) do |reason, kind, reached|
|
|
132
125
|
reached.each { |id, via| hits[id] ||= Cause.new(reason, kind, via) }
|
|
133
126
|
end
|
|
134
|
-
return hits if @suite_cause
|
|
135
127
|
end
|
|
136
128
|
end
|
|
137
129
|
hits
|
|
@@ -153,7 +145,10 @@ module Riptide
|
|
|
153
145
|
change = @analyzer.change(path, version)
|
|
154
146
|
return yield("#{path} changed, and the recorded version isn't in this repository", :deleted, recorded.call) if change.nil?
|
|
155
147
|
return if change.empty?
|
|
156
|
-
|
|
148
|
+
if change.suite?
|
|
149
|
+
@top_level[path] ||= Cause.new("#{path} changed top-level code", :boot)
|
|
150
|
+
return yield(@top_level[path].reason, :boot, recorded.call)
|
|
151
|
+
end
|
|
157
152
|
return yield("#{path} changed as a whole", ruby?(path) ? :code : whole_kind(path), recorded.call) if change.whole?
|
|
158
153
|
|
|
159
154
|
runs = nil
|
|
@@ -194,8 +189,16 @@ module Riptide
|
|
|
194
189
|
@shared_names ||= @tests.tally.filter_map { |test, count| test if count > 1 }.to_set
|
|
195
190
|
end
|
|
196
191
|
|
|
197
|
-
|
|
198
|
-
|
|
192
|
+
# Top-level code runs at boot, so a change to it reaches every test, even
|
|
193
|
+
# one whose run never recorded the file. A run recorded against the file
|
|
194
|
+
# as it is now saw that code, so it still holds unless it also recorded
|
|
195
|
+
# an older version.
|
|
196
|
+
def hit_all_but_current(path, cause)
|
|
197
|
+
current = current_sha(path)
|
|
198
|
+
@indexes.each do |index|
|
|
199
|
+
saw = index.manifest.fetch(path, []).include?(current) ? index.reach(index.postings(path, current)["all"]) : {}
|
|
200
|
+
index.run_ids.each { |id| @hits[index][id] ||= cause unless saw.key?(id) }
|
|
201
|
+
end
|
|
199
202
|
end
|
|
200
203
|
|
|
201
204
|
def current_sha(path)
|
data/lib/riptide/version.rb
CHANGED