puppetlabs_spec_helper 2.4.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e45684c9216162f69c0dd3afd5d8dff52c4cd5b7
4
- data.tar.gz: 2f37f0da9a4cac0d58df5612dc966a1f6a112c2d
3
+ metadata.gz: 2af2de3c35e1218a908641c49faafa015ef5a31d
4
+ data.tar.gz: 66433a97c6001f9d162256c20b747d7d16f122b1
5
5
  SHA512:
6
- metadata.gz: de629171b63520b5245ac177521fe9f7cd37298d30957a1c9740916f74f572f8c18e15724471ea5bd63d6b4117dc31d059b9118ca00d7551dc98b1203410a49b
7
- data.tar.gz: 34db93d7c4df67c8011672c04e76290f68aa20d1fd1eff673f83a8215fb66da534b345d95ecc3d4c6fdf352f669e4c491b8def5a1b14dbc21bd5d7526537d3e6
6
+ metadata.gz: d7b08134e2037452e20e37e4a8d805b0194d9b1204e9eec1a6463c2f00091578043f66f7de1d001c01ba203e32e23639d1e0cd1b9e354109f426e6556e07f74b
7
+ data.tar.gz: f15b5756ad0aef32714b9c52d46a7ca4fb4b42642880655c8c7713595368744b949b587d7aacbaedfb8beee7ec7ef32b5eecc04850033d63983f91d540235aad
@@ -2,6 +2,16 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## [2.5.0]
6
+ ### Summary
7
+ Adds a feature to pass test file targets from 'rake spec' to 'rspec', also fixes a parsing issue with test\_tiers.
8
+
9
+ ### Added
10
+ - Allows passing test file targets through to 'rspec' from 'rake spec'.
11
+
12
+ ### Fixed
13
+ - Trim whitespace from test\_tiers before parsing.
14
+
5
15
  ## [2.4.0]
6
16
  ### Summary
7
17
  Fix mercurial stuff, allow fixtures other than spec/fixtures/modules/, and allow running specific tags for beaker tests.
@@ -398,7 +408,8 @@ compatible yet.
398
408
  ### Added
399
409
  * Initial release
400
410
 
401
- [unreleased]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.4.0...master
411
+ [unreleased]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.5.0...master
412
+ [2.5.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.4.0...v2.5.0
402
413
  [2.4.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.3.2...v2.4.0
403
414
  [2.3.2]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.3.1...v2.3.2
404
415
  [2.3.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.3.0...v2.3.1
@@ -25,23 +25,26 @@ task :default => [:help]
25
25
 
26
26
  pattern = 'spec/{aliases,classes,defines,unit,functions,hosts,integration,type_aliases,types}/**/*_spec.rb'
27
27
 
28
-
29
- desc "Run spec tests on an existing fixtures directory"
30
- RSpec::Core::RakeTask.new(:spec_standalone) do |t|
28
+ RSpec::Core::RakeTask.new(:spec_standalone) do |t, args|
31
29
  t.rspec_opts = ['--color']
32
-
33
30
  t.rspec_opts << ENV['CI_SPEC_OPTIONS'] unless ENV['CI_SPEC_OPTIONS'].nil?
34
-
35
31
  if ENV['CI_NODE_TOTAL'] && ENV['CI_NODE_INDEX']
36
32
  ci_total = ENV['CI_NODE_TOTAL'].to_i
37
33
  ci_index = ENV['CI_NODE_INDEX'].to_i
38
34
  raise "CI_NODE_INDEX must be between 1-#{ci_total}" unless ci_index >= 1 && ci_index <= ci_total
39
-
40
35
  files = Rake::FileList[pattern].to_a
41
36
  per_node = (files.size / ci_total.to_f).ceil
42
- t.pattern = files.each_slice(per_node).to_a[ci_index - 1] || files.first
37
+ t.pattern = if args.extras.nil? || args.extras.empty?
38
+ files.each_slice(per_node).to_a[ci_index - 1] || files.first
39
+ else
40
+ args.extras.join(",")
41
+ end
43
42
  else
44
- t.pattern = pattern
43
+ if args.extras.nil? || args.extras.empty?
44
+ t.pattern = pattern
45
+ else
46
+ t.pattern = args.extras.join(",")
47
+ end
45
48
  end
46
49
  end
47
50
 
@@ -61,8 +64,9 @@ RSpec::Core::RakeTask.new(:beaker) do |t|
61
64
  test_tiers = ENV['TEST_TIERS'].split(',')
62
65
  raise 'TEST_TIERS env variable must have at least 1 tier specified. low, medium or high (comma separated).' if test_tiers.count == 0
63
66
  test_tiers.each do |tier|
64
- raise "#{tier} not a valid test tier." unless %w(low medium high).include?(tier)
65
- tiers += "tier_#{tier},"
67
+ tier_to_add = tier.strip
68
+ raise "#{tier_to_add} not a valid test tier." unless %w(low medium high).include?(tier_to_add)
69
+ tiers += "tier_#{tier_to_add},"
66
70
  end
67
71
  tiers = tiers.chomp(',')
68
72
  t.rspec_opts.push(tiers)
@@ -400,10 +404,10 @@ task :spec_clean do
400
404
  end
401
405
 
402
406
  desc "Run spec tests and clean the fixtures directory if successful"
403
- task :spec do
407
+ task :spec do |t, args|
404
408
  begin
405
409
  Rake::Task[:spec_prep].invoke
406
- Rake::Task[:spec_standalone].invoke
410
+ Rake::Task[:spec_standalone].invoke(*args.extras)
407
411
  ensure
408
412
  Rake::Task[:spec_clean].invoke
409
413
  end
@@ -1,5 +1,5 @@
1
1
  module PuppetlabsSpecHelper
2
- VERSION = "2.4.0"
2
+ VERSION = "2.5.0"
3
3
 
4
4
  # compat for pre-1.2.0 users; deprecated
5
5
  module Version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppetlabs_spec_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet, Inc.
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-10-17 00:00:00.000000000 Z
12
+ date: 2017-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mocha