kitchen-pester 1.0.0 → 1.2.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 +1 -1
- data/Rakefile +1 -1
- data/kitchen-pester.gemspec +3 -4
- data/lib/kitchen/verifier/pester.rb +197 -45
- data/lib/kitchen/verifier/pester_version.rb +1 -1
- data/lib/support/modules/PesterUtil/PesterUtil.psm1 +2 -1
- metadata +7 -21
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 19d804e92d719bc9b7a474f32fb09562e5ca26e56a7d22f2ce432a5b704fd59f
|
|
4
|
+
data.tar.gz: 85891cc61ec3764ba9d9397958f8610f3a3e9238d53c6b6f9fdc26814ada51b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7da614b278d3fc0f408dc0d913ba9c853bf3997ef669aba45578bb23d65c725bcefcaffb75b8d799f579fca233ae7f84134983cb6147b7bcd91c51041c0dbb2b
|
|
7
|
+
data.tar.gz: 56af02995deb34e6a6044396096ada3b4fbe371b9d8c2be1a74dbf8109728808110d28e9a9e620951530bc48e5b2ac3bbf49ba07046630f393c67c8d2b83a766
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
|
@@ -23,7 +23,7 @@ desc "Run all quality tasks"
|
|
|
23
23
|
task quality: :style
|
|
24
24
|
|
|
25
25
|
begin
|
|
26
|
-
require "yard"
|
|
26
|
+
require "yard" unless defined?(YARD)
|
|
27
27
|
YARD::Rake::YardocTask.new
|
|
28
28
|
rescue LoadError
|
|
29
29
|
puts "yard is not available. (sudo) gem install yard to generate yard documentation."
|
data/kitchen-pester.gemspec
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
lib = File.expand_path("
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
|
4
4
|
require "kitchen/verifier/pester_version"
|
|
@@ -16,10 +16,9 @@ Gem::Specification.new do |spec|
|
|
|
16
16
|
spec.files = %w{LICENSE kitchen-pester.gemspec Gemfile Rakefile} + Dir.glob("lib/**/*")
|
|
17
17
|
spec.require_paths = ["lib"]
|
|
18
18
|
|
|
19
|
-
spec.add_development_dependency "bundler"
|
|
20
19
|
spec.add_development_dependency "rake"
|
|
21
|
-
spec.add_development_dependency "minitest", "~> 5.3", "< 5.
|
|
20
|
+
spec.add_development_dependency "minitest", "~> 5.3", "< 5.16"
|
|
22
21
|
spec.add_development_dependency "mocha", "~> 1.1"
|
|
23
22
|
|
|
24
|
-
spec.add_dependency "test-kitchen", ">= 1.10", "<
|
|
23
|
+
spec.add_dependency "test-kitchen", ">= 1.10", "< 4"
|
|
25
24
|
end
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
# See the License for the specific language governing permissions and
|
|
15
15
|
# limitations under the License.
|
|
16
16
|
|
|
17
|
-
require "fileutils"
|
|
18
|
-
require "pathname"
|
|
17
|
+
require "fileutils" unless defined?(FileUtils)
|
|
18
|
+
require "pathname" unless defined?(Pathname)
|
|
19
19
|
require "kitchen/util"
|
|
20
20
|
require "kitchen/verifier/base"
|
|
21
21
|
require "kitchen/version"
|
|
22
|
-
require "base64"
|
|
22
|
+
require "base64" unless defined?(Base64)
|
|
23
23
|
require_relative "pester_version"
|
|
24
24
|
|
|
25
25
|
module Kitchen
|
|
@@ -47,10 +47,26 @@ module Kitchen
|
|
|
47
47
|
Force: true,
|
|
48
48
|
ErrorAction: "Stop",
|
|
49
49
|
}
|
|
50
|
+
default_config :pester_configuration, {
|
|
51
|
+
run: {
|
|
52
|
+
path: ".",
|
|
53
|
+
PassThru: true,
|
|
54
|
+
},
|
|
55
|
+
TestResult: {
|
|
56
|
+
Enabled: true,
|
|
57
|
+
OutputPath: "PesterTestResults.xml",
|
|
58
|
+
TestSuiteName: "",
|
|
59
|
+
},
|
|
60
|
+
Output: {
|
|
61
|
+
Verbosity: "Detailed",
|
|
62
|
+
},
|
|
63
|
+
}
|
|
50
64
|
default_config :install_modules, []
|
|
51
|
-
default_config :downloads,
|
|
65
|
+
default_config :downloads, { "./PesterTestResults.xml" => "./testresults/" }
|
|
52
66
|
default_config :copy_folders, []
|
|
53
67
|
default_config :sudo, false
|
|
68
|
+
default_config :shell, nil
|
|
69
|
+
default_config :environment, {}
|
|
54
70
|
|
|
55
71
|
# Creates a new Verifier object using the provided configuration data
|
|
56
72
|
# which will be merged with any default configuration.
|
|
@@ -58,6 +74,7 @@ module Kitchen
|
|
|
58
74
|
# @param config [Hash] provided verifier configuration
|
|
59
75
|
def initialize(config = {})
|
|
60
76
|
init_config(config)
|
|
77
|
+
raise ClientError.new "Environment Variables must be specified as a hash, not a #{config[:environment].class}" unless config[:environment].is_a?(Hash)
|
|
61
78
|
end
|
|
62
79
|
|
|
63
80
|
# Creates a temporary directory on the local workstation into which
|
|
@@ -115,7 +132,7 @@ module Kitchen
|
|
|
115
132
|
)
|
|
116
133
|
|
|
117
134
|
if ($modulesToRemove.ModuleBase.Count -eq 0) {
|
|
118
|
-
# for PS7 on linux
|
|
135
|
+
# for PS7 on linux
|
|
119
136
|
return
|
|
120
137
|
}
|
|
121
138
|
|
|
@@ -150,6 +167,7 @@ module Kitchen
|
|
|
150
167
|
# @return [String] a command string
|
|
151
168
|
def prepare_command
|
|
152
169
|
info("Preparing the SUT and Pester dependencies...")
|
|
170
|
+
resolve_downloads_paths!
|
|
153
171
|
really_wrap_shell_code(install_command_script)
|
|
154
172
|
end
|
|
155
173
|
|
|
@@ -159,7 +177,39 @@ module Kitchen
|
|
|
159
177
|
#
|
|
160
178
|
# @return [String] a command string
|
|
161
179
|
def run_command
|
|
162
|
-
really_wrap_shell_code(
|
|
180
|
+
really_wrap_shell_code(invoke_pester_scriptblock)
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Resolves the remote Downloads path from the verifier root path,
|
|
184
|
+
# unless they're absolute path (starts with / or C:\)
|
|
185
|
+
# This updates the config[:downloads], nothing (nil) is returned.
|
|
186
|
+
#
|
|
187
|
+
# @return [nil] updates config downloads
|
|
188
|
+
def resolve_downloads_paths!
|
|
189
|
+
info("Resolving Downloads path from config.")
|
|
190
|
+
config[:downloads] = config[:downloads]
|
|
191
|
+
.map do |source, destination|
|
|
192
|
+
source = source.to_s
|
|
193
|
+
destination = destination.gsub("%{instance_name}", instance.name)
|
|
194
|
+
info(" resolving remote source's absolute path.")
|
|
195
|
+
unless source.match?('^/|^[a-zA-Z]:[\\/]') # is Absolute?
|
|
196
|
+
info(" '#{source}' is a relative path, resolving to: #{File.join(config[:root_path], source)}")
|
|
197
|
+
source = File.join(config[:root_path], source.to_s).to_s
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if destination.match?('\\$|/$') # is Folder (ends with / or \)
|
|
201
|
+
destination = File.join(destination, File.basename(source)).to_s
|
|
202
|
+
end
|
|
203
|
+
info(" Destination: #{destination}")
|
|
204
|
+
if !File.directory?(File.dirname(destination))
|
|
205
|
+
FileUtils.mkdir_p(File.dirname(destination))
|
|
206
|
+
else
|
|
207
|
+
info(" Directory #{File.dirname(destination)} seems to exist.")
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
[ source, destination ]
|
|
211
|
+
end
|
|
212
|
+
nil # make sure we do not return anything
|
|
163
213
|
end
|
|
164
214
|
|
|
165
215
|
# Download functionality was added to the base verifier behavior after
|
|
@@ -168,7 +218,9 @@ module Kitchen
|
|
|
168
218
|
def call(state)
|
|
169
219
|
super
|
|
170
220
|
ensure
|
|
171
|
-
|
|
221
|
+
info("Ensure download test files.")
|
|
222
|
+
download_test_files(state) unless config[:downloads].nil?
|
|
223
|
+
info("Download complete.")
|
|
172
224
|
end
|
|
173
225
|
else
|
|
174
226
|
def call(state)
|
|
@@ -176,25 +228,88 @@ module Kitchen
|
|
|
176
228
|
rescue
|
|
177
229
|
# If the verifier reports failure, we need to download the files ourselves.
|
|
178
230
|
# Test Kitchen's base verifier doesn't have the download in an `ensure` block.
|
|
179
|
-
|
|
180
|
-
|
|
231
|
+
info("Rescue to download test files.")
|
|
232
|
+
download_test_files(state) unless config[:downloads].nil?
|
|
181
233
|
# Rethrow original exception, we still want to register the failure.
|
|
182
234
|
raise
|
|
183
235
|
end
|
|
184
236
|
end
|
|
185
237
|
|
|
186
238
|
# private
|
|
187
|
-
def
|
|
239
|
+
def invoke_pester_scriptblock
|
|
188
240
|
<<-PS1
|
|
189
|
-
Import-Module -Name Pester -Force -ErrorAction Stop
|
|
241
|
+
$PesterModule = Import-Module -Name Pester -Force -ErrorAction Stop -PassThru
|
|
190
242
|
|
|
191
243
|
$TestPath = Join-Path "#{config[:root_path]}" -ChildPath "suites"
|
|
192
244
|
$OutputFilePath = Join-Path "#{config[:root_path]}" -ChildPath 'PesterTestResults.xml'
|
|
193
245
|
|
|
194
|
-
|
|
246
|
+
#{ps_environment(config[:environment])}
|
|
247
|
+
if ($PesterModule.Version.Major -le 4)
|
|
248
|
+
{
|
|
249
|
+
Write-Host -Object "Invoke Pester with v$($PesterModule.Version) Options"
|
|
250
|
+
$options = New-PesterOption -TestSuiteName "Pester - #{instance.to_str}"
|
|
251
|
+
$defaultPesterParameters = @{
|
|
252
|
+
Script = $TestPath
|
|
253
|
+
OutputFile = $OutputFilePath
|
|
254
|
+
OutputFormat = 'NUnitXml'
|
|
255
|
+
PassThru = $true
|
|
256
|
+
PesterOption = $options
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
$pesterCmd = Get-Command -Name 'Invoke-Pester'
|
|
260
|
+
$pesterConfig = #{ps_hash(config[:pester_configuration])}
|
|
261
|
+
$invokePesterParams = @{}
|
|
262
|
+
|
|
263
|
+
foreach ($paramName in $pesterCmd.Parameters.Keys)
|
|
264
|
+
{
|
|
265
|
+
$paramValue = $pesterConfig.($paramName)
|
|
266
|
+
|
|
267
|
+
if ($paramValue) {
|
|
268
|
+
Write-Host -Object "Using $paramName from Yaml config."
|
|
269
|
+
$invokePesterParams[$paramName] = $paramValue
|
|
270
|
+
}
|
|
271
|
+
elseif ($defaultPesterParameters.ContainsKey($paramName))
|
|
272
|
+
{
|
|
273
|
+
Write-Host -Object "Using $paramName from Defaults: $($defaultPesterParameters[$paramName])."
|
|
274
|
+
$invokePesterParams[$paramName] = $defaultPesterParameters[$paramName]
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
$result = Invoke-Pester @invokePesterParams
|
|
279
|
+
}
|
|
280
|
+
else
|
|
281
|
+
{
|
|
282
|
+
Write-Host -Object "Invoke Pester with v$($PesterModule.Version) Configuration."
|
|
283
|
+
$pesterConfigHash = #{ps_hash(config[:pester_configuration])}
|
|
284
|
+
|
|
285
|
+
if (-not $pesterConfigHash.ContainsKey('run')) {
|
|
286
|
+
$pesterConfigHash['run'] = @{}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (-not $pesterConfigHash.ContainsKey('TestResult')) {
|
|
290
|
+
$pesterConfigHash['TestResult'] = @{}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (-not $pesterConfigHash.run.path) {
|
|
294
|
+
$pesterConfigHash['run']['path'] = $TestPath
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (-not $pesterConfigHash.TestResult.TestSuiteName) {
|
|
298
|
+
$pesterConfigHash['TestResult']['TestSuiteName'] = 'Pester - #{instance.to_str}'
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (-not $pesterConfigHash.TestResult.OutputPath) {
|
|
302
|
+
$pesterConfigHash['TestResult']['OutputPath'] = $OutputFilePath
|
|
303
|
+
}
|
|
195
304
|
|
|
196
|
-
|
|
197
|
-
|
|
305
|
+
$PesterConfig = New-PesterConfiguration -Hashtable $pesterConfigHash
|
|
306
|
+
$result = Invoke-Pester -Configuration $PesterConfig
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
$resultXmlPath = (Join-Path -Path $TestPath -ChildPath 'result.xml')
|
|
310
|
+
if (Test-Path -Path $resultXmlPath) {
|
|
311
|
+
$result | Export-CliXml -Path
|
|
312
|
+
}
|
|
198
313
|
|
|
199
314
|
$LASTEXITCODE = $result.FailedCount
|
|
200
315
|
$host.SetShouldExit($LASTEXITCODE)
|
|
@@ -216,6 +331,7 @@ module Kitchen
|
|
|
216
331
|
if powershell_module.is_a? Hash
|
|
217
332
|
<<-PS1
|
|
218
333
|
${#{powershell_module[:Name]}} = #{ps_hash(powershell_module)}
|
|
334
|
+
|
|
219
335
|
Install-ModuleFromNuget -Module ${#{powershell_module[:Name]}} #{gallery_url_param}
|
|
220
336
|
PS1
|
|
221
337
|
else
|
|
@@ -231,7 +347,7 @@ module Kitchen
|
|
|
231
347
|
#
|
|
232
348
|
# @return [Array<String>] array of suite files
|
|
233
349
|
# @api private
|
|
234
|
-
def
|
|
350
|
+
def register_psrepository_scriptblock
|
|
235
351
|
return if config[:register_repository].nil?
|
|
236
352
|
|
|
237
353
|
info("Registering a new PowerShellGet Repository")
|
|
@@ -302,30 +418,60 @@ module Kitchen
|
|
|
302
418
|
windows_os? ? really_wrap_windows_shell_code(code) : really_wrap_posix_shell_code(code)
|
|
303
419
|
end
|
|
304
420
|
|
|
421
|
+
# Get the defined shell or fall back to pwsh, unless we're on windows where we use powershell
|
|
422
|
+
# call via sudo if sudo is true.
|
|
423
|
+
# This allows to use pwsh-preview instead of pwsh, or a full path to a specific binary.
|
|
424
|
+
def shell_cmd
|
|
425
|
+
if !config[:shell].nil?
|
|
426
|
+
config[:sudo] ? "sudo #{config[:shell]}" : "#{config[:shell]}"
|
|
427
|
+
elsif windows_os?
|
|
428
|
+
"powershell"
|
|
429
|
+
else
|
|
430
|
+
config[:sudo] ? "sudo pwsh" : "pwsh"
|
|
431
|
+
end
|
|
432
|
+
end
|
|
433
|
+
|
|
305
434
|
def really_wrap_windows_shell_code(code)
|
|
306
|
-
|
|
435
|
+
my_command = <<-PWSH
|
|
436
|
+
echo "Running as '$(whoami)'..."
|
|
437
|
+
New-Item -ItemType Directory -Path '#{config[:root_path]}/modules' -Force -ErrorAction SilentlyContinue
|
|
438
|
+
Set-Location -Path "#{config[:root_path]}"
|
|
439
|
+
# Send the pwsh here string to the file kitchen_cmd.ps1
|
|
440
|
+
@'
|
|
441
|
+
try {
|
|
442
|
+
if (@('Bypass', 'Unrestricted') -notcontains (Get-ExecutionPolicy)) {
|
|
443
|
+
Set-ExecutionPolicy Unrestricted -Force -Scope Process
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
catch {
|
|
447
|
+
$_ | Out-String | Write-Warning
|
|
448
|
+
}
|
|
449
|
+
#{Util.outdent!(use_local_powershell_modules(code))}
|
|
450
|
+
'@ | Set-Content -Path kitchen_cmd.ps1 -Encoding utf8 -Force -ErrorAction 'Stop'
|
|
451
|
+
# create the modules folder, making sure it's done as current user (not root)
|
|
452
|
+
#
|
|
453
|
+
# Invoke the created kitchen_cmd.ps1 file using pwsh
|
|
454
|
+
#{shell_cmd} ./kitchen_cmd.ps1
|
|
455
|
+
PWSH
|
|
456
|
+
wrap_shell_code(Util.outdent!(my_command))
|
|
307
457
|
end
|
|
308
458
|
|
|
309
459
|
# Writing the command to a ps1 file, adding the pwsh shebang
|
|
310
460
|
# invoke the file
|
|
311
461
|
def really_wrap_posix_shell_code(code)
|
|
312
|
-
if config[:sudo]
|
|
313
|
-
pwsh_cmd = "sudo pwsh"
|
|
314
|
-
else
|
|
315
|
-
pwsh_cmd = "pwsh"
|
|
316
|
-
end
|
|
317
|
-
|
|
318
462
|
my_command = <<-BASH
|
|
319
463
|
echo "Running as '$(whoami)'"
|
|
320
|
-
#
|
|
321
|
-
|
|
464
|
+
# create the modules folder, making sure it's done as current user (not root)
|
|
465
|
+
mkdir -p #{config[:root_path]}/modules
|
|
466
|
+
cd #{config[:root_path]}
|
|
467
|
+
# Send the bash heredoc 'EOF' to the file kitchen_cmd.ps1 using the tool cat
|
|
468
|
+
cat << 'EOF' > kitchen_cmd.ps1
|
|
322
469
|
#!/usr/bin/env pwsh
|
|
323
470
|
#{Util.outdent!(use_local_powershell_modules(code))}
|
|
324
471
|
EOF
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
#
|
|
328
|
-
#{pwsh_cmd} -f current.ps1
|
|
472
|
+
chmod +x kitchen_cmd.ps1
|
|
473
|
+
# Invoke the created kitchen_cmd.ps1 file using pwsh
|
|
474
|
+
#{shell_cmd} ./kitchen_cmd.ps1
|
|
329
475
|
BASH
|
|
330
476
|
|
|
331
477
|
debug(Util.outdent!(my_command))
|
|
@@ -334,23 +480,15 @@ module Kitchen
|
|
|
334
480
|
|
|
335
481
|
def use_local_powershell_modules(script)
|
|
336
482
|
<<-PS1
|
|
337
|
-
|
|
338
|
-
if (!$IsLinux -and !$IsMacOs) {
|
|
339
|
-
Set-ExecutionPolicy Unrestricted -force
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
catch {
|
|
343
|
-
$_ | Out-String | Write-Warning
|
|
344
|
-
}
|
|
345
|
-
|
|
483
|
+
Write-Host -Object ("{0} - PowerShell {1}" -f $PSVersionTable.OS,$PSVersionTable.PSVersion)
|
|
346
484
|
$global:ProgressPreference = 'SilentlyContinue'
|
|
347
485
|
$PSModPathToPrepend = Join-Path "#{config[:root_path]}" -ChildPath 'modules'
|
|
348
486
|
Write-Verbose "Adding '$PSModPathToPrepend' to `$Env:PSModulePath."
|
|
349
487
|
if (!$isLinux -and -not (Test-Path -Path $PSModPathToPrepend)) {
|
|
350
|
-
# if you create this folder now
|
|
488
|
+
# if you create this folder now in Linux, it may run as root (via sudo).
|
|
351
489
|
$null = New-Item -Path $PSModPathToPrepend -Force -ItemType Directory
|
|
352
490
|
}
|
|
353
|
-
|
|
491
|
+
|
|
354
492
|
if ($Env:PSModulePath.Split([io.path]::PathSeparator) -notcontains $PSModPathToPrepend) {
|
|
355
493
|
$env:PSModulePath = @($PSModPathToPrepend, $env:PSModulePath) -Join [io.path]::PathSeparator
|
|
356
494
|
}
|
|
@@ -367,7 +505,7 @@ module Kitchen
|
|
|
367
505
|
|
|
368
506
|
#{get_powershell_modules_from_nugetapi.join("\n") unless config.dig(:bootstrap, :modules).nil?}
|
|
369
507
|
|
|
370
|
-
#{
|
|
508
|
+
#{register_psrepository_scriptblock.join("\n") unless config[:register_repository].nil?}
|
|
371
509
|
|
|
372
510
|
#{install_pester}
|
|
373
511
|
|
|
@@ -389,12 +527,15 @@ module Kitchen
|
|
|
389
527
|
end
|
|
390
528
|
|
|
391
529
|
def download_test_files(state)
|
|
392
|
-
|
|
530
|
+
if config[:downloads].nil?
|
|
531
|
+
info("Skipped downloading test result file from #{instance.to_str}; 'downloads' hash is empty.")
|
|
532
|
+
return
|
|
533
|
+
end
|
|
393
534
|
|
|
394
535
|
info("Downloading test result files from #{instance.to_str}")
|
|
395
536
|
instance.transport.connection(state) do |conn|
|
|
396
|
-
config[:downloads].
|
|
397
|
-
debug("
|
|
537
|
+
config[:downloads].each do |remotes, local|
|
|
538
|
+
debug("downloading #{Array(remotes).join(", ")} to #{local}")
|
|
398
539
|
conn.download(remotes, local)
|
|
399
540
|
end
|
|
400
541
|
end
|
|
@@ -480,6 +621,17 @@ module Kitchen
|
|
|
480
621
|
end
|
|
481
622
|
end
|
|
482
623
|
|
|
624
|
+
# Creates environment variable assignments from a ruby map.
|
|
625
|
+
#
|
|
626
|
+
# @api private
|
|
627
|
+
def ps_environment(obj)
|
|
628
|
+
commands = obj.map do |k, v|
|
|
629
|
+
"$env:#{k} = '#{v}'"
|
|
630
|
+
end
|
|
631
|
+
|
|
632
|
+
commands.join("\n")
|
|
633
|
+
end
|
|
634
|
+
|
|
483
635
|
# returns the path of the modules subfolder
|
|
484
636
|
# in the sandbox, where PS Modules and folders will be copied to.
|
|
485
637
|
#
|
|
@@ -527,7 +679,7 @@ module Kitchen
|
|
|
527
679
|
end
|
|
528
680
|
|
|
529
681
|
def prepare_supporting_psmodules
|
|
530
|
-
|
|
682
|
+
info("Preparing to copy files from '#{support_psmodule_folder}' to the SUT.")
|
|
531
683
|
sandbox_module_path = File.join(sandbox_path, "modules")
|
|
532
684
|
copy_if_src_exists(support_psmodule_folder, sandbox_module_path)
|
|
533
685
|
end
|
|
@@ -542,7 +694,7 @@ module Kitchen
|
|
|
542
694
|
return
|
|
543
695
|
end
|
|
544
696
|
|
|
545
|
-
|
|
697
|
+
info("Moving #{src_to_validate} to #{destination}")
|
|
546
698
|
unless Dir.exist?(destination)
|
|
547
699
|
FileUtils.mkdir_p(destination)
|
|
548
700
|
debug("Folder '#{destination}' created.")
|
|
@@ -106,8 +106,9 @@ function Set-PSRepo {
|
|
|
106
106
|
[Parameter(Mandatory)]
|
|
107
107
|
$Repository
|
|
108
108
|
)
|
|
109
|
+
|
|
109
110
|
if (-not (Get-Command Get-PSRepository) -and (Get-Command Get-PackageSource)) {
|
|
110
|
-
# Old
|
|
111
|
+
# Old versions of PSGet do not have a *-PSrepository but have *-PackageSource instead.
|
|
111
112
|
if (Get-PackageSource -Name $Repository.Name) {
|
|
112
113
|
Set-PackageSource @Repository
|
|
113
114
|
}
|
metadata
CHANGED
|
@@ -1,29 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kitchen-pester
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.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: 2022-05-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: bundler
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - ">="
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - ">="
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0'
|
|
27
13
|
- !ruby/object:Gem::Dependency
|
|
28
14
|
name: rake
|
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -47,7 +33,7 @@ dependencies:
|
|
|
47
33
|
version: '5.3'
|
|
48
34
|
- - "<"
|
|
49
35
|
- !ruby/object:Gem::Version
|
|
50
|
-
version: '5.
|
|
36
|
+
version: '5.16'
|
|
51
37
|
type: :development
|
|
52
38
|
prerelease: false
|
|
53
39
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -57,7 +43,7 @@ dependencies:
|
|
|
57
43
|
version: '5.3'
|
|
58
44
|
- - "<"
|
|
59
45
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: '5.
|
|
46
|
+
version: '5.16'
|
|
61
47
|
- !ruby/object:Gem::Dependency
|
|
62
48
|
name: mocha
|
|
63
49
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -81,7 +67,7 @@ dependencies:
|
|
|
81
67
|
version: '1.10'
|
|
82
68
|
- - "<"
|
|
83
69
|
- !ruby/object:Gem::Version
|
|
84
|
-
version: '
|
|
70
|
+
version: '4'
|
|
85
71
|
type: :runtime
|
|
86
72
|
prerelease: false
|
|
87
73
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -91,7 +77,7 @@ dependencies:
|
|
|
91
77
|
version: '1.10'
|
|
92
78
|
- - "<"
|
|
93
79
|
- !ruby/object:Gem::Version
|
|
94
|
-
version: '
|
|
80
|
+
version: '4'
|
|
95
81
|
description: Skip all that Busser stuff and jump right into Pester.
|
|
96
82
|
email:
|
|
97
83
|
- steven.murawski@gmail.com
|
|
@@ -125,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
125
111
|
- !ruby/object:Gem::Version
|
|
126
112
|
version: '0'
|
|
127
113
|
requirements: []
|
|
128
|
-
rubygems_version: 3.0.
|
|
114
|
+
rubygems_version: 3.0.3.1
|
|
129
115
|
signing_key:
|
|
130
116
|
specification_version: 4
|
|
131
117
|
summary: Test-Kitchen verifier for Pester.
|