bellows 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ * Fri Dec 23 2011 Dan Prince <dan.prince@rackspace.com> - 1.0.9
2
+ - Update the 'comment' task so that only an approved set of results generates
3
+ a gerrit comment. Successful result sets are automatically approved.
4
+ - Remove debug statement in commit task.
5
+
1
6
  * Mon Dec 12 2011 Dan Prince <dan.prince@rackspace.com> - 1.0.8
2
7
  - Update 'comment' task to display msg for test failures.
3
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.8
1
+ 1.0.9
data/bellows.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bellows}
8
- s.version = "1.0.3"
8
+ s.version = "1.0.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dan Prince"]
12
- s.date = %q{2011-11-01}
12
+ s.date = %q{2011-12-23}
13
13
  s.default_executable = %q{bellows}
14
14
  s.description = %q{CLI to drive SmokeStack test creation and maintenance based on Gerrit reviews.}
15
15
  s.email = %q{dan.prince@rackspace.com}
@@ -34,7 +34,11 @@ Gem::Specification.new do |s|
34
34
  "lib/bellows/smoke_stack.rb",
35
35
  "lib/bellows/tasks.rb",
36
36
  "lib/bellows/util.rb",
37
+ "test/fixtures/gerrit.json",
38
+ "test/fixtures/jobs.json",
39
+ "test/fixtures/nova_smoke_tests.json",
37
40
  "test/helper.rb",
41
+ "test/test_task.rb",
38
42
  "test/test_util.rb"
39
43
  ]
40
44
  s.homepage = %q{http://github.com/dprince/bellows}
@@ -52,6 +56,7 @@ Gem::Specification.new do |s|
52
56
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
53
57
  s.add_development_dependency(%q<thor>, ["~> 0.14.6"])
54
58
  s.add_development_dependency(%q<json>, ["~> 1.4.6"])
59
+ s.add_development_dependency(%q<mocha>, ["~> 0.9.9"])
55
60
  s.add_runtime_dependency(%q<json>, [">= 0"])
56
61
  s.add_runtime_dependency(%q<thor>, [">= 0"])
57
62
  else
@@ -59,6 +64,7 @@ Gem::Specification.new do |s|
59
64
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
60
65
  s.add_dependency(%q<thor>, ["~> 0.14.6"])
61
66
  s.add_dependency(%q<json>, ["~> 1.4.6"])
67
+ s.add_dependency(%q<mocha>, ["~> 0.9.9"])
62
68
  s.add_dependency(%q<json>, [">= 0"])
63
69
  s.add_dependency(%q<thor>, [">= 0"])
64
70
  end
@@ -67,6 +73,7 @@ Gem::Specification.new do |s|
67
73
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
68
74
  s.add_dependency(%q<thor>, ["~> 0.14.6"])
69
75
  s.add_dependency(%q<json>, ["~> 1.4.6"])
76
+ s.add_dependency(%q<mocha>, ["~> 0.9.9"])
70
77
  s.add_dependency(%q<json>, [">= 0"])
71
78
  s.add_dependency(%q<thor>, [">= 0"])
72
79
  end
@@ -108,5 +108,16 @@ module Bellows
108
108
 
109
109
  end
110
110
 
111
+ #returns true if jobs all passed (green) or all failed results are approved
112
+ def self.approved?(job_datas)
113
+ approved = true
114
+ job_datas.each do |data|
115
+ if data.nil? or data['status'] == 'Failed' and data['approved_by'].nil?
116
+ approved = false
117
+ end
118
+ end
119
+ approved
120
+ end
121
+
111
122
  end
112
123
  end
data/lib/bellows/tasks.rb CHANGED
@@ -140,9 +140,7 @@ module Bellows
140
140
  unit=Bellows::SmokeStack.job_data_for_type(jobs_for_rev, 'job_unit_tester')
141
141
  libvirt=Bellows::SmokeStack.job_data_for_type(jobs_for_rev, 'job_vpc')
142
142
  xenserver=Bellows::SmokeStack.job_data_for_type(jobs_for_rev, 'job_xen_hybrid')
143
- if unit and libvirt and xenserver then
144
- puts unit.inspect
145
-
143
+ if Bellows::SmokeStack.approved?([unit, libvirt, xenserver]) then
146
144
  puts "Commenting ... " + desc if not options[:quiet]
147
145
  message = "SmokeStack Results (patch set #{patchset_num}):\n"
148
146
  message += "\tUnit #{unit['status']}:#{unit['msg']} http://smokestack.openstack.org/?go=/jobs/#{unit['id']}\n"
@@ -150,7 +148,7 @@ puts unit.inspect
150
148
  message += "\tXenServer #{xenserver['status']}:#{xenserver['msg']} http://smokestack.openstack.org/?go=/jobs/#{xenserver['id']}"
151
149
  puts message
152
150
  out = Bellows::Gerrit.comment(review['currentPatchSet']['revision'], message) if not test
153
- puts out if not options[:quiet]
151
+ puts out if not options[:quiet] and not test
154
152
  file.write revision + "\n" if not test
155
153
  end
156
154
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bellows
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 8
10
- version: 1.0.8
9
+ - 9
10
+ version: 1.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dan Prince
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-12 00:00:00 -05:00
18
+ date: 2011-12-23 00:00:00 -05:00
19
19
  default_executable: bellows
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency