bellows 1.1.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +6 -0
- data/LICENSE.txt +1 -1
- data/README.md +14 -10
- data/VERSION +1 -1
- data/lib/bellows/smoke_stack.rb +21 -12
- data/lib/bellows/tasks.rb +7 -6
- data/lib/bellows/util.rb +1 -1
- data/test/fixtures/config.yaml +3 -1
- data/test/fixtures/config_custom_project.yaml +3 -1
- data/test/test_smoke_stack.rb +20 -16
- metadata +3 -3
data/CHANGELOG
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
* Sat Nov 3 2012 Dan Prince <dprince@redhat.com> - 1.2.0
|
2
|
+
- Rename 'job_types' to 'comment_configs' in the config file.
|
3
|
+
- Add 'config_template_id' to 'comment_configs' sections. This
|
4
|
+
supports the ability to report comments when the same runner
|
5
|
+
is used w/ multiple SmokeStack configurations.
|
6
|
+
|
1
7
|
* Sun Sep 23 2012 Dan Prince <dprince@redhat.com> - 1.1.3
|
2
8
|
- Add support for per project job types in the config file.
|
3
9
|
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -26,18 +26,20 @@ Installation
|
|
26
26
|
test_suite_ids:
|
27
27
|
- 1
|
28
28
|
|
29
|
-
|
29
|
+
comment_configs:
|
30
30
|
- name: job_unit_tester
|
31
31
|
auto_approved: Yes
|
32
32
|
description: "Unit"
|
33
33
|
|
34
|
-
- name:
|
34
|
+
- name: job_puppet_libvirt
|
35
|
+
config_template_id: 1
|
35
36
|
auto_approved: No
|
36
|
-
description: "Libvirt
|
37
|
+
description: "Fedora 17 Libvirt Quantum w/ OpenvSwitch"
|
37
38
|
|
38
|
-
- name:
|
39
|
+
- name: job_puppet_xen
|
40
|
+
config_template_id: 2
|
39
41
|
auto_approved: No
|
40
|
-
description: "
|
42
|
+
description: "Fedora 17 Nova w/ XenServer"
|
41
43
|
EOF_CAT
|
42
44
|
|
43
45
|
|
@@ -47,10 +49,12 @@ Examples
|
|
47
49
|
Available bellows tasks:
|
48
50
|
|
49
51
|
Tasks:
|
50
|
-
bellows
|
51
|
-
bellows
|
52
|
-
bellows
|
53
|
-
bellows
|
52
|
+
bellows comment PROJECT # Add gerrit comments for reviews w/ results.
|
53
|
+
bellows fire PROJECT # Run jobs for reviews without results.
|
54
|
+
bellows help [TASK] # Describe available tasks or one specific task
|
55
|
+
bellows purge PROJECT # Purge merged reviews from SmokeStack
|
56
|
+
bellows stream # Stream Gerrit events and sync data to SmokeStack.
|
57
|
+
bellows sync PROJECT # Create tests & update refspecs for active reviews.
|
54
58
|
|
55
59
|
Run bellows sync to create smokestack test configurations and update refspecs for active reviews:
|
56
60
|
|
@@ -72,4 +76,4 @@ All commands support creating and maintaining test configs for nova, glance, and
|
|
72
76
|
|
73
77
|
License
|
74
78
|
-------
|
75
|
-
Copyright (c) 2011 Dan Prince. See LICENSE.txt for further details.
|
79
|
+
Copyright (c) 2011-2012 Dan Prince. Copyright 2012 Red Hat Inc. See LICENSE.txt for further details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.2.0
|
data/lib/bellows/smoke_stack.rb
CHANGED
@@ -26,33 +26,42 @@ module Bellows
|
|
26
26
|
jobs_found
|
27
27
|
end
|
28
28
|
|
29
|
-
#Return a reference to the first job
|
30
|
-
|
29
|
+
# Return a reference to the first job matching the criteria for
|
30
|
+
# the specified comment config
|
31
|
+
def self.job_data_for_comments(jobs, comment_config)
|
31
32
|
jobs.each do |job|
|
32
|
-
|
33
|
+
if job.keys[0] == comment_config['name']
|
34
|
+
job_values = job.values[0]
|
35
|
+
if comment_config['config_template_id'].nil? and job.keys[0] == 'job_unit_tester' then
|
36
|
+
# will be nil for unit tests (which don't use a config template)
|
37
|
+
return job_values
|
38
|
+
elsif comment_config['config_template_id'] and job_values['config_template_id'] == comment_config['config_template_id'] then
|
39
|
+
return job_values
|
40
|
+
end
|
41
|
+
end
|
33
42
|
end
|
34
43
|
nil
|
35
44
|
end
|
36
45
|
|
37
|
-
|
38
|
-
def self.
|
46
|
+
DEFAULT_COMMENT_CONFIGS=[{'name' => 'job_unit_tester', 'auto_approved' => false, 'description' => 'Unit'}]
|
47
|
+
def self.comment_configs(project=nil)
|
39
48
|
configs=Util.load_configs
|
40
49
|
|
41
|
-
|
50
|
+
comment_config_list = nil
|
42
51
|
|
43
52
|
if not project.nil? and configs[project] then
|
44
|
-
if configs[project]['
|
45
|
-
|
53
|
+
if configs[project]['comment_configs']
|
54
|
+
comment_config_list = configs[project]['comment_configs']
|
46
55
|
end
|
47
56
|
else
|
48
|
-
|
57
|
+
comment_config_list = configs['comment_configs']
|
49
58
|
end
|
50
59
|
|
51
|
-
if
|
52
|
-
|
60
|
+
if comment_config_list.nil? or comment_config_list.empty? then
|
61
|
+
comment_config_list = DEFAULT_COMMENT_CONFIGS
|
53
62
|
end
|
54
63
|
|
55
|
-
|
64
|
+
comment_config_list
|
56
65
|
|
57
66
|
end
|
58
67
|
|
data/lib/bellows/tasks.rb
CHANGED
@@ -128,6 +128,7 @@ module Bellows
|
|
128
128
|
test = options[:test]
|
129
129
|
cache_file = options[:cache_file]
|
130
130
|
jobs = Bellows::SmokeStack.jobs
|
131
|
+
configs=Util.load_configs
|
131
132
|
|
132
133
|
if cache_file.nil? or cache_file.empty?
|
133
134
|
puts "ERROR: cache_file is required."
|
@@ -152,11 +153,11 @@ module Bellows
|
|
152
153
|
jobs_for_rev = Bellows::SmokeStack.jobs_with_hash(revision, jobs)
|
153
154
|
if jobs_for_rev.count > 0 then
|
154
155
|
|
155
|
-
|
156
|
+
comment_configs = Bellows::SmokeStack.comment_configs(project)
|
156
157
|
job_datas = []
|
157
|
-
|
158
|
-
job_data=Bellows::SmokeStack.
|
159
|
-
job_datas << [
|
158
|
+
comment_configs.each do |comment_config|
|
159
|
+
job_data=Bellows::SmokeStack.job_data_for_comments(jobs_for_rev, comment_config)
|
160
|
+
job_datas << [comment_config, job_data]
|
160
161
|
end
|
161
162
|
|
162
163
|
if Bellows::SmokeStack.complete?(job_datas) then
|
@@ -164,9 +165,9 @@ module Bellows
|
|
164
165
|
message = "SmokeStack Results (patch set #{patchset_num}):\n"
|
165
166
|
verify_vote = 1
|
166
167
|
job_datas.each do |arr|
|
167
|
-
|
168
|
+
comment_config = arr[0]
|
168
169
|
job_data = arr[1]
|
169
|
-
message += "\t#{
|
170
|
+
message += "\t#{comment_config['description']} #{job_data['status']}:#{job_data['msg']} #{configs['smokestack_url']}/?go=/jobs/#{job_data['id']}\n"
|
170
171
|
verify_vote = -1 if job_data['status'] == 'Failed'
|
171
172
|
end
|
172
173
|
puts message if not options[:quiet]
|
data/lib/bellows/util.rb
CHANGED
data/test/fixtures/config.yaml
CHANGED
@@ -9,15 +9,17 @@ config_template_ids:
|
|
9
9
|
test_suite_ids:
|
10
10
|
- 1
|
11
11
|
|
12
|
-
|
12
|
+
comment_configs:
|
13
13
|
- name: job_unit_tester
|
14
14
|
auto_approved: true
|
15
15
|
description: "Unit"
|
16
16
|
|
17
17
|
- name: job_puppet_vpc
|
18
|
+
config_template_id: 1
|
18
19
|
auto_approved: false
|
19
20
|
description: "Libvirt (Fedora 16)"
|
20
21
|
|
21
22
|
- name: job_chef_vpc_xen
|
23
|
+
config_template_id: 2
|
22
24
|
auto_approved: false
|
23
25
|
description: "XenServer 5.6 SP2"
|
@@ -18,15 +18,17 @@ glance:
|
|
18
18
|
- 2
|
19
19
|
|
20
20
|
nova:
|
21
|
-
|
21
|
+
comment_configs:
|
22
22
|
- name: job_unit_tester
|
23
23
|
auto_approved: true
|
24
24
|
description: "Unit"
|
25
25
|
|
26
26
|
- name: job_puppet_vpc
|
27
|
+
config_template_id: 3
|
27
28
|
auto_approved: false
|
28
29
|
description: "Libvirt (Fedora 16)"
|
29
30
|
|
30
31
|
- name: job_chef_vpc_xen
|
32
|
+
config_template_id: 4
|
31
33
|
auto_approved: false
|
32
34
|
description: "XenServer 5.6 SP2"
|
data/test/test_smoke_stack.rb
CHANGED
@@ -4,28 +4,30 @@ require 'yaml'
|
|
4
4
|
|
5
5
|
class SmokeStackTest < Test::Unit::TestCase
|
6
6
|
|
7
|
-
def
|
7
|
+
def test_comment_configs_default
|
8
8
|
|
9
9
|
Bellows::Util.stubs(:load_configs).returns({})
|
10
|
-
assert_equal 1, Bellows::SmokeStack.
|
10
|
+
assert_equal 1, Bellows::SmokeStack.comment_configs.size
|
11
11
|
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
14
|
+
def test_comment_configs_config
|
15
15
|
|
16
16
|
sample_config = fixture('config.yaml')
|
17
17
|
Bellows::Util.stubs(:load_configs).returns(YAML::load(sample_config))
|
18
|
-
assert_equal 3, Bellows::SmokeStack.
|
18
|
+
assert_equal 3, Bellows::SmokeStack.comment_configs.size
|
19
19
|
|
20
|
-
unit_tester_type = Bellows::SmokeStack.
|
20
|
+
unit_tester_type = Bellows::SmokeStack.comment_configs[0]
|
21
21
|
assert_equal 'job_unit_tester', unit_tester_type['name']
|
22
22
|
assert_equal 'Unit', unit_tester_type['description']
|
23
|
+
assert_nil unit_tester_type['config_template_id']
|
23
24
|
assert_equal true, unit_tester_type['auto_approved']
|
24
25
|
|
25
|
-
|
26
|
-
assert_equal 'job_puppet_vpc',
|
27
|
-
assert_equal
|
28
|
-
assert_equal
|
26
|
+
puppet_vpc_type = Bellows::SmokeStack.comment_configs[1]
|
27
|
+
assert_equal 'job_puppet_vpc', puppet_vpc_type['name']
|
28
|
+
assert_equal 1, puppet_vpc_type['config_template_id']
|
29
|
+
assert_equal 'Libvirt (Fedora 16)', puppet_vpc_type['description']
|
30
|
+
assert_equal false, puppet_vpc_type['auto_approved']
|
29
31
|
|
30
32
|
end
|
31
33
|
|
@@ -35,21 +37,23 @@ class SmokeStackTest < Test::Unit::TestCase
|
|
35
37
|
Bellows::Util.stubs(:load_configs).returns(YAML::load(sample_config))
|
36
38
|
|
37
39
|
# there should only be 1 set for the default (no project)
|
38
|
-
assert_equal 1, Bellows::SmokeStack.
|
40
|
+
assert_equal 1, Bellows::SmokeStack.comment_configs.size
|
39
41
|
|
40
42
|
# there should only be 1 set for the glance project
|
41
|
-
assert_equal 1, Bellows::SmokeStack.
|
43
|
+
assert_equal 1, Bellows::SmokeStack.comment_configs("glance").size
|
42
44
|
|
43
45
|
# the nova project should have custom job types defined
|
44
|
-
unit_tester_type = Bellows::SmokeStack.
|
46
|
+
unit_tester_type = Bellows::SmokeStack.comment_configs("nova")[0]
|
45
47
|
assert_equal 'job_unit_tester', unit_tester_type['name']
|
46
48
|
assert_equal 'Unit', unit_tester_type['description']
|
49
|
+
assert_nil unit_tester_type['config_template_id']
|
47
50
|
assert_equal true, unit_tester_type['auto_approved']
|
48
51
|
|
49
|
-
|
50
|
-
assert_equal 'job_puppet_vpc',
|
51
|
-
assert_equal
|
52
|
-
assert_equal
|
52
|
+
puppet_vpc_type = Bellows::SmokeStack.comment_configs("nova")[1]
|
53
|
+
assert_equal 'job_puppet_vpc', puppet_vpc_type['name']
|
54
|
+
assert_equal 3, puppet_vpc_type['config_template_id']
|
55
|
+
assert_equal 'Libvirt (Fedora 16)', puppet_vpc_type['description']
|
56
|
+
assert_equal false, puppet_vpc_type['auto_approved']
|
53
57
|
|
54
58
|
end
|
55
59
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bellows
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -173,7 +173,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
173
173
|
version: '0'
|
174
174
|
segments:
|
175
175
|
- 0
|
176
|
-
hash:
|
176
|
+
hash: 2150126569573728096
|
177
177
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
178
|
none: false
|
179
179
|
requirements:
|