parallel_tests 2.27.1 → 2.28.0

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
  SHA256:
3
- metadata.gz: 2c0d037eea7b592064d9d2007adcce250232de16622be3c2f9f256f15c03a1c1
4
- data.tar.gz: e8a767ea7925b219c963109e7411f07280a21a811d8e0e8c1a5508586653477c
3
+ metadata.gz: a6a3302bc606b106b21ad18230f4c44c0981890cf5e603ecd7a85f4a800766f6
4
+ data.tar.gz: c1269f9f6a3faba3d8220a360d2b050d49ccef83c14c83cf6a243a4dca7d245c
5
5
  SHA512:
6
- metadata.gz: c79393d94206facc0d7dcb3a4cc9c6a75dcde52a4fc43848340b86f3d0329fe32f08f858e5de663f20a6fff2f78c68245924d812923a075e7222ae61e11dca6c
7
- data.tar.gz: 408023256ca77f083d14e8c9c8d88468604b92cbe74bddc64af1597676160afd9dbab68d33e49a9f1638f774f55273f0d78335350eb75517e6797e3e48a1f884
6
+ metadata.gz: a1e9ea15748222c5acc25f8a2fee413bed29e7dff207ff968b1ffe2cbe54bb221acca26c5c83abe5f0188a8f41226392fdf356be75a2e47573c18cc0c477b406
7
+ data.tar.gz: ea67c57a7037e57936ca818e79239bb42a8c18cdecd26cb6ac7496672073c3cca652e9f814227139a816676d721e5cbf8fb68fbb77da49138a5ce8426cbffce0
data/Readme.md CHANGED
@@ -195,6 +195,7 @@ Options are:
195
195
 
196
196
  -n [PROCESSES] How many processes to use, default: available CPUs
197
197
  -p, --pattern [PATTERN] run tests matching this regex pattern
198
+ --exclude-pattern [PATTERN] exclude tests matching this regex pattern
198
199
  --group-by [TYPE] group tests by:
199
200
  found - order of finding files
200
201
  steps - number of cucumber/spinach steps
@@ -373,6 +374,7 @@ inspired by [pivotal labs](https://blog.pivotal.io/labs/labs/parallelize-your-rs
373
374
  - [David Rodríguez](https://github.com/deivid-rodriguez)
374
375
  - [Justin Doody](https://github.com/justindoody)
375
376
  - [Sandeep Singh](https://github.com/sandeepnagra)
377
+ - [Calaway](https://github.com/calaway)
376
378
 
377
379
  [Michael Grosser](http://grosser.it)<br/>
378
380
  michael@grosser.it<br/>
@@ -164,6 +164,7 @@ module ParallelTests
164
164
  BANNER
165
165
  opts.on("-n [PROCESSES]", Integer, "How many processes to use, default: available CPUs") { |n| options[:count] = n }
166
166
  opts.on("-p", "--pattern [PATTERN]", "run tests matching this regex pattern") { |pattern| options[:pattern] = /#{pattern}/ }
167
+ opts.on("--exclude-pattern", "--exclude-pattern [PATTERN]", "exclude tests matching this regex pattern") { |pattern| options[:exclude_pattern] = /#{pattern}/ }
167
168
  opts.on("--group-by [TYPE]", <<-TEXT.gsub(/^ /, '')
168
169
  group tests by:
169
170
  found - order of finding files
@@ -209,14 +209,20 @@ module ParallelTests
209
209
  end
210
210
 
211
211
  def find_tests(tests, options = {})
212
- (tests || []).map do |file_or_folder|
212
+ suffix_pattern = options[:suffix] || test_suffix
213
+ include_pattern = options[:pattern] || //
214
+ exclude_pattern = options[:exclude_pattern]
215
+
216
+ (tests || []).flat_map do |file_or_folder|
213
217
  if File.directory?(file_or_folder)
214
218
  files = files_in_folder(file_or_folder, options)
215
- files.grep(options[:suffix]||test_suffix).grep(options[:pattern]||//)
219
+ files = files.grep(suffix_pattern).grep(include_pattern)
220
+ files -= files.grep(exclude_pattern) if exclude_pattern
221
+ files
216
222
  else
217
223
  file_or_folder
218
224
  end
219
- end.flatten.uniq
225
+ end.uniq
220
226
  end
221
227
 
222
228
  def files_in_folder(folder, options={})
@@ -1,3 +1,3 @@
1
1
  module ParallelTests
2
- VERSION = Version = '2.27.1'
2
+ VERSION = Version = '2.28.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.27.1
4
+ version: 2.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-01 00:00:00.000000000 Z
11
+ date: 2019-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel