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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98b80ab169a69259f71c570b707f087c3b81de3c
4
- data.tar.gz: c2fdd8f99b8462fde12ba800f4e5060263705bc2
3
+ metadata.gz: 75fc560a4dbae8a7ad7487570afaef29048788b8
4
+ data.tar.gz: 1f84cff31f94272e01e436e70a3f4a66a9dc70d5
5
5
  SHA512:
6
- metadata.gz: 670223dbcfc6d462c25086fa449ef07063bb2b325d4e977489e7b78afd9e02bf07de55b240e92e9b95bb6a695500154dcce8c993e5ba81bfe1faafa5771d2fa9
7
- data.tar.gz: 0c4a98d593e3088ea58b097785b002ac78bc51990545719f630144fdf72c59dfbe76c8ade54c157864163a3445811b29b452947bfbfdeae75545c0c356470275
6
+ metadata.gz: af05def95dc288e9a78b9fa5ccae1d62080d74a37f50ed3702cbceefc7da6ea641178dd988d1b02e1ae574bb57aa07e4fcfa7a6d4f434e79f86c23248623efe2
7
+ data.tar.gz: 18930ed5ca16d136100658302e23509062245259cc3e7cc2749c9c4e7812e7a28c692799cfaad85e982aec8bd34b5593c4f898d8e5851550a53f2cc738b1f32c
@@ -1,6 +1,6 @@
1
1
  module CI
2
2
  module Queue
3
- VERSION = '0.9.0'
3
+ VERSION = '0.9.1'
4
4
  DEV_SCRIPTS_ROOT = ::File.expand_path('../../../../../redis', __FILE__)
5
5
  RELEASE_SCRIPTS_ROOT = ::File.expand_path('../redis', __FILE__)
6
6
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci-queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier