onceover 3.0.7 → 3.0.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 +2 -2
- data/controlrepo.gemspec +1 -1
- data/lib/onceover/cli/run.rb +2 -1
- data/lib/onceover/cli/show.rb +1 -1
- data/lib/onceover/controlrepo.rb +0 -7
- data/lib/onceover/group.rb +6 -2
- data/lib/onceover/runner.rb +4 -2
- data/lib/onceover/testconfig.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b023f0f8f31431d60042f2dc223f4587a1dae757
|
4
|
+
data.tar.gz: c6d67802e4cbe23475d775494a9829a53866f202
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ad92d08ba6ab4e063283c902199bd59d453dff673bb365f735dad9793313298011fe2a9d5b60face8e3fd73eec0bde5e2f450c8414f70b3318fabacbadbf0ba
|
7
|
+
data.tar.gz: e7f1baa93bb1dc677092007d4e043b12d815447134a180b39aed8cd9a4dc22fdd0f3c97ac23e9a799d43ac8e084f007f8133706e66ca0984bdd5aa145d255e00
|
data/README.md
CHANGED
@@ -186,7 +186,7 @@ One or many tags that tests in this group should be tagged with. This allows you
|
|
186
186
|
|
187
187
|
This gem comes with a few pre-canned factsets. These are listed under the `nodes` sections of `onceover.yaml` when you run `onceover init`. You can also add your own factsets by putting them in:
|
188
188
|
|
189
|
-
`spec/factsets/*.
|
189
|
+
`spec/factsets/*.json`
|
190
190
|
|
191
191
|
Factsets are used by the controlrepo gem to generate spec tests, which compile a given class against a certain set of facts. To create these factsets all we need to do is log onto a real machine that has puppet installed and run:
|
192
192
|
|
@@ -198,7 +198,7 @@ Which will give raw json output of every fact which puppet knows about. Usually
|
|
198
198
|
|
199
199
|
Once we have our factset all we need to do is copy it into `spec/factsets/` inside our controlrepo and commit it to version control. Factsets are named based on their filename, not the name of the server they came from (Although you can, if you want). i.e the following factset file:
|
200
200
|
|
201
|
-
`spec/factsets/server2008r2.
|
201
|
+
`spec/factsets/server2008r2.json`
|
202
202
|
|
203
203
|
Would map to a node named `server2008r2` in `onceover.yaml`
|
204
204
|
|
data/controlrepo.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.0.
|
6
|
+
s.version = "3.0.8"
|
7
7
|
s.authors = ["Dylan Ratcliffe"]
|
8
8
|
s.email = ["dylan.ratcliffe@puppet.com"]
|
9
9
|
s.homepage = "https://github.com/dylanratcliffe/onceover"
|
data/lib/onceover/cli/run.rb
CHANGED
@@ -21,6 +21,7 @@ This includes deploying using r10k and running all custom tests.
|
|
21
21
|
optional :t, :tags, 'A list of tags. Only tests with these tags will be run'
|
22
22
|
optional :c, :classes, 'A list of classes. Only tests with these classes will be run'
|
23
23
|
optional :n, :nodes, 'A list of nodes. Only tests with these nodes will be run'
|
24
|
+
optional :s, :skip_r10k, 'Skip the r10k step'
|
24
25
|
|
25
26
|
run do |opts, args, cmd|
|
26
27
|
puts cmd.help(:verbose => opts[:verbose])
|
@@ -38,7 +39,7 @@ This includes deploying using r10k and running all custom tests.
|
|
38
39
|
|
39
40
|
run do |opts, args, cmd|
|
40
41
|
repo = Onceover::Controlrepo.new(opts)
|
41
|
-
runner = Onceover::Runner.new(repo,Onceover::TestConfig.new(repo.onceover_yaml,opts)
|
42
|
+
runner = Onceover::Runner.new(repo,Onceover::TestConfig.new(repo.onceover_yaml, opts), :spec)
|
42
43
|
runner.prepare!
|
43
44
|
runner.run_spec!
|
44
45
|
end
|
data/lib/onceover/cli/show.rb
CHANGED
@@ -10,7 +10,7 @@ class Onceover
|
|
10
10
|
@cmd ||= Cri::Command.define do
|
11
11
|
name 'show'
|
12
12
|
usage 'show [controlrepo|puppetfile]'
|
13
|
-
summary 'Shows the current state things'
|
13
|
+
summary 'Shows the current state of things'
|
14
14
|
description <<-DESCRIPTION
|
15
15
|
Shows the state of either the controlrepo or the Puppetfile
|
16
16
|
DESCRIPTION
|
data/lib/onceover/controlrepo.rb
CHANGED
@@ -8,13 +8,6 @@ require 'onceover/beaker'
|
|
8
8
|
require 'onceover/logger'
|
9
9
|
include Onceover::Logger
|
10
10
|
|
11
|
-
begin
|
12
|
-
require 'pry'
|
13
|
-
rescue LoadError
|
14
|
-
# We don't care if i'ts not here, this is just used for
|
15
|
-
# debugging sometimes
|
16
|
-
end
|
17
|
-
|
18
11
|
class Onceover
|
19
12
|
class Controlrepo
|
20
13
|
attr_accessor :root
|
data/lib/onceover/group.rb
CHANGED
@@ -16,12 +16,16 @@ class Onceover
|
|
16
16
|
@name = name
|
17
17
|
@members = []
|
18
18
|
|
19
|
-
|
19
|
+
case
|
20
|
+
when Onceover::Group.valid_members?(members)
|
20
21
|
# If it's already a valid list just chuck it in there
|
21
22
|
@members = members
|
22
|
-
|
23
|
+
when members.is_a?(Hash)
|
23
24
|
# if it's a hash then do subtractive stiff
|
24
25
|
@members = Onceover::Group.subtractive_to_list(members)
|
26
|
+
when members.nil?
|
27
|
+
# Support empty groups yo
|
28
|
+
@members = []
|
25
29
|
else
|
26
30
|
# Turn it into a full list
|
27
31
|
member_objects = []
|
data/lib/onceover/runner.rb
CHANGED
@@ -11,8 +11,10 @@ class Onceover
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def prepare!
|
14
|
-
|
15
|
-
|
14
|
+
unless @config.skip_r10k
|
15
|
+
# Deploy the puppetfile
|
16
|
+
@config.r10k_deploy_local(@repo)
|
17
|
+
end
|
16
18
|
|
17
19
|
# Remove the entire spec directory to make sure we have
|
18
20
|
# all the latest tests
|
data/lib/onceover/testconfig.rb
CHANGED
@@ -23,6 +23,7 @@ class Onceover
|
|
23
23
|
attr_accessor :filter_classes
|
24
24
|
attr_accessor :filter_nodes
|
25
25
|
attr_accessor :mock_functions
|
26
|
+
attr_accessor :skip_r10k
|
26
27
|
|
27
28
|
def initialize(file,opts = {})
|
28
29
|
begin
|
@@ -54,6 +55,7 @@ class Onceover
|
|
54
55
|
@filter_tags = opts[:tags] ? [opts[:tags].split(',')].flatten : nil
|
55
56
|
@filter_classes = opts[:classes] ? [opts[:classes].split(',')].flatten.map {|x| Onceover::Class.find(x)} : nil
|
56
57
|
@filter_nodes = opts[:nodes] ? [opts[:nodes].split(',')].flatten.map {|x| Onceover::Node.find(x)} : nil
|
58
|
+
@skip_r10k = opts[:skip_r10k] ? true : false
|
57
59
|
|
58
60
|
config['test_matrix'].each do |test_hash|
|
59
61
|
test_hash.each do |machines, settings|
|
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.0.
|
4
|
+
version: 3.0.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: 2016-
|
11
|
+
date: 2016-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -340,7 +340,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
340
340
|
version: '0'
|
341
341
|
requirements: []
|
342
342
|
rubyforge_project:
|
343
|
-
rubygems_version: 2.
|
343
|
+
rubygems_version: 2.5.1
|
344
344
|
signing_key:
|
345
345
|
specification_version: 4
|
346
346
|
summary: Testing tools for Puppet controlrepos
|