onceover 3.2.7 → 3.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -5
- data/features/{basic.feature → help.feature} +1 -1
- data/features/run.feature +19 -0
- data/features/step_definitions/common.rb +13 -23
- data/features/step_definitions/init.rb +13 -0
- data/features/{step_definitions/command.rb → support/command_helper.rb} +8 -6
- data/features/support/controlrepo_helper.rb +16 -0
- data/lib/onceover/testconfig.rb +2 -1
- data/onceover.gemspec +2 -2
- data/spec/fixtures/controlrepo_basic/Puppetfile +4 -4
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2c62563cf5b896213394193150a990cceaa671c
|
4
|
+
data.tar.gz: 6872e6d67a0f3863745e5713ca33611f03978afa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4816f05bf7055452336ff743b177feffdb8b3d75bda749b148b85edd63655c82a9d3348e1f3c36469538dbc33f581f8d8e45910bb74ceb5a085e6a799c34f745
|
7
|
+
data.tar.gz: '0883183e90d99f4ae800bbc8b843edb2202b9e744f88a053fdbabffe92ecb27a3c9ec65bcaee273c026230d5d252b175828f3a33a4a22353bb71115adae4f6f7'
|
data/README.md
CHANGED
@@ -439,11 +439,14 @@ Here we are specifying custom commands to run for starting, stopping and checkin
|
|
439
439
|
|
440
440
|
### Plugins
|
441
441
|
|
442
|
-
Onceover now allows for plugins.
|
442
|
+
Onceover now allows for plugins. To use a plugin simply install a gem with a name that starts with `onceover-` and onceover will activate it.
|
443
443
|
|
444
|
-
|
444
|
+
Useful plugins:
|
445
445
|
|
446
|
-
- [onceover-
|
446
|
+
- [onceover-codequality](https://github.com/declarativesystems/onceover-codequality) _Check lint and syntax_
|
447
|
+
- [onceover-octocatalog-diff](https://github.com/dylanratcliffe/onceover-octocatalog-diff) _See the differences between two versions of a catalog_
|
448
|
+
|
449
|
+
If you want to write your own plugin, take a look at [onceover-helloworld](https://github.com/declarativesystems/onceover-helloworld) to help you get started.
|
447
450
|
|
448
451
|
### Inspecting and updating the Puppetfile
|
449
452
|
|
@@ -576,7 +579,7 @@ repo.role_regex = /.*/ # Tells the class how to find roles, will be applied to r
|
|
576
579
|
repo.profile_regex = /.*/ # Tells the class how to find profiles, will be applied to repo.classes
|
577
580
|
```
|
578
581
|
|
579
|
-
Note that you will need to call the `roles` and `profiles` methods on the object you just instantiated, not the main class e.g. `repo.roles` not Onceover::Controlrepo.roles
|
582
|
+
Note that you will need to call the `roles` and `profiles` methods on the object you just instantiated, not the main class e.g. `repo.roles` not Onceover::Controlrepo.roles
|
580
583
|
|
581
584
|
### Rake tasks
|
582
585
|
|
@@ -654,4 +657,3 @@ Cheers to all of those who helped out:
|
|
654
657
|
- natemccurdy
|
655
658
|
- aardvark
|
656
659
|
- Mandos
|
657
|
-
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Feature: Run rspec and acceptance test suits
|
2
|
+
Onceover should allow to run rspec and acceptance test for all profvile and role classes
|
3
|
+
or for any part of them. Use should set if he wants to see only summary of tests or full
|
4
|
+
log info.
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given onceover executable
|
8
|
+
|
9
|
+
Scenario: Run correct spec tests
|
10
|
+
Given initialized control repo "controlrepo_basic"
|
11
|
+
When I run onceover command "run spec"
|
12
|
+
Then I should not see any errors
|
13
|
+
|
14
|
+
Scenario: Run spec tests with misspelled module in Puppetfile
|
15
|
+
Given initialized control repo "controlrepo_basic"
|
16
|
+
And in Puppetfile is misspelled module's name
|
17
|
+
When I run onceover command "run spec"
|
18
|
+
Then I should see error with message pattern "The module acme-not_exists does not exist"
|
19
|
+
|
@@ -1,22 +1,23 @@
|
|
1
1
|
Given /^onceover executable$/ do
|
2
|
-
@cmd =
|
2
|
+
@cmd = Command_Helper.new
|
3
3
|
end
|
4
4
|
|
5
5
|
Given(/^control repo "([^"]*)"$/) do |controlrepo_name|
|
6
|
-
@
|
7
|
-
|
8
|
-
FileUtils.
|
9
|
-
FileUtils.
|
6
|
+
@repo = ControlRepo_Helper.new( controlrepo_name )
|
7
|
+
@cmd.controlrepo = @repo
|
8
|
+
FileUtils.rm_rf @repo.root_folder
|
9
|
+
FileUtils.mkdir_p 'tmp'
|
10
|
+
FileUtils.cp_r "spec/fixtures/#{controlrepo_name}", 'tmp'
|
10
11
|
end
|
11
12
|
|
12
|
-
Given(/^control repo "([^"]*)"
|
13
|
+
Given(/^initialized control repo "([^"]*)"$/) do |controlrepo_name|
|
13
14
|
step %Q(control repo "#{controlrepo_name}")
|
14
|
-
|
15
|
-
FileUtils.rm_rf( controlrepo_path + "/#{filename}" )
|
15
|
+
step %Q(I run onceover command "init")
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
Given(/^control repo "([^"]*)" without "([^"]*)"$/) do |controlrepo_name, filename|
|
19
|
+
step %Q(control repo "#{controlrepo_name}")
|
20
|
+
FileUtils.rm_rf "#{@repo.root_folder}/#{filename}"
|
20
21
|
end
|
21
22
|
|
22
23
|
When /^I run onceover command "([^"]*)"$/ do |command|
|
@@ -44,17 +45,6 @@ Then(/^I should see error with message pattern "([^"]*)"$/) do |err_msg_regexp|
|
|
44
45
|
expect(@cmd.output.match err_msg_regexp).to_not be nil
|
45
46
|
end
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
files = [ 'spec/onceover.yaml', 'Rakefile', 'Gemfile' ].map { |x| controlrepo_path + x }
|
50
|
-
folders = [ 'spec/factsets', 'spec/pre_conditions'].map! { |x| controlrepo_path + x}
|
51
|
-
|
52
|
-
files.each do |file|
|
53
|
-
puts file
|
54
|
-
expect( File.exist? file ).to be true
|
55
|
-
end
|
56
|
-
folders.each do |folder|
|
57
|
-
puts folder
|
58
|
-
expect( Dir.exist? folder ).to be true
|
59
|
-
end
|
48
|
+
Given(/^in Puppetfile is misspelled module's name$/) do
|
49
|
+
@repo.add_line_to_puppetfile %Q(mod "acme/not_exists", "7.7.7")
|
60
50
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Then(/^I should see generated all necessary files and folders$/) do
|
2
|
+
files = [ 'spec/onceover.yaml', 'Rakefile', 'Gemfile' ].map { |x| @repo.root_folder + x }
|
3
|
+
folders = [ 'spec/factsets', 'spec/pre_conditions'].map! { |x| @repo.root_folder + x}
|
4
|
+
|
5
|
+
files.each do |file|
|
6
|
+
puts file
|
7
|
+
expect( File.exist? file ).to be true
|
8
|
+
end
|
9
|
+
folders.each do |folder|
|
10
|
+
puts folder
|
11
|
+
expect( Dir.exist? folder ).to be true
|
12
|
+
end
|
13
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "open3"
|
2
2
|
|
3
|
-
class
|
3
|
+
class Command_Helper
|
4
4
|
|
5
5
|
attr_reader(:output, :result)
|
6
6
|
|
@@ -11,18 +11,20 @@ class Command
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def run
|
14
|
-
|
15
|
-
full_cmd = "#{@executable} #{@command} #{controlrepo_param}"
|
16
|
-
@output, @result = Open3.capture2e full_cmd
|
14
|
+
@output, @result = Open3.capture2e generate_command
|
17
15
|
end
|
18
16
|
|
19
17
|
def success?
|
20
18
|
return @result.success?
|
21
19
|
end
|
22
20
|
|
23
|
-
def
|
24
|
-
controlrepo_param = @controlrepo ? "--path
|
21
|
+
def generate_command
|
22
|
+
controlrepo_param = @controlrepo ? "--path #{@controlrepo.root_folder}" : ''
|
25
23
|
return "#{@executable} #{@command} #{controlrepo_param}"
|
26
24
|
end
|
27
25
|
|
26
|
+
def to_s
|
27
|
+
return generate_command
|
28
|
+
end
|
29
|
+
|
28
30
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class ControlRepo_Helper
|
2
|
+
|
3
|
+
def initialize( name )
|
4
|
+
@name = name
|
5
|
+
@tmp_folder = 'tmp/'
|
6
|
+
end
|
7
|
+
|
8
|
+
def root_folder
|
9
|
+
return @tmp_folder + @name + '/'
|
10
|
+
end
|
11
|
+
|
12
|
+
def add_line_to_puppetfile( line )
|
13
|
+
open(root_folder + 'Puppetfile', 'a') { |f| f.puts line }
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
data/lib/onceover/testconfig.rb
CHANGED
@@ -147,7 +147,7 @@ class Onceover
|
|
147
147
|
|
148
148
|
def pre_condition
|
149
149
|
# Read all the pre_conditions and return the string
|
150
|
-
spec_dir = Onceover::Controlrepo.new.spec_dir
|
150
|
+
spec_dir = Onceover::Controlrepo.new(@opts).spec_dir
|
151
151
|
puppetcode = []
|
152
152
|
Dir["#{spec_dir}/pre_conditions/*.pp"].each do |condition_file|
|
153
153
|
logger.debug "Reading pre_conditions from #{condition_file}"
|
@@ -221,6 +221,7 @@ class Onceover
|
|
221
221
|
install_cmd = "r10k puppetfile install --verbose --color --puppetfile #{repo.puppetfile}"
|
222
222
|
logger.debug "Running #{install_cmd} from #{prod_dir}"
|
223
223
|
system(install_cmd)
|
224
|
+
raise 'r10k could not install all required modules' unless $?.success?
|
224
225
|
end
|
225
226
|
else
|
226
227
|
raise "#{repo.tempdir} is not a directory"
|
data/onceover.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "onceover"
|
6
|
-
s.version = "3.2.
|
6
|
+
s.version = "3.2.8"
|
7
7
|
s.authors = ["Dylan Ratcliffe"]
|
8
8
|
s.email = ["dylan.ratcliffe@puppet.com"]
|
9
9
|
s.homepage = "https://github.com/dylanratcliffe/onceover"
|
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
|
|
36
36
|
s.add_runtime_dependency 'rspec_junit_formatter', '>= 0.2.0'
|
37
37
|
|
38
38
|
# Development
|
39
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
39
|
+
s.add_development_dependency 'rubocop', '~> 0.49.0'
|
40
40
|
s.add_development_dependency 'rubygems-tasks', '~> 0.2.0'
|
41
41
|
s.add_development_dependency 'pry', '~> 0.10.0'
|
42
42
|
s.add_development_dependency 'cucumber', '~> 2.0'
|
@@ -1,10 +1,10 @@
|
|
1
1
|
forge "http://forge.puppetlabs.com"
|
2
|
+
#
|
3
|
+
# I want to download some modules to check if r10k feature in Onceover works correctly.
|
4
|
+
#
|
2
5
|
|
3
|
-
# Modules from the Puppet Forge
|
4
6
|
# Versions should be updated to be the latest at the time you start
|
5
|
-
|
6
|
-
#mod "puppetlabs/stdlib", '4.11.0'
|
7
|
-
#mod "puppetlabs/concat", '2.1.0'
|
7
|
+
mod "puppetlabs/stdlib", '4.11.0'
|
8
8
|
|
9
9
|
# Modules from Git
|
10
10
|
# Examples: https://github.com/puppetlabs/r10k/blob/master/doc/puppetfile.mkd#examples
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onceover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dylan Ratcliffe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -254,14 +254,14 @@ dependencies:
|
|
254
254
|
requirements:
|
255
255
|
- - "~>"
|
256
256
|
- !ruby/object:Gem::Version
|
257
|
-
version: 0.
|
257
|
+
version: 0.49.0
|
258
258
|
type: :development
|
259
259
|
prerelease: false
|
260
260
|
version_requirements: !ruby/object:Gem::Requirement
|
261
261
|
requirements:
|
262
262
|
- - "~>"
|
263
263
|
- !ruby/object:Gem::Version
|
264
|
-
version: 0.
|
264
|
+
version: 0.49.0
|
265
265
|
- !ruby/object:Gem::Dependency
|
266
266
|
name: rubygems-tasks
|
267
267
|
requirement: !ruby/object:Gem::Requirement
|
@@ -341,10 +341,13 @@ files:
|
|
341
341
|
- factsets/Windows_Server-2012r2-64.json
|
342
342
|
- factsets/solaris-10_u9-sparc-64.json
|
343
343
|
- factsets/solaris-11.2-sparc-64.json
|
344
|
-
- features/
|
344
|
+
- features/help.feature
|
345
345
|
- features/init.feature
|
346
|
-
- features/
|
346
|
+
- features/run.feature
|
347
347
|
- features/step_definitions/common.rb
|
348
|
+
- features/step_definitions/init.rb
|
349
|
+
- features/support/command_helper.rb
|
350
|
+
- features/support/controlrepo_helper.rb
|
348
351
|
- features/support/env.rb
|
349
352
|
- lib/onceover/beaker.rb
|
350
353
|
- lib/onceover/beaker/spec_helper.rb
|