kitchen-salt 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/kitchen-salt/version.rb +1 -1
- data/lib/kitchen/provisioner/install.erb +2 -2
- data/lib/kitchen/verifier/salttox.rb +4 -4
- data/lib/kitchen/verifier/tox.rb +134 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 90801c5a0ac6861667789c0f422110363806d1f2
|
4
|
+
data.tar.gz: 352badb1b9702f53ecd314cfd5779b4bf7f3f361
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a91546dd9201fb63503475db3d7aef5d0ccb97846db2e823888d09b3feb61d3f25c97be6178fa544c9bbb1d9a607bec5c21ca86702684ecdede0cb5c372dd1f8
|
7
|
+
data.tar.gz: ed3777689beef0dbfde59a821ea2a55f3e1e65e3bc99d9e5c7f67e9ba9a08914ba5c078973a82baebe289d1d1461510fdb33bf38755111e4d18d5e0cb3b475ec
|
data/lib/kitchen-salt/version.rb
CHANGED
@@ -39,8 +39,8 @@ then
|
|
39
39
|
#{sudo('sh')} $BOOTSTRAP #{bootstrap_options}
|
40
40
|
elif [ -z "${SALT_VERSION}" -a "#{salt_install}" = "pip" ]
|
41
41
|
then
|
42
|
-
echo "
|
43
|
-
#{sudo(salt_pip_bin)} install "setuptools>=30"
|
42
|
+
echo "Make sure setuptools and pip are new enough"
|
43
|
+
#{sudo(salt_pip_bin)} install "setuptools>=30" "pip>=9"
|
44
44
|
echo #{sudo(salt_pip_bin)} #{salt_pip_install_command} #{salt_pip_pkg}
|
45
45
|
#{sudo(salt_pip_bin)} #{salt_pip_install_command} #{salt_pip_pkg}
|
46
46
|
elif [ -z "${SALT_VERSION}" -a "#{salt_install}" = "apt" ]
|
@@ -27,10 +27,10 @@ module Kitchen
|
|
27
27
|
ENV['KITCHEN_TESTS'].split(' ').each{|test| config[:tests].push(test)}
|
28
28
|
end
|
29
29
|
command = [
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
'tox -c',
|
31
|
+
File.join(root_path, config[:testingdir], 'tox.ini'),
|
32
|
+
"-e #{instance.suite.name}",
|
33
|
+
'--',
|
34
34
|
'--sysinfo',
|
35
35
|
'--output-columns=80',
|
36
36
|
(config[:windows] ? "--names-file=#{root_path}\\testing\\tests\\whitelist.txt" : ''),
|
@@ -0,0 +1,134 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require "kitchen/verifier/base"
|
4
|
+
|
5
|
+
module Kitchen
|
6
|
+
module Verifier
|
7
|
+
class Tox < Kitchen::Verifier::Base
|
8
|
+
kitchen_verifier_api_version 1
|
9
|
+
|
10
|
+
plugin_version Kitchen::VERSION
|
11
|
+
|
12
|
+
default_config :testingdir, '/testing'
|
13
|
+
default_config :tests, []
|
14
|
+
default_config :transport, false
|
15
|
+
default_config :save, {}
|
16
|
+
default_config :windows, false
|
17
|
+
default_config :verbose, false
|
18
|
+
default_config :run_destructive, false
|
19
|
+
default_config :ssh_tests, true
|
20
|
+
default_config :proxy_tests, false
|
21
|
+
default_config :pytest, false
|
22
|
+
default_config :coverage, false
|
23
|
+
default_config :junitxml, false
|
24
|
+
default_config :from_filenames, []
|
25
|
+
default_config :enable_filenames, false
|
26
|
+
default_config :passthrough_opts, []
|
27
|
+
default_config :output_columns, 120
|
28
|
+
default_config :sysinfo, true
|
29
|
+
|
30
|
+
def call(state)
|
31
|
+
info("[#{name}] Verify on instance #{instance.name} with state=#{state}")
|
32
|
+
root_path = (config[:windows] ? '%TEMP%\\kitchen' : '/tmp/kitchen')
|
33
|
+
if ENV['KITCHEN_TESTS']
|
34
|
+
ENV['KITCHEN_TESTS'].split(' ').each{|test| config[:tests].push(test)}
|
35
|
+
end
|
36
|
+
toxenv = instance.suite.name
|
37
|
+
if config[:pytest]
|
38
|
+
toxenv = "#{toxenv}-pytest"
|
39
|
+
tests = config[:tests].join(' ')
|
40
|
+
else
|
41
|
+
toxenv = "#{toxenv}-runtests"
|
42
|
+
tests = config[:tests].collect{|test| "-n #{test}"}.join(' ')
|
43
|
+
end
|
44
|
+
if config[:coverage]
|
45
|
+
toxenv = "#{toxenv}-coverage"
|
46
|
+
end
|
47
|
+
|
48
|
+
if config[:enable_filenames] and ENV['CHANGE_TARGET'] and ENV['BRANCH_NAME']
|
49
|
+
require 'git'
|
50
|
+
repo = Git.open(Dir.pwd)
|
51
|
+
config[:from_filenames] = repo.diff("origin/#{ENV['CHANGE_TARGET']}",
|
52
|
+
"origin/#{ENV['BRANCH_NAME']}").name_status.keys.select{|file| file.end_with?('.py')}
|
53
|
+
end
|
54
|
+
|
55
|
+
if config[:junitxml]
|
56
|
+
junitxml = File.join(root_path, config[:testingdir], 'artifacts', 'xml-unittests-output')
|
57
|
+
if config[:pytest]
|
58
|
+
junitxml = "--junitxml=#{File.join(junitxml, 'test-results.xml')}"
|
59
|
+
else
|
60
|
+
junitxml = "--xml=#{junitxml}"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Be sure to copy the remote artifacts directory to the local machine
|
65
|
+
save = {
|
66
|
+
"#{File.join(root_path, config[:testingdir], 'artifacts')}" => "#{Dir.pwd}/"
|
67
|
+
}
|
68
|
+
# Hash insert order matters, that's why we define a new one and merge
|
69
|
+
# the one from config
|
70
|
+
save.merge!(config[:save])
|
71
|
+
|
72
|
+
command = [
|
73
|
+
'tox -c',
|
74
|
+
File.join(root_path, config[:testingdir], 'tox.ini'),
|
75
|
+
"-e #{toxenv}",
|
76
|
+
'--',
|
77
|
+
"--output-columns=#{config[:output_columns]}",
|
78
|
+
(config[:sysinfo] ? '--sysinfo' : ''),
|
79
|
+
(config[:junitxml] ? junitxml : ''),
|
80
|
+
(config[:windows] ? "--names-file=#{root_path}\\testing\\tests\\whitelist.txt" : ''),
|
81
|
+
(config[:transport] ? "--transport=#{config[:transport]}" : ''),
|
82
|
+
(config[:verbose] ? '-vv' : '-v'),
|
83
|
+
(config[:run_destructive] ? "--run-destructive" : ''),
|
84
|
+
(config[:ssh_tests] ? "--ssh-tests" : ''),
|
85
|
+
(config[:proxy_tests] ? "--proxy-tests" : ''),
|
86
|
+
config[:passthrough_opts].join(' '),
|
87
|
+
(config[:from_filenames].any? ? "--from-filenames=#{config[:from_filenames].join(',')}" : ''),
|
88
|
+
tests,
|
89
|
+
'2>&1',
|
90
|
+
].join(' ')
|
91
|
+
if config[:windows]
|
92
|
+
command = "cmd.exe /c \"#{command}\" 2>&1"
|
93
|
+
end
|
94
|
+
info("Running Command: #{command}")
|
95
|
+
instance.transport.connection(state) do |conn|
|
96
|
+
begin
|
97
|
+
if config[:windows]
|
98
|
+
conn.execute('$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")')
|
99
|
+
conn.execute("$env:PythonPath = [Environment]::ExpandEnvironmentVariables(\"#{root_path}\\testing\")")
|
100
|
+
else
|
101
|
+
begin
|
102
|
+
conn.execute(sudo("chown -R $USER #{root_path}"))
|
103
|
+
rescue => e
|
104
|
+
error("Failed to chown #{root_path} :: #{e}")
|
105
|
+
end
|
106
|
+
end
|
107
|
+
begin
|
108
|
+
conn.execute(sudo(command))
|
109
|
+
rescue => e
|
110
|
+
info("Verify command failed :: #{e}")
|
111
|
+
end
|
112
|
+
ensure
|
113
|
+
save.each do |remote, local|
|
114
|
+
unless config[:windows]
|
115
|
+
begin
|
116
|
+
conn.execute(sudo("chmod -R +r #{remote}"))
|
117
|
+
rescue => e
|
118
|
+
error("Failed to chown #{remote} :: #{e}")
|
119
|
+
end
|
120
|
+
end
|
121
|
+
begin
|
122
|
+
info("Copying #{remote} to #{local}")
|
123
|
+
conn.download(remote, local)
|
124
|
+
rescue => e
|
125
|
+
error("Failed to copy #{remote} to #{local} :: ${e}")
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
debug("[#{name}] Verify completed.")
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-salt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SaltStack Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- lib/kitchen/transport/runtests.rb
|
161
161
|
- lib/kitchen/verifier/runtests.rb
|
162
162
|
- lib/kitchen/verifier/salttox.rb
|
163
|
+
- lib/kitchen/verifier/tox.rb
|
163
164
|
homepage: https://github.com/saltstack/kitchen-salt
|
164
165
|
licenses:
|
165
166
|
- Apache-2.0
|
@@ -180,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
181
|
version: '0'
|
181
182
|
requirements: []
|
182
183
|
rubyforge_project: "[none]"
|
183
|
-
rubygems_version: 2.
|
184
|
+
rubygems_version: 2.5.2.3
|
184
185
|
signing_key:
|
185
186
|
specification_version: 4
|
186
187
|
summary: salt provisioner for test-kitchen
|