bellows 1.0.2 → 1.0.4

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 CHANGED
@@ -1,3 +1,10 @@
1
+ * Thu Nov 17 2011 Dan Prince <dan.prince@rackspace.com> - 1.0.4
2
+ - Explicitly set config templates and tests on sync.
3
+ - All --all option to sync command. Remove 'reconfig' task.
4
+
5
+ * Thu Oct 27 2011 Dan Prince <dan.prince@rackspace.com> - 1.0.3
6
+ - Handle empty config files gracefully.
7
+
1
8
  * Thu Oct 27 2011 Dan Prince <dan.prince@rackspace.com> - 1.0.2
2
9
  - Update purge task so it purges both 'merged' and 'abandoned' branches.
3
10
 
data/README.md CHANGED
@@ -37,7 +37,6 @@ Available bellows tasks:
37
37
  bellows help [TASK] # Describe available tasks or one specific task
38
38
  bellows purge PROJECT # Purge merged reviews from SmokeStack
39
39
  bellows sync PROJECT # Create tests & update refspecs for active reviews.
40
- bellows update PROJECT # Update tests suite and configuration selections.
41
40
 
42
41
  Run bellows sync to create smokestack test configurations and update refspecs for active reviews:
43
42
 
@@ -47,9 +46,9 @@ Purge 'merged' reviews from SmokeStack:
47
46
 
48
47
  bellows purge nova
49
48
 
50
- Update the selected configuration template and test suite choices for active reviews in SmokeStack (based on the selections in your .bellows.conf file):
49
+ Sync test suite choices for active reviews in SmokeStack (based on the selections in your .bellows.conf file):
51
50
 
52
- bellows update nova
51
+ bellows sync nova --all
53
52
 
54
53
  All commands support creating and maintaining test configs for nova, glance, and keystone.
55
54
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.4
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.2"
8
+ s.version = "1.0.3"
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-10-27}
12
+ s.date = %q{2011-11-01}
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}
data/bin/bellows CHANGED
@@ -2,9 +2,10 @@
2
2
 
3
3
  require "rubygems"
4
4
  require "thor"
5
- #if not $release
6
- #$:.unshift File.dirname(__FILE__) + "/../lib"
7
- #end
5
+
6
+ # uncomment this for local testing
7
+ # $:.unshift File.dirname(__FILE__) + "/../lib"
8
+
8
9
  require "bellows"
9
10
 
10
11
  Bellows::Tasks.start
@@ -61,9 +61,9 @@ module Bellows
61
61
  post_data.store("#{base_name}[branch]", refspec)
62
62
  post_data.store("#{base_name}[merge_trunk]", "1")
63
63
  else
64
+ post_data.store("#{base_name}[merge_trunk]", "0")
64
65
  post_data.store("#{base_name}[url]", "git://github.com/openstack/#{proj}.git")
65
66
  post_data.store("#{base_name}[branch]", "master")
66
- post_data.store("#{base_name}[merge_trunk]", "0")
67
67
  end
68
68
  end
69
69
 
data/lib/bellows/tasks.rb CHANGED
@@ -9,12 +9,14 @@ module Bellows
9
9
 
10
10
  desc "sync PROJECT", "Create tests & update refspecs for active reviews."
11
11
  method_options :test => :boolean
12
+ method_options :all => :boolean
12
13
  def sync(project)
13
14
  if not ['nova', 'glance', 'keystone'].include?(project) then
14
15
  puts "ERROR: Please specify a valid project name."
15
16
  exit 1
16
17
  end
17
18
  test = options[:test]
19
+ all = options[:all]
18
20
  smoke_tests = Bellows::SmokeStack.get_smoke_tests(project)
19
21
  configs=Util.load_configs
20
22
  test_suite_ids = configs['test_suite_ids'].collect {|x| x.to_s }
@@ -33,7 +35,10 @@ module Bellows
33
35
  if smoke_test["#{project}_package_builder"]['branch'] != refspec then
34
36
  puts "Updating... " + desc
35
37
  puts "refspec: " + refspec
36
- Bellows::SmokeStack.update_smoke_test(smoke_test['id'], {"#{project}_package_builder" => { "branch" => refspec}, "description" => desc, "status" => "Updated"}) if not test
38
+ Bellows::SmokeStack.update_smoke_test(smoke_test['id'], {"#{project}_package_builder" => { "branch" => refspec}, "description" => desc, "status" => "Updated", "test_suite_ids" => test_suite_ids, "config_template_ids" => config_template_ids}) if not test
39
+ elsif all then
40
+ puts "Updating (all)... " + desc
41
+ Bellows::SmokeStack.update_smoke_test(smoke_test['id'], {"#{project}_package_builder" => { "branch" => refspec}, "description" => desc, "test_suite_ids" => test_suite_ids, "config_template_ids" => config_template_ids}) if not test
37
42
  end
38
43
  end
39
44
  end
@@ -62,27 +67,5 @@ module Bellows
62
67
  end
63
68
  end
64
69
 
65
- desc "reconfig PROJECT", "Reconfigure test suite and configuration selections."
66
- def reconfig(project)
67
- if not ['nova', 'glance', 'keystone'].include?(project) then
68
- puts "ERROR: Please specify a valid project name."
69
- exit 1
70
- end
71
- test = options[:test]
72
- smoke_tests = Bellows::SmokeStack.get_smoke_tests(project)
73
- configs=Util.load_configs
74
- test_suite_ids = configs['test_suite_ids'].collect {|x| x.to_s }
75
- config_template_ids = configs['config_template_ids'].collect {|x| x.to_s }
76
- Bellows::Gerrit.reviews(project) do |review|
77
- refspec = review['currentPatchSet']['ref']
78
- review_id = Bellows::Util.short_spec(refspec)
79
- smoke_test = smoke_tests[review_id]
80
- desc = review['owner']['name'] + ": " +review['subject']
81
- if smoke_test
82
- Bellows::SmokeStack.update_smoke_test(smoke_test['id'], {"test_suite_ids" => test_suite_ids, "config_template_ids" => config_template_ids, "description" => desc})
83
- end
84
- end
85
- end
86
-
87
70
  end
88
71
  end
data/lib/bellows/util.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'yaml'
2
- require 'socket'
3
2
 
4
3
  module Bellows
5
4
  module Util
@@ -21,7 +20,7 @@ module Bellows
21
20
  end
22
21
 
23
22
  if File.exists?(config_file) then
24
- configs=YAML.load_file(config_file)
23
+ configs = YAML.load_file(config_file) || {}
25
24
  raise_if_nil_or_empty(configs, "smokestack_url")
26
25
  raise_if_nil_or_empty(configs, "smokestack_username")
27
26
  raise_if_nil_or_empty(configs, "smokestack_password")
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: 19
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 4
10
+ version: 1.0.4
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-10-27 00:00:00 -04:00
18
+ date: 2011-11-17 00:00:00 -05:00
19
19
  default_executable: bellows
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency