ci-queue 0.9.0 → 0.9.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/lib/ci/queue/version.rb +1 -1
- data/lib/rspec/queue.rb +8 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75fc560a4dbae8a7ad7487570afaef29048788b8
|
4
|
+
data.tar.gz: 1f84cff31f94272e01e436e70a3f4a66a9dc70d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af05def95dc288e9a78b9fa5ccae1d62080d74a37f50ed3702cbceefc7da6ea641178dd988d1b02e1ae574bb57aa07e4fcfa7a6d4f434e79f86c23248623efe2
|
7
|
+
data.tar.gz: 18930ed5ca16d136100658302e23509062245259cc3e7cc2749c9c4e7812e7a28c692799cfaad85e982aec8bd34b5593c4f898d8e5851550a53f2cc738b1f32c
|
data/lib/ci/queue/version.rb
CHANGED
data/lib/rspec/queue.rb
CHANGED
@@ -149,14 +149,14 @@ module RSpec
|
|
149
149
|
end
|
150
150
|
|
151
151
|
def run_specs(example_groups)
|
152
|
-
examples = example_groups.flat_map do |example_group|
|
152
|
+
examples = example_groups.flat_map(&:descendants).flat_map do |example_group|
|
153
153
|
example_group.filtered_examples.map do |example|
|
154
154
|
SingleExample.new(example_group, example)
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
158
158
|
queue = CI::Queue.from_uri(queue_url, RSpec::Queue.config)
|
159
|
-
queue.populate(examples, &:id)
|
159
|
+
queue.populate(shuffle(examples), &:id)
|
160
160
|
examples_count = examples.size # TODO: figure out which stub value would be best
|
161
161
|
success = true
|
162
162
|
@configuration.reporter.report(examples_count) do |reporter|
|
@@ -174,6 +174,12 @@ module RSpec
|
|
174
174
|
|
175
175
|
private
|
176
176
|
|
177
|
+
def shuffle(examples)
|
178
|
+
return examples unless RSpec::Queue.config.seed
|
179
|
+
random = Random.new(Digest::MD5.hexdigest(RSpec::Queue.config.seed).to_i(16))
|
180
|
+
examples.shuffle(random: random)
|
181
|
+
end
|
182
|
+
|
177
183
|
def queue_url
|
178
184
|
configuration.queue_url || ENV['CI_QUEUE_URL']
|
179
185
|
end
|