From: Martyn Taylor <mtaylor(a)redhat.com>
---
src/features/support/hooks.rb | 6 ++++++
src/lib/tasks/cucumber.rake | 10 +++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/features/support/hooks.rb b/src/features/support/hooks.rb
index a00ac36..0b3d982 100644
--- a/src/features/support/hooks.rb
+++ b/src/features/support/hooks.rb
@@ -1,2 +1,8 @@
+require 'sunspot'
+
Before do
end
+
+After do
+ Sunspot.remove_all
+end
diff --git a/src/lib/tasks/cucumber.rake b/src/lib/tasks/cucumber.rake
index 453f43c..f3266b4 100644
--- a/src/lib/tasks/cucumber.rake
+++ b/src/lib/tasks/cucumber.rake
@@ -14,19 +14,19 @@ begin
require 'cucumber/rake/task'
namespace :cucumber do
- Cucumber::Rake::Task.new({:ok => ['db:test:prepare','db:seed']},
'Run features that should pass') do |t|
+ Cucumber::Rake::Task.new({:ok => [ 'db:test:prepare','db:seed',
'sunspot:solr:reindex']}, 'Run features that should pass') do |t|
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
t.fork = true # You may get faster startup if you set this to false
t.profile = 'default'
end
- Cucumber::Rake::Task.new({:wip => ['db:test:prepare','db:seed']},
'Run features that are being worked on') do |t|
+ Cucumber::Rake::Task.new({:wip => ['db:test:prepare','db:seed',
'sunspot:solr:reindex']}, 'Run features that are being worked on') do |t|
t.binary = vendored_cucumber_bin
t.fork = true # You may get faster startup if you set this to false
t.profile = 'wip'
end
- Cucumber::Rake::Task.new({:rerun =>
['db:test:prepare','db:seed']}, 'Record failing features and run only
them if any exist') do |t|
+ Cucumber::Rake::Task.new({:rerun => ['db:test:prepare','db:seed',
'sunspot:solr:reindex']}, 'Record failing features and run only them if any
exist') do |t|
t.binary = vendored_cucumber_bin
t.fork = true # You may get faster startup if you set this to false
t.profile = 'rerun'
@@ -35,6 +35,7 @@ begin
desc 'Run all features'
task :all => [:ok, :wip]
end
+
desc 'Alias for cucumber:ok'
task :cucumber => 'cucumber:ok'
@@ -66,5 +67,4 @@ begin
abort 'Cucumber rake task is not available. Be sure to install cucumber as a
gem or plugin'
end
end
-
-end
\ No newline at end of file
+end
--
1.7.4
Show replies by date
Hey Tomas,
We don't need changes to rake cucumber task anymore, should work with just the hooks.
Can you remove these changes and resend
thanks
----- Original Message -----
From: tsedovic(a)redhat.com
To: aeolus-devel(a)lists.fedorahosted.org
Cc: "Martyn Taylor" <mtaylor(a)redhat.com>
Sent: Thursday, 10 February, 2011 2:04:15 PM
Subject: [PATCH conductor] Updated rake cucumber to reindex solr
From: Martyn Taylor <mtaylor(a)redhat.com>
---
src/features/support/hooks.rb | 6 ++++++
src/lib/tasks/cucumber.rake | 10 +++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/features/support/hooks.rb b/src/features/support/hooks.rb
index a00ac36..0b3d982 100644
--- a/src/features/support/hooks.rb
+++ b/src/features/support/hooks.rb
@@ -1,2 +1,8 @@
+require 'sunspot'
+
Before do
end
+
+After do
+ Sunspot.remove_all
+end
diff --git a/src/lib/tasks/cucumber.rake b/src/lib/tasks/cucumber.rake
index 453f43c..f3266b4 100644
--- a/src/lib/tasks/cucumber.rake
+++ b/src/lib/tasks/cucumber.rake
@@ -14,19 +14,19 @@ begin
require 'cucumber/rake/task'
namespace :cucumber do
- Cucumber::Rake::Task.new({:ok => ['db:test:prepare','db:seed']},
'Run features that should pass') do |t|
+ Cucumber::Rake::Task.new({:ok => [ 'db:test:prepare','db:seed',
'sunspot:solr:reindex']}, 'Run features that should pass') do |t|
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
t.fork = true # You may get faster startup if you set this to false
t.profile = 'default'
end
- Cucumber::Rake::Task.new({:wip => ['db:test:prepare','db:seed']},
'Run features that are being worked on') do |t|
+ Cucumber::Rake::Task.new({:wip => ['db:test:prepare','db:seed',
'sunspot:solr:reindex']}, 'Run features that are being worked on') do |t|
t.binary = vendored_cucumber_bin
t.fork = true # You may get faster startup if you set this to false
t.profile = 'wip'
end
- Cucumber::Rake::Task.new({:rerun =>
['db:test:prepare','db:seed']}, 'Record failing features and run only
them if any exist') do |t|
+ Cucumber::Rake::Task.new({:rerun => ['db:test:prepare','db:seed',
'sunspot:solr:reindex']}, 'Record failing features and run only them if any
exist') do |t|
t.binary = vendored_cucumber_bin
t.fork = true # You may get faster startup if you set this to false
t.profile = 'rerun'
@@ -35,6 +35,7 @@ begin
desc 'Run all features'
task :all => [:ok, :wip]
end
+
desc 'Alias for cucumber:ok'
task :cucumber => 'cucumber:ok'
@@ -66,5 +67,4 @@ begin
abort 'Cucumber rake task is not available. Be sure to install cucumber as a
gem or plugin'
end
end
-
-end
\ No newline at end of file
+end
--
1.7.4