This series corrects a number of issues that break rake invocation under F17. Note that the tests were completely broken prior to this; they're still completely broken after this, but they at least will run. We'll need to address that in the future.
The 'Spec' module is RSpec 1.x, which is deprecated in favor of RSpec 2.x. Also, Fedora 17 does not provide RSpec 1.x. --- Rakefile | 14 +++++++------- spec/spec_helper.rb | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/Rakefile b/Rakefile index f0bb9c5..267f11e 100644 --- a/Rakefile +++ b/Rakefile @@ -18,7 +18,7 @@ require 'rake/clean' require 'rake/rpmtask' require 'rake/yumtask' require 'rubygems' -require 'spec/rake/spectask' +require 'rspec/core/rake_task'
CURRENT_DIR = File.dirname(__FILE__) RPMBUILD_DIR = "#{File.expand_path('~')}/rpmbuild" @@ -44,18 +44,18 @@ Rake::YumTask.new(YUM_REPO) do |repo| end
desc "Run configure spec tests locally" -Spec::Rake::SpecTask.new(:configure_spec) do |t| - t.spec_files = FileList['spec/configure_spec.rb'] +RSpec::Core::RakeTask.new(:configure_spec) do |t| + t.pattern = FileList['spec/configure_spec.rb'] end
desc "Run cleanup spec tests locally" -Spec::Rake::SpecTask.new(:cleanup_spec) do |t| - t.spec_files = FileList['spec/cleanup_spec.rb'] +RSpec::Core::RakeTask.new(:cleanup_spec) do |t| + t.pattern = FileList['spec/cleanup_spec.rb'] end
desc "Run seed spec tests locally" -Spec::Rake::SpecTask.new(:seed_spec) do |t| - t.spec_files = FileList['spec/seed_data_spec.rb'] +RSpec::Core::RakeTask.new(:seed_spec) do |t| + t.pattern = FileList['spec/seed_data_spec.rb'] end
begin diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 654acce..97c196b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,8 +13,8 @@ # limitations under the License.
require 'rubygems' -require 'spec' -require 'spec/autorun' +require 'rspec' +require 'rspec/autorun'
$test_scripts = ENV['test_scripts'] $test_scripts = ($test_scripts != "false" && $test_scripts != "n")
The current directory is no longer part of LOAD_PATH in Ruby 1.9, so we must explicitly use relative paths when requiring rake helpers. --- Rakefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Rakefile b/Rakefile index 267f11e..8f699dc 100644 --- a/Rakefile +++ b/Rakefile @@ -15,8 +15,8 @@ # Aeolus Configure/Recipe Rakefile
require 'rake/clean' -require 'rake/rpmtask' -require 'rake/yumtask' +require './rake/rpmtask' +require './rake/yumtask' require 'rubygems' require 'rspec/core/rake_task'
This has been absent from conductor since 9a92b94 (condor removal). Seemingly nobody has run these tests since then... --- spec/cleanup_spec.rb | 2 -- spec/configure_spec.rb | 2 -- spec/seed_data_spec.rb | 2 -- 3 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/spec/cleanup_spec.rb b/spec/cleanup_spec.rb index 1f3f2cd..94e2f31 100644 --- a/spec/cleanup_spec.rb +++ b/spec/cleanup_spec.rb @@ -18,8 +18,6 @@ require 'nokogiri' require 'open-uri'
ENV['RAILS_ENV'] = 'production' -$: << "#{CONDUCTOR_PATH}/dutils" -require "dutils"
describe "aeolus-cleanup" do before(:all) do diff --git a/spec/configure_spec.rb b/spec/configure_spec.rb index 6658326..a33e72e 100644 --- a/spec/configure_spec.rb +++ b/spec/configure_spec.rb @@ -19,8 +19,6 @@ require 'open-uri' require 'postgres'
ENV['RAILS_ENV'] = 'production' -$: << "#{CONDUCTOR_PATH}/dutils" -require "dutils"
describe "aeolus-configure" do before(:all) do diff --git a/spec/seed_data_spec.rb b/spec/seed_data_spec.rb index c3cf775..5e7096a 100644 --- a/spec/seed_data_spec.rb +++ b/spec/seed_data_spec.rb @@ -31,8 +31,6 @@ describe "aeolus-configure seed data api" do $?.exitstatus.should == 0
ENV['RAILS_ENV'] = 'production' - $: << "#{CONDUCTOR_PATH}/dutils" - require "dutils" end
after(:each) do
'postgres' is deprecated and provided by the ruby-postgres package. 'pg' is the newer version as supplied by rubygem-pg. --- spec/configure_spec.rb | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/spec/configure_spec.rb b/spec/configure_spec.rb index a33e72e..8d204a2 100644 --- a/spec/configure_spec.rb +++ b/spec/configure_spec.rb @@ -16,7 +16,11 @@ require 'spec_helper'
require 'nokogiri' require 'open-uri' -require 'postgres' +begin + require 'pg' +rescue LoadError + require 'postgres' +end
ENV['RAILS_ENV'] = 'production'
On 05/16/2012 12:12 PM, John Eckersberg wrote:
This series corrects a number of issues that break rake invocation under F17. Note that the tests were completely broken prior to this; they're still completely broken after this, but they at least will run. We'll need to address that in the future.
Ack. I was able to build the rpm and run tests.
aeolus-devel@lists.fedorahosted.org