onceover 3.5.0 → 3.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/run.feature +6 -1
- data/onceover.gemspec +1 -1
- data/spec/fixtures/controlrepos/function_mocking/.gitignore +1 -0
- data/spec/fixtures/controlrepos/function_mocking/Gemfile +3 -0
- data/spec/fixtures/controlrepos/function_mocking/Puppetfile +17 -0
- data/spec/fixtures/controlrepos/function_mocking/Rakefile +1 -0
- data/spec/fixtures/controlrepos/function_mocking/environment.conf +2 -0
- data/spec/fixtures/controlrepos/function_mocking/manifests/site.pp +32 -0
- data/spec/fixtures/controlrepos/function_mocking/site/role/manifests/test_functions.pp +19 -0
- data/spec/fixtures/controlrepos/function_mocking/spec/onceover.yaml +43 -0
- data/templates/test_spec.rb.erb +1 -1
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d218869da68665dce739bba798cf3914955836a
|
4
|
+
data.tar.gz: a45ccdf69f2777daa95cd75d0abe23b3e5f1d898
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59bee1f0170ef794be337089b87630ba2efbb3f954eb4a7456dcd3e0673b78fc33378d27ae92365e0e3edba48989e4936fd072f6d78981472aaef4f0f66e8894
|
7
|
+
data.tar.gz: 980d4ebf61b505e48be6d9ee753906639144ef7bef2150dd8f2f114ad04a91ecc0b80173726d82c1d3bb245395c9540cc6478353554acd0639401d291c71a85b
|
data/features/run.feature
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
@run
|
2
|
-
Feature: Run rspec and acceptance test
|
2
|
+
Feature: Run rspec and acceptance test suites
|
3
3
|
Onceover should allow to run rspec and acceptance test for all profvile and role classes
|
4
4
|
or for any part of them. Use should set if he wants to see only summary of tests or full
|
5
5
|
log info.
|
@@ -41,3 +41,8 @@ Feature: Run rspec and acceptance test suits
|
|
41
41
|
And I make local modifications
|
42
42
|
And I run onceover command "run spec --force"
|
43
43
|
Then I should see message pattern "Overwriting local modifications"
|
44
|
+
|
45
|
+
Scenario: Mocking functions should work and return the correct data types
|
46
|
+
Given control repo "function_mocking"
|
47
|
+
When I run onceover command "run spec"
|
48
|
+
Then I should not see any errors
|
data/onceover.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "onceover"
|
7
|
-
s.version = "3.5.
|
7
|
+
s.version = "3.5.1"
|
8
8
|
s.authors = ["Dylan Ratcliffe"]
|
9
9
|
s.email = ["dylan.ratcliffe@puppet.com"]
|
10
10
|
s.homepage = "https://github.com/dylanratcliffe/onceover"
|
@@ -0,0 +1 @@
|
|
1
|
+
.onceover
|
@@ -0,0 +1,17 @@
|
|
1
|
+
forge "http://forge.puppetlabs.com"
|
2
|
+
#
|
3
|
+
# I want to download some modules to check if r10k feature in Onceover works correctly.
|
4
|
+
#
|
5
|
+
|
6
|
+
# Versions should be updated to be the latest at the time you start
|
7
|
+
mod "puppetlabs/stdlib", '4.11.0'
|
8
|
+
|
9
|
+
# Modules from Git
|
10
|
+
# Examples: https://github.com/puppetlabs/r10k/blob/master/doc/puppetfile.mkd#examples
|
11
|
+
mod 'apache',
|
12
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-apache',
|
13
|
+
:commit => '83401079053dca11d61945bd9beef9ecf7576cbf'
|
14
|
+
|
15
|
+
#mod 'apache',
|
16
|
+
# :git => 'https://github.com/puppetlabs/puppetlabs-apache',
|
17
|
+
# :branch => 'docs_experiment'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'onceover/rake_tasks'
|
@@ -0,0 +1,32 @@
|
|
1
|
+
## site.pp ##
|
2
|
+
|
3
|
+
# This file (/etc/puppetlabs/puppet/manifests/site.pp) is the main entry point
|
4
|
+
# used when an agent connects to a master and asks for an updated configuration.
|
5
|
+
#
|
6
|
+
# Global objects like filebuckets and resource defaults should go in this file,
|
7
|
+
# as should the default node definition. (The default node can be omitted
|
8
|
+
# if you use the console and don't define any other nodes in site.pp. See
|
9
|
+
# http://docs.puppetlabs.com/guides/language_guide.html#nodes for more on
|
10
|
+
# node definitions.)
|
11
|
+
|
12
|
+
## Active Configurations ##
|
13
|
+
|
14
|
+
# Disable filebucket by default for all File resources:
|
15
|
+
#https://docs.puppet.com/pe/2015.3/release_notes.html#filebucket-resource-no-longer-created-by-default
|
16
|
+
File { backup => false }
|
17
|
+
|
18
|
+
# DEFAULT NODE
|
19
|
+
# Node definitions in this file are merged with node data from the console. See
|
20
|
+
# http://docs.puppetlabs.com/guides/language_guide.html#nodes for more on
|
21
|
+
# node definitions.
|
22
|
+
|
23
|
+
# The default node definition matches any node lacking a more specific node
|
24
|
+
# definition. If there are no other nodes in this file, classes declared here
|
25
|
+
# will be included in every node's catalog, *in addition* to any classes
|
26
|
+
# specified in the console for that node.
|
27
|
+
|
28
|
+
node default {
|
29
|
+
# This is where you can declare classes for all nodes.
|
30
|
+
# Example:
|
31
|
+
# class { 'my_class': }
|
32
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# == Class: role::test_functions
|
2
|
+
#
|
3
|
+
class role::test_functions {
|
4
|
+
unless string('foo') =~ String {
|
5
|
+
fail('string() did not return a string')
|
6
|
+
}
|
7
|
+
unless number('foo') =~ Numeric {
|
8
|
+
fail('string() did not return a string')
|
9
|
+
}
|
10
|
+
unless boolean('foo') =~ Boolean {
|
11
|
+
fail('string() did not return a string')
|
12
|
+
}
|
13
|
+
unless array('foo') =~ Array {
|
14
|
+
fail('string() did not return a string')
|
15
|
+
}
|
16
|
+
unless hash('foo') =~ Hash {
|
17
|
+
fail('string() did not return a string')
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# Classes to be tested
|
2
|
+
classes:
|
3
|
+
- role::test_functions
|
4
|
+
|
5
|
+
# Nodes to tests classes on, this refers to a 'factset' or 'nodeset'
|
6
|
+
# depending on weather you are running 'spec' or 'acceptance' tests
|
7
|
+
nodes:
|
8
|
+
- CentOS-7.0-64
|
9
|
+
|
10
|
+
# You can group classes here to save typing
|
11
|
+
class_groups:
|
12
|
+
|
13
|
+
# You can group nodes here to save typing
|
14
|
+
# We have created a 'non_windows_nodes' group because we can't
|
15
|
+
# give you Windows vagrant boxes to test with because licensing,
|
16
|
+
# we can give you fact sets though so go crazy with spec testing!
|
17
|
+
node_groups:
|
18
|
+
|
19
|
+
test_matrix:
|
20
|
+
- all_nodes:
|
21
|
+
classes: 'all_classes'
|
22
|
+
tests: 'spec'
|
23
|
+
|
24
|
+
functions:
|
25
|
+
string:
|
26
|
+
type: rvalue
|
27
|
+
returns: string
|
28
|
+
number:
|
29
|
+
type: rvalue
|
30
|
+
returns: 400
|
31
|
+
boolean:
|
32
|
+
type: rvalue
|
33
|
+
returns: true
|
34
|
+
array:
|
35
|
+
type: rvalue
|
36
|
+
returns:
|
37
|
+
- 1
|
38
|
+
- 2
|
39
|
+
- 3
|
40
|
+
hash:
|
41
|
+
type: rvalue
|
42
|
+
returns:
|
43
|
+
foo: bar
|
data/templates/test_spec.rb.erb
CHANGED
@@ -9,7 +9,7 @@ describe "<%= cls.name %>" do
|
|
9
9
|
MockFunction.new('<%= function %>', {:type => :statement})
|
10
10
|
<% else -%>
|
11
11
|
let!(:<%= function %>) { MockFunction.new('<%= function %>') { |f|
|
12
|
-
f.stubbed.returns(<%= params['returns'] %>)
|
12
|
+
f.stubbed.returns(<%= params['returns'].inspect %>)
|
13
13
|
}
|
14
14
|
}
|
15
15
|
<% end -%>
|
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.5.
|
4
|
+
version: 3.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dylan Ratcliffe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -402,6 +402,14 @@ files:
|
|
402
402
|
- spec/fixtures/controlrepos/caching/spec/pre_conditions/README.md
|
403
403
|
- spec/fixtures/controlrepos/control_branch/Puppetfile
|
404
404
|
- spec/fixtures/controlrepos/control_branch/environment.conf
|
405
|
+
- spec/fixtures/controlrepos/function_mocking/.gitignore
|
406
|
+
- spec/fixtures/controlrepos/function_mocking/Gemfile
|
407
|
+
- spec/fixtures/controlrepos/function_mocking/Puppetfile
|
408
|
+
- spec/fixtures/controlrepos/function_mocking/Rakefile
|
409
|
+
- spec/fixtures/controlrepos/function_mocking/environment.conf
|
410
|
+
- spec/fixtures/controlrepos/function_mocking/manifests/site.pp
|
411
|
+
- spec/fixtures/controlrepos/function_mocking/site/role/manifests/test_functions.pp
|
412
|
+
- spec/fixtures/controlrepos/function_mocking/spec/onceover.yaml
|
405
413
|
- spec/fixtures/controlrepos/minimal/environment.conf
|
406
414
|
- spec/onceover/controlrepo_spec.rb
|
407
415
|
- spec/spec_helper.rb
|