reagan 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/reagan.rb +2 -0
  3. data/lib/test_reagan.rb +39 -0
  4. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 595b4ab40fd53bd6edbacf0973d37684775097f0
4
- data.tar.gz: 6dc4f438d84176c5aada6fc746de42e45d3b26c4
3
+ metadata.gz: 1f8adf202a5a529b33dcd43b082bb06db72736e1
4
+ data.tar.gz: 0b4b6abb058964f5fd80486a273f01db178522e6
5
5
  SHA512:
6
- metadata.gz: ab321ce160654cd5966e23ea2823b2ab0de6c72cf62cce006cca1cba12561f28ce35344182e7f3b266dca8ac85f76f2f8b1f9dfe8ef831c87c657982c7dfeb3c
7
- data.tar.gz: 674c59378f7b64875394010b9c58c04aa2f8804d1558f145c4e43636dffb227d326176851a585ba50fe6b4caa3273237df8e9d95251238c1401a7049efb87c89
6
+ metadata.gz: c497af04ace64eaa119b66d212e1ede9a5dd3076ddcfc8960805cf4f8166a5917ee73bcb6c2b59739b32cf3fbcc2af11031fece2c967d8e872c37028acf7b6dc
7
+ data.tar.gz: c0f978a8ded444cb0d92110dee3fe832c699a4f1261a1605aff691559e6a2211676e062bd30d982f1e8f6d8a2347e29db5f819a9d9e8df581f70961fd281c65f
data/lib/reagan.rb CHANGED
@@ -22,6 +22,7 @@ class Reagan
22
22
  require 'change'
23
23
  require 'test_knife'
24
24
  require 'test_version'
25
+ require 'test_reagan'
25
26
 
26
27
  attr_accessor :config
27
28
  def initialize(options)
@@ -53,6 +54,7 @@ class Reagan
53
54
  pretty_print("Testing cookbook #{cookbook}")
54
55
  results << TestVersion.new(cookbook).test
55
56
  results << TestKnife.new(cookbook).test
57
+ results << TestReagan.new(cookbook).test
56
58
  end
57
59
 
58
60
  # if any test failed then exit 1 so jenkins can pick up the failure
@@ -0,0 +1,39 @@
1
+ # encoding: UTF-8
2
+ #
3
+ # Author:: Tim Smith (<tim@cozy.co>)
4
+ # Copyright:: Copyright (c) 2014 Tim Smith
5
+ # License:: Apache License, Version 2.0
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ # tests cookbooks using the reagan-test rake tasks
20
+ class TestReagan < Reagan
21
+ def initialize(cookbook)
22
+ @cookbook = cookbook
23
+ end
24
+
25
+ # performs knife cookbook test
26
+ # returns true if cookbook passed or false if it failed
27
+ def test
28
+ puts 'Running reagan_test Rake task:'
29
+ # run the rake task if it exists, otherwise skip
30
+ if File.exist?(File.join(@@config['jenkins']['workspace_dir'], 'cookbooks', @cookbook, 'Rakefile'))
31
+ result = system "rake #{File.join(@@config['jenkins']['workspace_dir'], 'cookbooks', @cookbook, 'Rakefile')} > /dev/null 2>&1"
32
+ puts result ? ' PASS: reagan_test Rake task was successful' : ' FAIL: reagan_test Rake task was NOT successful'
33
+ result
34
+ else
35
+ puts ' SKIP: No Rakefile found in the cookbook path. Skipping test'
36
+ end
37
+ true
38
+ end
39
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reagan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-10 00:00:00.000000000 Z
11
+ date: 2014-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -83,6 +83,7 @@ files:
83
83
  - lib/change.rb
84
84
  - lib/reagan.rb
85
85
  - lib/test_knife.rb
86
+ - lib/test_reagan.rb
86
87
  - lib/test_version.rb
87
88
  - reagan.yml.EXAMPLE
88
89
  homepage: http://www.github.com/tas50/reagan
@@ -97,7 +98,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
98
  requirements:
98
99
  - - '>='
99
100
  - !ruby/object:Gem::Version
100
- version: '0'
101
+ version: 1.9.3
101
102
  required_rubygems_version: !ruby/object:Gem::Requirement
102
103
  requirements:
103
104
  - - '>='