kitchen-pester 0.9.1 → 0.10.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 +4 -4
- data/Gemfile +3 -3
- data/kitchen-pester.gemspec +2 -2
- data/lib/kitchen/verifier/pester.rb +40 -8
- data/lib/kitchen/verifier/pester_version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '059571878e2fa384cd5938bde47baa245fae436e03122122ecd86cfd4c624f2b'
|
|
4
|
+
data.tar.gz: 39caed26086298d573bee7cbee9b8d0196ecd5cccdaf9cec61402c465294b118
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '09ba88c3476bf660f88f72cd219e2f9ac0faec1a76338ac228ad32535f8cd5eddd5a9db197347f9f046ad82e56e7e8718c4db9c27cb44e83242f8e9a603b9617'
|
|
7
|
+
data.tar.gz: d04e63a8238454275bb00f7b4fbe5c1e8ea78334825306742f9b3a8e8d6ac6d92354a90b6a9093e7da5d4f79d0ae00e79eedec1a53be11012ca8bf32c4f7a9e9
|
data/Gemfile
CHANGED
|
@@ -6,12 +6,12 @@ gemspec
|
|
|
6
6
|
group :integration do
|
|
7
7
|
gem "berkshelf"
|
|
8
8
|
gem "kitchen-inspec"
|
|
9
|
-
gem "kitchen-
|
|
10
|
-
gem "kitchen-
|
|
9
|
+
gem "kitchen-azurerm"
|
|
10
|
+
gem "kitchen-chocolatey"
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
group :changelog do
|
|
14
|
-
gem "github_changelog_generator", "1.
|
|
14
|
+
gem "github_changelog_generator", "1.15.0"
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
group :debug do
|
data/kitchen-pester.gemspec
CHANGED
|
@@ -14,12 +14,12 @@ Gem::Specification.new do |spec|
|
|
|
14
14
|
spec.homepage = "https://github.com/test-kitchen/kitchen-pester"
|
|
15
15
|
spec.license = "Apache-2.0"
|
|
16
16
|
|
|
17
|
-
spec.files = %w
|
|
17
|
+
spec.files = %w{LICENSE kitchen-pester.gemspec Gemfile Rakefile} + Dir.glob("lib/**/*")
|
|
18
18
|
spec.require_paths = ["lib"]
|
|
19
19
|
|
|
20
20
|
spec.add_development_dependency "bundler"
|
|
21
21
|
spec.add_development_dependency "rake"
|
|
22
|
-
spec.add_development_dependency "minitest", "~> 5.3", "< 5.
|
|
22
|
+
spec.add_development_dependency "minitest", "~> 5.3", "< 5.15"
|
|
23
23
|
spec.add_development_dependency "mocha", "~> 1.1"
|
|
24
24
|
|
|
25
25
|
spec.add_dependency "test-kitchen", ">= 1.10", "< 3"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
require "pathname"
|
|
20
20
|
require "kitchen/verifier/base"
|
|
21
|
-
|
|
21
|
+
require_relative "pester_version"
|
|
22
22
|
|
|
23
23
|
module Kitchen
|
|
24
24
|
|
|
@@ -33,6 +33,7 @@ module Kitchen
|
|
|
33
33
|
default_config :restart_winrm, false
|
|
34
34
|
default_config :test_folder
|
|
35
35
|
default_config :use_local_pester_module, false
|
|
36
|
+
default_config :downloads, ["./PesterTestResults.xml"] => "./testresults"
|
|
36
37
|
|
|
37
38
|
# Creates a new Verifier object using the provided configuration data
|
|
38
39
|
# which will be merged with any default configuration.
|
|
@@ -108,15 +109,26 @@ module Kitchen
|
|
|
108
109
|
really_wrap_shell_code(run_command_script)
|
|
109
110
|
end
|
|
110
111
|
|
|
112
|
+
# Download functionality was added to the base verifier behavior after
|
|
113
|
+
# version 2.3.4
|
|
114
|
+
if Gem::Version.new(Kitchen::VERSION) <= Gem::Version.new("2.3.4")
|
|
115
|
+
def call(state)
|
|
116
|
+
super
|
|
117
|
+
|
|
118
|
+
download_test_files(state)
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
111
122
|
# private
|
|
112
123
|
def run_command_script
|
|
113
124
|
<<-CMD
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
$
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
$
|
|
125
|
+
Import-Module Pester -Force
|
|
126
|
+
$TestPath = "#{config[:root_path]}"
|
|
127
|
+
$OutputFilePath = $TestPath | Join-Path -ChildPath 'PesterTestResults.xml'
|
|
128
|
+
|
|
129
|
+
$result = Invoke-Pester -OutputFile $OutputFilePath -OutputFormat NUnitXml -Path $TestPath -Passthru
|
|
130
|
+
$result | Export-CliXml -Path (Join-Path -Path $TestPath -ChildPath 'result.xml')
|
|
131
|
+
$host.SetShouldExit($result.FailedCount)
|
|
120
132
|
CMD
|
|
121
133
|
end
|
|
122
134
|
|
|
@@ -128,7 +140,7 @@ module Kitchen
|
|
|
128
140
|
<<-EOH
|
|
129
141
|
set-executionpolicy unrestricted -force;
|
|
130
142
|
$global:ProgressPreference = 'SilentlyContinue'
|
|
131
|
-
$env:psmodulepath += ";$(join-path (resolve-path $env:temp).path 'verifier/modules')"
|
|
143
|
+
$env:psmodulepath += ";$(join-path (resolve-path $env:temp).path 'verifier/modules')"
|
|
132
144
|
#{script}
|
|
133
145
|
EOH
|
|
134
146
|
end
|
|
@@ -230,6 +242,26 @@ module Kitchen
|
|
|
230
242
|
))
|
|
231
243
|
end
|
|
232
244
|
|
|
245
|
+
def download_test_files(state)
|
|
246
|
+
info("Downloading test result files from #{instance.to_str}")
|
|
247
|
+
|
|
248
|
+
instance.transport.connection(state) do |conn|
|
|
249
|
+
config[:downloads].to_h.each do |remotes, local|
|
|
250
|
+
debug("Downloading #{Array(remotes).join(", ")} to #{local}")
|
|
251
|
+
|
|
252
|
+
remotes.each do |file|
|
|
253
|
+
safe_name = instance.name.gsub(/[^0-9A-Z-]/i, "_")
|
|
254
|
+
local_path = File.join(local, safe_name, file)
|
|
255
|
+
remote_path = File.join(config[:root_path], file)
|
|
256
|
+
|
|
257
|
+
conn.download(remote_path, local_path)
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
debug("Finished downloading test result files from #{instance.to_str}")
|
|
263
|
+
end
|
|
264
|
+
|
|
233
265
|
# Returns an Array of test suite filenames for the related suite currently
|
|
234
266
|
# residing on the local workstation. Any special provisioner-specific
|
|
235
267
|
# directories (such as a Chef roles/ directory) are excluded.
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kitchen-pester
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.10.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Steven Murawski
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-01-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -47,7 +47,7 @@ dependencies:
|
|
|
47
47
|
version: '5.3'
|
|
48
48
|
- - "<"
|
|
49
49
|
- !ruby/object:Gem::Version
|
|
50
|
-
version: '5.
|
|
50
|
+
version: '5.15'
|
|
51
51
|
type: :development
|
|
52
52
|
prerelease: false
|
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -57,7 +57,7 @@ dependencies:
|
|
|
57
57
|
version: '5.3'
|
|
58
58
|
- - "<"
|
|
59
59
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: '5.
|
|
60
|
+
version: '5.15'
|
|
61
61
|
- !ruby/object:Gem::Dependency
|
|
62
62
|
name: mocha
|
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|