simp-rake-helpers 5.9.1 → 5.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/CHANGELOG.md +10 -0
- data/lib/simp/ci/gitlab.rb +226 -0
- data/lib/simp/rake/ci.rb +31 -0
- data/lib/simp/rake/helpers/version.rb +1 -1
- data/lib/simp/rake/pupmod/helpers.rb +3 -0
- data/spec/lib/simp/ci/files/global_nodesets_only/spec/acceptance/nodesets/default.yml +41 -0
- data/spec/lib/simp/ci/files/global_nodesets_only/spec/acceptance/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/files/job_broken_link_nodeset/spec/acceptance/nodesets/centos.yml +41 -0
- data/spec/lib/simp/ci/files/job_broken_link_nodeset/spec/acceptance/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/files/job_broken_link_nodeset/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/job_broken_link_nodeset/spec/acceptance/suites/default/nodesets +1 -0
- data/spec/lib/simp/ci/files/job_invalid_nodeset/spec/acceptance/nodesets/default.yml +41 -0
- data/spec/lib/simp/ci/files/job_invalid_nodeset/spec/acceptance/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/files/job_invalid_nodeset/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/job_invalid_nodeset/spec/acceptance/suites/default/nodesets +1 -0
- data/spec/lib/simp/ci/files/job_invalid_suite/spec/acceptance/nodesets/default.yml +41 -0
- data/spec/lib/simp/ci/files/job_invalid_suite/spec/acceptance/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/files/job_invalid_suite/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/job_invalid_suite/spec/acceptance/suites/default/nodesets +1 -0
- data/spec/lib/simp/ci/files/job_missing_nodeset/spec/acceptance/nodesets/default.yml +41 -0
- data/spec/lib/simp/ci/files/job_missing_nodeset/spec/acceptance/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/files/job_missing_nodeset/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/job_missing_nodeset/spec/acceptance/suites/default/nodesets +1 -0
- data/spec/lib/simp/ci/files/job_missing_suite_and_nodeset/spec/acceptance/nodesets/default.yml +41 -0
- data/spec/lib/simp/ci/files/job_missing_suite_and_nodeset/spec/acceptance/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/files/job_missing_suite_and_nodeset/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/job_missing_suite_and_nodeset/spec/acceptance/suites/default/nodesets +1 -0
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/nodesets/default.yml +41 -0
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/suites/default/nodesets +1 -0
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/suites/feature-1/feature-1_spec.rb +0 -0
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/suites/feature_2/feature_2_spec.rb +0 -0
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/suites/feature_2/nodesets/default.yml +35 -0
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/suites/feature_2/nodesets/oel.yml +35 -0
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/nodesets/default.yml +41 -0
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/suites/default/nodesets +1 -0
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/suites/feature-1/feature-1_spec.rb +0 -0
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/suites/feature_2/feature_2_spec.rb +0 -0
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/suites/feature_2/nodesets/default.yml +35 -0
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/suites/feature_2/nodesets/oel.yml +35 -0
- data/spec/lib/simp/ci/files/no_acceptance_tests/spec/spec_helper.rb +0 -0
- data/spec/lib/simp/ci/files/no_gitlab_config_with_tests/spec/acceptance/nodesets/default.yml +41 -0
- data/spec/lib/simp/ci/files/no_gitlab_config_with_tests/spec/acceptance/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/files/no_gitlab_config_with_tests/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/no_gitlab_config_with_tests/spec/acceptance/suites/default/nodesets +1 -0
- data/spec/lib/simp/ci/files/no_gitlab_config_without_tests/spec/acceptance/nodesets/default.yml +41 -0
- data/spec/lib/simp/ci/files/no_gitlab_config_without_tests/spec/acceptance/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/files/no_gitlab_config_without_tests/spec/acceptance/suites/default/nodesets +1 -0
- data/spec/lib/simp/ci/files/suite_skeleton_only/spec/acceptance/nodesets/centos.yml +41 -0
- data/spec/lib/simp/ci/files/suite_skeleton_only/spec/acceptance/nodesets/default.yml +1 -0
- data/spec/lib/simp/ci/files/suite_skeleton_only/spec/acceptance/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/files/suite_skeleton_only/spec/acceptance/suites/default/nodesets +1 -0
- data/spec/lib/simp/ci/files/valid_job_global_nodeset/spec/acceptance/nodesets/default.yml +41 -0
- data/spec/lib/simp/ci/files/valid_job_global_nodeset/spec/acceptance/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/files/valid_job_global_nodeset/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/valid_job_nodeset_dir_link/spec/acceptance/nodesets/default.yml +41 -0
- data/spec/lib/simp/ci/files/valid_job_nodeset_dir_link/spec/acceptance/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/files/valid_job_nodeset_dir_link/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/valid_job_nodeset_dir_link/spec/acceptance/suites/default/nodesets +1 -0
- data/spec/lib/simp/ci/files/valid_job_nodeset_link/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/valid_job_nodeset_link/spec/acceptance/suites/default/nodesets/centos.yml +41 -0
- data/spec/lib/simp/ci/files/valid_job_nodeset_link/spec/acceptance/suites/default/nodesets/default.yml +1 -0
- data/spec/lib/simp/ci/files/valid_job_nodeset_link/spec/acceptance/suites/default/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/files/valid_job_suite_nodeset/spec/acceptance/suites/default/class_spec.rb +0 -0
- data/spec/lib/simp/ci/files/valid_job_suite_nodeset/spec/acceptance/suites/default/nodesets/default.yml +41 -0
- data/spec/lib/simp/ci/files/valid_job_suite_nodeset/spec/acceptance/suites/default/nodesets/oel.yml +41 -0
- data/spec/lib/simp/ci/gitlab_spec.rb +246 -0
- metadata +69 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 65ee32e179771d6725f18da924bacd3d4b353f3a0c0c749bb2b57a528d90b894
|
|
4
|
+
data.tar.gz: 045d27ccdf12290434f4204c7d425f15a759728f573f6e86ebe32cf90e5ef5db
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0b09c3c74733fc251350f2a6e9c09def3847135ecc9343b9ce572b3e85671ceceedade4b401c3545a60ca05cc45ebbc40dfad9d4e97b12b3fcd01139d1b94336
|
|
7
|
+
data.tar.gz: 76d3d44f17ff155ad8e775722b78c66fa3506024b154d085154744b691bdd2a2088e67f205a079da8e004c97920dd5858dcce588078997460c794f06b4b75ed3
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
### 5.10.0 /2019-08-30
|
|
2
|
+
* Add initial linting tasks for CI configuration (simp:ci_lint and
|
|
3
|
+
simp:gitlab_ci_lint). The only checks currently being done are
|
|
4
|
+
as follows:
|
|
5
|
+
* verifies the .gitlab-ci.yml is valid YAML
|
|
6
|
+
* verifies the .gitlab-ci.yml passes GitLab lint checks
|
|
7
|
+
* verifies each acceptance test job in the .gitlab-ci.yml fully
|
|
8
|
+
specifies the suite and nodeset to be used and that the specified
|
|
9
|
+
suite and nodeset exist.
|
|
10
|
+
|
|
1
11
|
### 5.9.1 /2019-08-06
|
|
2
12
|
Fixed 2 bugs in the SIMP Puppet module generated RPM spec files
|
|
3
13
|
* When SIMP Puppet module RPMs were installed, they created the wrong
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
module Simp; end
|
|
2
|
+
module Simp::Ci; end
|
|
3
|
+
|
|
4
|
+
# Class that provides GitLab-CI-related methods
|
|
5
|
+
class Simp::Ci::Gitlab
|
|
6
|
+
require 'yaml'
|
|
7
|
+
require 'json'
|
|
8
|
+
|
|
9
|
+
# base class for errors
|
|
10
|
+
class Error < StandardError ; end
|
|
11
|
+
|
|
12
|
+
# incorrectly configured GitLab job
|
|
13
|
+
class JobError < Error ; end
|
|
14
|
+
|
|
15
|
+
# incorrectly configured gitlab-ci.yml
|
|
16
|
+
class LintError < Error ; end
|
|
17
|
+
|
|
18
|
+
# @param component_dir Root directory of the component project
|
|
19
|
+
def initialize(component_dir)
|
|
20
|
+
@component_dir = component_dir
|
|
21
|
+
@gitlab_config_file = File.join(@component_dir, '.gitlab-ci.yml')
|
|
22
|
+
@gitlab_yaml = nil
|
|
23
|
+
@acceptance_dir = File.join(@component_dir, 'spec', 'acceptance')
|
|
24
|
+
@suites_dir = File.join(@acceptance_dir, 'suites')
|
|
25
|
+
|
|
26
|
+
# for reporting purposes, just use the name of the component
|
|
27
|
+
# directory as the component name
|
|
28
|
+
@component = File.basename(component_dir)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# @return true when config is the hash for an acceptance test job
|
|
32
|
+
def acceptance_job?(config)
|
|
33
|
+
config.is_a?(Hash) &&
|
|
34
|
+
config.has_key?('script') &&
|
|
35
|
+
(config.has_key?('stage') && (config['stage'] == 'acceptance'))
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# @return whether the project has any suite-based acceptance tests
|
|
39
|
+
def acceptance_tests?
|
|
40
|
+
tests_found = false
|
|
41
|
+
suite_dirs = Dir.glob(File.join(@suites_dir, '*'))
|
|
42
|
+
suite_dirs.delete_if { |x| ! File.directory?(x) }
|
|
43
|
+
suite_dirs.each do |suite_dir|
|
|
44
|
+
tests = Dir.glob(File.join(suite_dir, '*_spec.rb'))
|
|
45
|
+
next if tests.empty?
|
|
46
|
+
nodesets = Dir.glob(File.join(suite_dir, 'nodesets', '*.yml'))
|
|
47
|
+
if nodesets.empty?
|
|
48
|
+
nodesets = Dir.glob(File.join(@acceptance_dir, 'nodesets', '*.yml'))
|
|
49
|
+
end
|
|
50
|
+
unless nodesets.empty?
|
|
51
|
+
tests_found = true
|
|
52
|
+
break
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
tests_found
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# @return path to a suite's nodeset YAML file if it exists or nil otherwise
|
|
59
|
+
#
|
|
60
|
+
# If the suite has no 'nodesets' directory, it will search for the
|
|
61
|
+
# nodeset YAML in the global nodeset directory.
|
|
62
|
+
#
|
|
63
|
+
def find_nodeset_yaml(suite, nodeset)
|
|
64
|
+
nodeset_yml = nil
|
|
65
|
+
suite_nodesets_dir = File.join(@suites_dir, suite, 'nodesets')
|
|
66
|
+
if Dir.exist?(suite_nodesets_dir)
|
|
67
|
+
nodeset_yml = File.join(suite_nodesets_dir, "#{nodeset}.yml")
|
|
68
|
+
nodeset_yml = nil unless File.exist?(nodeset_yml)
|
|
69
|
+
else
|
|
70
|
+
nodeset_yml = File.join(@acceptance_dir, 'nodesets', "#{nodeset}.yml")
|
|
71
|
+
nodeset_yml = nil unless File.exist?(nodeset_yml)
|
|
72
|
+
end
|
|
73
|
+
nodeset_yml
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Loads .gitlab-ci.yml
|
|
77
|
+
# @return Hash of GitLab configuration
|
|
78
|
+
# @raise Simp::Ci::Gitlab::LintError if YAML is malformed
|
|
79
|
+
def load_gitlab_yaml
|
|
80
|
+
return @gitlab_yaml if @gitlab_yaml
|
|
81
|
+
|
|
82
|
+
begin
|
|
83
|
+
@gitlab_yaml = YAML.load_file(@gitlab_config_file)
|
|
84
|
+
rescue Psych::SyntaxError => e
|
|
85
|
+
msg = "ERROR: Malformed YAML: #{e.message}"
|
|
86
|
+
raise LintError.new(msg)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
@gitlab_yaml
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Validate GitLab acceptance test job specifications
|
|
93
|
+
#
|
|
94
|
+
# Verify each acceptance test job specifies both a valid suite and
|
|
95
|
+
# a valid nodeset
|
|
96
|
+
#
|
|
97
|
+
# @raise Simp::Ci::Gitlab::JobError if validation fails.
|
|
98
|
+
# Validation will fail under the following conditions
|
|
99
|
+
# (1) an acceptance test job is missing the suite or nodeset
|
|
100
|
+
# (2) an acceptance test job contains an invalid suite or nodeset
|
|
101
|
+
#
|
|
102
|
+
def validate_acceptance_test_jobs
|
|
103
|
+
return unless File.exist?(@gitlab_config_file)
|
|
104
|
+
|
|
105
|
+
failures = []
|
|
106
|
+
|
|
107
|
+
gitlab_yaml = load_gitlab_yaml
|
|
108
|
+
gitlab_yaml.each do |key, value|
|
|
109
|
+
next unless acceptance_job?(value)
|
|
110
|
+
|
|
111
|
+
value['script'].each do |line|
|
|
112
|
+
next unless line.include? 'beaker:suites'
|
|
113
|
+
if line.include?('[')
|
|
114
|
+
match = line.match(/beaker:suites\[([\w\-_]*)(,([\w\-_]*))?\]/)
|
|
115
|
+
suite = match[1]
|
|
116
|
+
nodeset = match[3]
|
|
117
|
+
|
|
118
|
+
if ! valid_suite?(suite)
|
|
119
|
+
failures << "#{@component} job '#{key}' uses invalid suite '#{suite}': '#{line}'"
|
|
120
|
+
elsif nodeset.nil?
|
|
121
|
+
failures << "#{@component} job '#{key}' missing nodeset: '#{line}'"
|
|
122
|
+
elsif ! find_nodeset_yaml(suite, nodeset)
|
|
123
|
+
failures << "#{@component} job '#{key}' uses invalid nodeset '#{nodeset}': '#{line}'"
|
|
124
|
+
end
|
|
125
|
+
else
|
|
126
|
+
failures << "#{@component} job '#{key}' missing suite and nodeset: '#{line}'"
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
unless failures.empty?
|
|
132
|
+
separator = "\n "
|
|
133
|
+
msg = "Invalid GitLab acceptance test config:#{separator}#{failures.join(separator)}"
|
|
134
|
+
raise JobError.new(msg)
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Validate gitlab configuration
|
|
139
|
+
#
|
|
140
|
+
# Validation performed
|
|
141
|
+
# - Verifies configuration file is valid YAML
|
|
142
|
+
# --Verifies configuration file passes GitLab lint check, when connectivity
|
|
143
|
+
# to GitLab is available
|
|
144
|
+
# - Verifies acceptance test job configuration has valid suites and nodesets
|
|
145
|
+
# @raise Simp::Ci::Gitlab::Error upon any validation failure
|
|
146
|
+
#
|
|
147
|
+
def validate_config
|
|
148
|
+
if File.exist?(@gitlab_config_file)
|
|
149
|
+
validate_yaml
|
|
150
|
+
validate_acceptance_test_jobs
|
|
151
|
+
elsif acceptance_tests?
|
|
152
|
+
# can't assume this is a failure, so just warn
|
|
153
|
+
puts "WARNING: #{@component} has acceptance tests but no .gitlab-ci.yml"
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Verifies gitlab-ci.yml is valid YAML and, when possible, passes GitLab
|
|
158
|
+
# lint checks
|
|
159
|
+
# @raise Simp::Ci::Gitlab::LintError upon any failure
|
|
160
|
+
def validate_yaml
|
|
161
|
+
return unless File.exist?(@gitlab_config_file)
|
|
162
|
+
|
|
163
|
+
# first check for malformed yaml
|
|
164
|
+
gitlab_yaml = load_gitlab_yaml
|
|
165
|
+
|
|
166
|
+
# apply GitLab lint check
|
|
167
|
+
begin
|
|
168
|
+
gitlab_config_json = gitlab_yaml.to_json
|
|
169
|
+
rescue Exception => e
|
|
170
|
+
# really should never get here....
|
|
171
|
+
puts "WARNING: Could not lint check #{@component}'s GitLab configuration: query could not be formed"
|
|
172
|
+
return
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
curl ||= %x(which curl).strip
|
|
176
|
+
if curl.empty?
|
|
177
|
+
puts "WARNING: Could not lint check #{@component}'s GitLab configuration: Could not find 'curl'"
|
|
178
|
+
return
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
query = [
|
|
182
|
+
curl,
|
|
183
|
+
'--silent',
|
|
184
|
+
'--header "Content-Type: application/json"',
|
|
185
|
+
'https://gitlab.com/api/v4/ci/lint',
|
|
186
|
+
'--data', "'{\"content\":#{gitlab_config_json.dump}}'"
|
|
187
|
+
]
|
|
188
|
+
result = `#{query.join(' ')}`
|
|
189
|
+
|
|
190
|
+
status = :unknown
|
|
191
|
+
errors = nil
|
|
192
|
+
begin
|
|
193
|
+
result_hash = JSON.load(result)
|
|
194
|
+
# if stdout is empty, result_hash will be nil
|
|
195
|
+
unless result_hash.nil?
|
|
196
|
+
if result_hash.has_key?('status')
|
|
197
|
+
if result_hash['status'] == 'valid'
|
|
198
|
+
status = :valid
|
|
199
|
+
else
|
|
200
|
+
status = :invalid
|
|
201
|
+
errors = result_hash['errors']
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
rescue
|
|
207
|
+
# stdout does not contain JSON...don't know what happened!
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
if status == :unknown
|
|
211
|
+
puts "WARNING: Unable to lint check #{@component}'s GitLab configuration"
|
|
212
|
+
elsif status == :invalid
|
|
213
|
+
separator = "\n "
|
|
214
|
+
msg = "ERROR: Invalid GitLab config:#{separator}#{errors.join(separator)}"
|
|
215
|
+
raise LintError.new(msg)
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def valid_suite?(suite)
|
|
221
|
+
suite_dir = File.join(@suites_dir, suite)
|
|
222
|
+
#TODO check for suites that have no tests?
|
|
223
|
+
return Dir.exist?(suite_dir)
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
end
|
data/lib/simp/rake/ci.rb
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
require 'rake/tasklib'
|
|
2
|
+
require 'simp/ci/gitlab'
|
|
3
|
+
|
|
4
|
+
module Simp; end
|
|
5
|
+
module Simp::Rake
|
|
6
|
+
class Ci < ::Rake::TaskLib
|
|
7
|
+
def initialize( dir )
|
|
8
|
+
@base_dir = dir
|
|
9
|
+
define
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def define
|
|
13
|
+
namespace :simp do
|
|
14
|
+
|
|
15
|
+
desc 'Validate CI configuration'
|
|
16
|
+
task :ci_lint => [:gitlab_ci_lint] do
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
desc 'Validate GitLab CI configuration'
|
|
20
|
+
task :gitlab_ci_lint do
|
|
21
|
+
# only validation so far is as follows:
|
|
22
|
+
# - config file is valid YAML
|
|
23
|
+
# - config file passes GitLab lint check, when GitLab available
|
|
24
|
+
# - acceptance test job config has valid suites and nodesets
|
|
25
|
+
Simp::Ci::Gitlab.new(@base_dir).validate_config
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -2,6 +2,7 @@ require 'puppetlabs_spec_helper/rake_tasks'
|
|
|
2
2
|
require 'puppet/version'
|
|
3
3
|
require 'puppet-syntax/tasks/puppet-syntax'
|
|
4
4
|
require 'puppet-lint/tasks/puppet-lint'
|
|
5
|
+
require 'simp/rake/ci'
|
|
5
6
|
require 'simp/rake/pkg'
|
|
6
7
|
require 'simp/rake/beaker'
|
|
7
8
|
require 'parallel_tests/cli'
|
|
@@ -86,6 +87,8 @@ class Simp::Rake::Pupmod::Helpers < ::Rake::TaskLib
|
|
|
86
87
|
|
|
87
88
|
Simp::Rake::Beaker.new( @base_dir )
|
|
88
89
|
|
|
90
|
+
Simp::Rake::Ci.new( @base_dir )
|
|
91
|
+
|
|
89
92
|
desc "Run acceptance tests"
|
|
90
93
|
RSpec::Core::RakeTask.new(:acceptance) do |t|
|
|
91
94
|
t.pattern = 'spec/acceptance'
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<%
|
|
2
|
+
if ENV['BEAKER_HYPERVISOR']
|
|
3
|
+
hypervisor = ENV['BEAKER_HYPERVISOR']
|
|
4
|
+
else
|
|
5
|
+
hypervisor = 'vagrant'
|
|
6
|
+
end
|
|
7
|
+
-%>
|
|
8
|
+
HOSTS:
|
|
9
|
+
client:
|
|
10
|
+
roles:
|
|
11
|
+
- default
|
|
12
|
+
- master
|
|
13
|
+
- client
|
|
14
|
+
platform: el-7-x86_64
|
|
15
|
+
box: centos/7
|
|
16
|
+
hypervisor: <%= hypervisor %>
|
|
17
|
+
server-1:
|
|
18
|
+
roles:
|
|
19
|
+
- server
|
|
20
|
+
platform: el-7-x86_64
|
|
21
|
+
box: centos/7
|
|
22
|
+
hypervisor: <%= hypervisor %>
|
|
23
|
+
server-2:
|
|
24
|
+
roles:
|
|
25
|
+
- server
|
|
26
|
+
platform: el-6-x86_64
|
|
27
|
+
box: centos/6
|
|
28
|
+
hypervisor: <%= hypervisor %>
|
|
29
|
+
server-3:
|
|
30
|
+
roles:
|
|
31
|
+
- failover_server
|
|
32
|
+
platform: el-7-x86_64
|
|
33
|
+
box: centos/7
|
|
34
|
+
hypervisor: <%= hypervisor %>
|
|
35
|
+
CONFIG:
|
|
36
|
+
log_level: verbose
|
|
37
|
+
type: aio
|
|
38
|
+
vagrant_memsize: 256
|
|
39
|
+
<% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
|
|
40
|
+
puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
|
|
41
|
+
<% end -%>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<%
|
|
2
|
+
if ENV['BEAKER_HYPERVISOR']
|
|
3
|
+
hypervisor = ENV['BEAKER_HYPERVISOR']
|
|
4
|
+
else
|
|
5
|
+
hypervisor = 'vagrant'
|
|
6
|
+
end
|
|
7
|
+
-%>
|
|
8
|
+
HOSTS:
|
|
9
|
+
client:
|
|
10
|
+
roles:
|
|
11
|
+
- default
|
|
12
|
+
- master
|
|
13
|
+
- client
|
|
14
|
+
platform: el-7-x86_64
|
|
15
|
+
box: onyxpoint/oel-7-x86_64
|
|
16
|
+
hypervisor: <%= hypervisor %>
|
|
17
|
+
server-1:
|
|
18
|
+
roles:
|
|
19
|
+
- server
|
|
20
|
+
platform: el-7-x86_64
|
|
21
|
+
box: onyxpoint/oel-7-x86_64
|
|
22
|
+
hypervisor: <%= hypervisor %>
|
|
23
|
+
server-2:
|
|
24
|
+
roles:
|
|
25
|
+
- server
|
|
26
|
+
platform: el-6-x86_64
|
|
27
|
+
box: onyxpoint/oel-7-x86_64
|
|
28
|
+
hypervisor: <%= hypervisor %>
|
|
29
|
+
server-3:
|
|
30
|
+
roles:
|
|
31
|
+
- failover_server
|
|
32
|
+
platform: el-7-x86_64
|
|
33
|
+
box: onyxpoint/oel-7-x86_64
|
|
34
|
+
hypervisor: <%= hypervisor %>
|
|
35
|
+
CONFIG:
|
|
36
|
+
log_level: verbose
|
|
37
|
+
type: aio
|
|
38
|
+
vagrant_memsize: 256
|
|
39
|
+
<% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
|
|
40
|
+
puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
|
|
41
|
+
<% end -%>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<%
|
|
2
|
+
if ENV['BEAKER_HYPERVISOR']
|
|
3
|
+
hypervisor = ENV['BEAKER_HYPERVISOR']
|
|
4
|
+
else
|
|
5
|
+
hypervisor = 'vagrant'
|
|
6
|
+
end
|
|
7
|
+
-%>
|
|
8
|
+
HOSTS:
|
|
9
|
+
client:
|
|
10
|
+
roles:
|
|
11
|
+
- default
|
|
12
|
+
- master
|
|
13
|
+
- client
|
|
14
|
+
platform: el-7-x86_64
|
|
15
|
+
box: centos/7
|
|
16
|
+
hypervisor: <%= hypervisor %>
|
|
17
|
+
server-1:
|
|
18
|
+
roles:
|
|
19
|
+
- server
|
|
20
|
+
platform: el-7-x86_64
|
|
21
|
+
box: centos/7
|
|
22
|
+
hypervisor: <%= hypervisor %>
|
|
23
|
+
server-2:
|
|
24
|
+
roles:
|
|
25
|
+
- server
|
|
26
|
+
platform: el-6-x86_64
|
|
27
|
+
box: centos/6
|
|
28
|
+
hypervisor: <%= hypervisor %>
|
|
29
|
+
server-3:
|
|
30
|
+
roles:
|
|
31
|
+
- failover_server
|
|
32
|
+
platform: el-7-x86_64
|
|
33
|
+
box: centos/7
|
|
34
|
+
hypervisor: <%= hypervisor %>
|
|
35
|
+
CONFIG:
|
|
36
|
+
log_level: verbose
|
|
37
|
+
type: aio
|
|
38
|
+
vagrant_memsize: 256
|
|
39
|
+
<% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
|
|
40
|
+
puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
|
|
41
|
+
<% end -%>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<%
|
|
2
|
+
if ENV['BEAKER_HYPERVISOR']
|
|
3
|
+
hypervisor = ENV['BEAKER_HYPERVISOR']
|
|
4
|
+
else
|
|
5
|
+
hypervisor = 'vagrant'
|
|
6
|
+
end
|
|
7
|
+
-%>
|
|
8
|
+
HOSTS:
|
|
9
|
+
client:
|
|
10
|
+
roles:
|
|
11
|
+
- default
|
|
12
|
+
- master
|
|
13
|
+
- client
|
|
14
|
+
platform: el-7-x86_64
|
|
15
|
+
box: onyxpoint/oel-7-x86_64
|
|
16
|
+
hypervisor: <%= hypervisor %>
|
|
17
|
+
server-1:
|
|
18
|
+
roles:
|
|
19
|
+
- server
|
|
20
|
+
platform: el-7-x86_64
|
|
21
|
+
box: onyxpoint/oel-7-x86_64
|
|
22
|
+
hypervisor: <%= hypervisor %>
|
|
23
|
+
server-2:
|
|
24
|
+
roles:
|
|
25
|
+
- server
|
|
26
|
+
platform: el-6-x86_64
|
|
27
|
+
box: onyxpoint/oel-7-x86_64
|
|
28
|
+
hypervisor: <%= hypervisor %>
|
|
29
|
+
server-3:
|
|
30
|
+
roles:
|
|
31
|
+
- failover_server
|
|
32
|
+
platform: el-7-x86_64
|
|
33
|
+
box: onyxpoint/oel-7-x86_64
|
|
34
|
+
hypervisor: <%= hypervisor %>
|
|
35
|
+
CONFIG:
|
|
36
|
+
log_level: verbose
|
|
37
|
+
type: aio
|
|
38
|
+
vagrant_memsize: 256
|
|
39
|
+
<% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
|
|
40
|
+
puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
|
|
41
|
+
<% end -%>
|