rspec-puppet 2.7.2 → 2.7.3

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
- SHA256:
3
- metadata.gz: 176a810cdf4b4c2640ac1d8d8ec5085ef192d8c99b921a0a7b8612f9a067a35e
4
- data.tar.gz: c4397dd3a4636280346e7ca4d5a251d8de496f004b47d9b3cd233e96314399c0
2
+ SHA1:
3
+ metadata.gz: 19d42e088ccfb87af21e6880cb8792bddaa61728
4
+ data.tar.gz: a408822bbfade1dd6925f3943f4e6f0fd85cd38b
5
5
  SHA512:
6
- metadata.gz: 23ed9a0f35e5193952868083155e0519620d0e09e2deee04e5c272ef695935c398637bec4102ef04f224f47cbd8ba884de3248f4e78fb389f3294eeb1071f370
7
- data.tar.gz: 01ad7d0d738923721f0ba267b58d31b5d8ccc6fb32cc2590f085a24a562302af62ec049a4d3e15f33dfdd604f9233b5902423a8afd2d29afe1ca5cf5f6a39c60
6
+ metadata.gz: 5c46f7fb21a4b7032900a23a8dac1c7dbc47b3a2c6cab6b38c9929bfacc095f1e86d9007c11e17946467004acb5dc54856cfe2d1bedd33babd17b199a6524cf6
7
+ data.tar.gz: babc61b15e854817b85d1355704ba45adb37c4e371f4262154c73146f7349aa635dd9b20c21db6879ae94e5959e122e71aeb4391fbca5571267467aa48e5f198
data/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
  All notable changes to this project will be documented in this file. This
3
3
  project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## [2.7.3]
6
+
7
+ ### Fixed
8
+ * Puppet 6 deferred functions are now evaluated and resolved as part of the
9
+ catalogue compilation process.
10
+ * If running with parallel\_tests, the resources that are filtered out of the
11
+ resource coverage report are now taken into account when merging the final
12
+ report, fixing false negative results that can occur.
13
+
5
14
  ## [2.7.2]
6
15
 
7
16
  ### Changed
@@ -199,6 +199,12 @@ module RSpec::Puppet
199
199
  [:vendormoduledir, :vendormoduledir],
200
200
  ])
201
201
  end
202
+
203
+ def catalog(node, _exported)
204
+ super.tap do |c|
205
+ Puppet::Pops::Evaluator::DeferredResolver.resolve_and_replace(node.facts, c)
206
+ end
207
+ end
202
208
  end
203
209
 
204
210
  class Adapter30 < Base
@@ -39,6 +39,9 @@ module RSpec::Puppet
39
39
 
40
40
  def save_results
41
41
  slug = "#{Digest::MD5.hexdigest(Dir.pwd)}-#{Process.pid}"
42
+ File.open(File.join(Dir.tmpdir, "rspec-puppet-filter-#{slug}"), 'w+') do |f|
43
+ f.puts @filters.to_json
44
+ end
42
45
  File.open(File.join(Dir.tmpdir, "rspec-puppet-coverage-#{slug}"), 'w+') do |f|
43
46
  f.puts @collection.to_json
44
47
  end
@@ -52,6 +55,14 @@ module RSpec::Puppet
52
55
  end
53
56
  end
54
57
 
58
+ def merge_filters
59
+ pattern = File.join(Dir.tmpdir, "rspec-puppet-filter-#{Digest::MD5.hexdigest(Dir.pwd)}-*")
60
+ Dir[pattern].each do |result_file|
61
+ load_filters(result_file)
62
+ FileUtils.rm(result_file)
63
+ end
64
+ end
65
+
55
66
  def load_results(path)
56
67
  saved_results = JSON.parse(File.read(path))
57
68
  saved_results.each do |resource, data|
@@ -60,6 +71,14 @@ module RSpec::Puppet
60
71
  end
61
72
  end
62
73
 
74
+ def load_filters(path)
75
+ saved_filters = JSON.parse(File.read(path))
76
+ saved_filters.each do |resource|
77
+ @filters << resource
78
+ @collection.delete(resource) if @collection.key?(resource)
79
+ end
80
+ end
81
+
63
82
  def add(resource)
64
83
  if !exists?(resource) && !filtered?(resource)
65
84
  @collection[resource.to_s] = ResourceWrapper.new(resource)
@@ -117,7 +136,10 @@ module RSpec::Puppet
117
136
  end
118
137
 
119
138
  def run_report(coverage_desired = nil)
120
- merge_results if ENV['TEST_ENV_NUMBER']
139
+ if ENV['TEST_ENV_NUMBER']
140
+ merge_filters
141
+ merge_results
142
+ end
121
143
 
122
144
  report = results
123
145
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.2
4
+ version: 2.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Sharpe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-20 00:00:00.000000000 Z
11
+ date: 2019-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  requirements: []
91
91
  rubyforge_project:
92
- rubygems_version: 2.7.7
92
+ rubygems_version: 2.6.14.1
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: RSpec tests for your Puppet manifests