kitchen-pester 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +4 -4
- data/LICENSE +22 -22
- data/README.md +36 -31
- data/lib/kitchen/verifier/pester.rb +43 -14
- data/lib/kitchen/verifier/pester_version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dbf63f215a50c4c8967508ec8d056dece21fc1c
|
4
|
+
data.tar.gz: 2bb6d1f3dc6f9ce753c26e2100b6d071bc741ee8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c3904c11133c0decd0628d4a30f8852f48515338637ea189d917fd224285a62b7f4fc625a3f49d5470008b60fa125c8f01b13a66d02fdde1c21cbf5e8047649
|
7
|
+
data.tar.gz: d2912889a105b9c067cdd2a58977b7a967f385f4e3413383e3d5e0188bfea6ee863654895842ae45b8b7e9c90b399c63f55831c1e413e386f608882ef159aced
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pkg/*
|
data/Gemfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in kitchen-pester.gemspec
|
4
|
-
gemspec
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in kitchen-pester.gemspec
|
4
|
+
gemspec
|
data/LICENSE
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2015 Steven Murawski
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
22
|
-
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Steven Murawski
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
22
|
+
|
data/README.md
CHANGED
@@ -1,31 +1,36 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/kitchen-pester.svg)](http://badge.fury.io/rb/kitchen-pester)
|
2
|
-
# Kitchen::Pester
|
3
|
-
|
4
|
-
Execute [Pester](https://github.com/pester/Pester) tests right from Test-Kitchen, without having to transit the Busser layer.
|
5
|
-
|
6
|
-
## Usage
|
7
|
-
|
8
|
-
Either
|
9
|
-
```
|
10
|
-
gem install kitchen-pester
|
11
|
-
```
|
12
|
-
or include
|
13
|
-
```
|
14
|
-
gem 'kitchen-pester'
|
15
|
-
```
|
16
|
-
in your Gemfile.
|
17
|
-
|
18
|
-
In your .kitchen.yml include
|
19
|
-
```
|
20
|
-
verifier:
|
21
|
-
name: pester
|
22
|
-
```
|
23
|
-
This can be a top-level declaration, a per-node declaration, or a per-suite declaration.
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/kitchen-pester.svg)](http://badge.fury.io/rb/kitchen-pester)
|
2
|
+
# Kitchen::Pester
|
3
|
+
|
4
|
+
Execute [Pester](https://github.com/pester/Pester) tests right from Test-Kitchen, without having to transit the Busser layer.
|
5
|
+
|
6
|
+
## Usage
|
7
|
+
|
8
|
+
Either
|
9
|
+
```
|
10
|
+
gem install kitchen-pester
|
11
|
+
```
|
12
|
+
or include
|
13
|
+
```
|
14
|
+
gem 'kitchen-pester'
|
15
|
+
```
|
16
|
+
in your Gemfile.
|
17
|
+
|
18
|
+
In your .kitchen.yml include
|
19
|
+
```
|
20
|
+
verifier:
|
21
|
+
name: pester
|
22
|
+
```
|
23
|
+
This can be a top-level declaration, a per-node declaration, or a per-suite declaration.
|
24
|
+
|
25
|
+
### Options
|
26
|
+
|
27
|
+
* `restart_winrm` - boolean, default is false. This is primarily to support powershell v2 scenarios. If Pester is not being found, enable this option.
|
28
|
+
* `test_folder` - string, default is nil. `test-folder` allows you to specify a custom path (the default is ./test/integration/) for your integration tests. This can be an absolute path or relative to the root of the folder kitchen is running from. This path must exist.
|
29
|
+
|
30
|
+
## Contributing
|
31
|
+
|
32
|
+
1. Fork it ( https://github.com/[my-github-username]/kitchen-pester/fork )
|
33
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
34
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
35
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
36
|
+
5. Create a new Pull Request
|
@@ -16,7 +16,8 @@
|
|
16
16
|
# See the License for the specific language governing permissions and
|
17
17
|
# limitations under the License.
|
18
18
|
|
19
|
-
require
|
19
|
+
require 'pathname'
|
20
|
+
require 'kitchen/verifier/base'
|
20
21
|
require 'kitchen/verifier/pester_version'
|
21
22
|
|
22
23
|
module Kitchen
|
@@ -30,6 +31,7 @@ module Kitchen
|
|
30
31
|
plugin_version Kitchen::Verifier::PESTER_VERSION
|
31
32
|
|
32
33
|
default_config :restart_winrm, false
|
34
|
+
default_config :test_folder
|
33
35
|
|
34
36
|
# Creates a new Verifier object using the provided configuration data
|
35
37
|
# which will be merged with any default configuration.
|
@@ -73,11 +75,17 @@ module Kitchen
|
|
73
75
|
cmd = <<-CMD
|
74
76
|
set-executionpolicy unrestricted -force
|
75
77
|
if (-not (get-module -list pester)) {
|
76
|
-
if (
|
77
|
-
|
78
|
+
if (get-module -list PowerShellGet){
|
79
|
+
import-module PowerShellGet -force
|
80
|
+
install-module Pester -force
|
81
|
+
}
|
82
|
+
else {
|
83
|
+
if (-not (get-module -list PsGet)){
|
84
|
+
iex (new-object Net.WebClient).DownloadString('http://bit.ly/GetPsGet')
|
85
|
+
}
|
86
|
+
import-module psget -force
|
87
|
+
Install-Module Pester
|
78
88
|
}
|
79
|
-
Import-Module PsGet
|
80
|
-
Install-Module Pester
|
81
89
|
}
|
82
90
|
CMD
|
83
91
|
wrap_shell_code(Util.outdent!(cmd))
|
@@ -110,9 +118,9 @@ module Kitchen
|
|
110
118
|
def run_command
|
111
119
|
return if local_suite_files.empty?
|
112
120
|
wrap_shell_code(Util.outdent!(<<-CMD
|
113
|
-
cd "#{File.join(config[:root_path],'suites/pester/' )}"
|
114
121
|
$global:ProgressPreference = 'SilentlyContinue'
|
115
|
-
|
122
|
+
$TestPath = "#{File.join(config[:root_path], 'suites')}"
|
123
|
+
import-module Pester -force; invoke-pester -path $testpath -enableexit
|
116
124
|
CMD
|
117
125
|
))
|
118
126
|
end
|
@@ -120,8 +128,12 @@ module Kitchen
|
|
120
128
|
#private
|
121
129
|
|
122
130
|
def restart_winrm_service
|
131
|
+
|
132
|
+
cmd = 'schtasks /Create /TN restart_winrm /TR ' /
|
133
|
+
'"powershell -command restart-service winrm" ' /
|
134
|
+
'/SC ONCE /ST 00:00 '
|
123
135
|
wrap_shell_code(Util.outdent!(<<-CMD
|
124
|
-
|
136
|
+
#{cmd}
|
125
137
|
schtasks /RUN /TN restart_winrm
|
126
138
|
CMD
|
127
139
|
))
|
@@ -135,9 +147,12 @@ module Kitchen
|
|
135
147
|
# @api private
|
136
148
|
|
137
149
|
def local_suite_files
|
138
|
-
base = File.join(
|
139
|
-
|
140
|
-
|
150
|
+
base = File.join(test_folder, config[:suite_name])
|
151
|
+
top_level_glob = File.join(base, "*")
|
152
|
+
folder_glob = File.join(base, "*/**/*")
|
153
|
+
top = Dir.glob(top_level_glob)
|
154
|
+
nested = Dir.glob(folder_glob)
|
155
|
+
(top << nested).flatten!.reject do |f|
|
141
156
|
File.directory?(f)
|
142
157
|
end
|
143
158
|
end
|
@@ -146,12 +161,14 @@ module Kitchen
|
|
146
161
|
#
|
147
162
|
# @api private
|
148
163
|
def prepare_pester_tests
|
149
|
-
base = File.join(
|
164
|
+
base = File.join(test_folder, config[:suite_name])
|
165
|
+
info("Preparing to copy files from #{base} to the SUT.")
|
150
166
|
|
151
167
|
local_suite_files.each do |src|
|
152
168
|
dest = File.join(sandbox_suites_dir, src.sub("#{base}/", ""))
|
169
|
+
debug("Copying #{src} to #{dest}")
|
153
170
|
FileUtils.mkdir_p(File.dirname(dest))
|
154
|
-
FileUtils.cp(src, dest, :
|
171
|
+
FileUtils.cp(src, dest, preserve: true)
|
155
172
|
end
|
156
173
|
end
|
157
174
|
|
@@ -161,6 +178,18 @@ module Kitchen
|
|
161
178
|
File.join(sandbox_path, "suites")
|
162
179
|
end
|
163
180
|
|
181
|
+
def test_folder
|
182
|
+
return config[:test_base_path] if config[:test_folder].nil?
|
183
|
+
absolute_test_folder
|
184
|
+
end
|
185
|
+
|
186
|
+
def absolute_test_folder
|
187
|
+
path = (Pathname.new config[:test_folder]).realpath
|
188
|
+
integration_path = File.join(path, 'integration')
|
189
|
+
return path unless Dir.exist?(integration_path)
|
190
|
+
integration_path
|
191
|
+
end
|
192
|
+
|
164
193
|
end
|
165
194
|
end
|
166
|
-
end
|
195
|
+
end
|
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.4.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: 2015-
|
11
|
+
date: 2015-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -73,6 +73,7 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
+
- ".gitignore"
|
76
77
|
- Gemfile
|
77
78
|
- LICENSE
|
78
79
|
- README.md
|
@@ -100,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
101
|
version: '0'
|
101
102
|
requirements: []
|
102
103
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.4.
|
104
|
+
rubygems_version: 2.4.8
|
104
105
|
signing_key:
|
105
106
|
specification_version: 4
|
106
107
|
summary: Test-Kitchen verifier for Pester.
|