Skip to content

Apache Lucene open-source search software

remove temporary test data directory before running functional tests, and convert to rm_rf instead of rm_f in other places, and also set the default task to unit test instead of unit+functional tests

Erik Hatcherb9f5817c3c56
diff --git a/client/ruby/solrb/Rakefile b/client/ruby/solrb/Rakefile
index afece2b8b0d..96b5987a2a9 100644
--- a/client/ruby/solrb/Rakefile
+++ b/client/ruby/solrb/Rakefile
@@ -39,7 +39,7 @@ require 'rake/packagetask'
require 'rake/gempackagetask'
require 'test/functional/test_solr_server'
-task :default => [:test]
+task :default => [:test_units]
spec = Gem::Specification.new do |s|
s.name = 'solrb'
@@ -72,6 +72,7 @@ Rake::TestTask.new(:test_units) do |t|
t.ruby_opts = ['-r solr', '-r test/unit', '-Itest/unit']
end
+# NOTE: test_functionals does not work standalone currently. It needs the TestSolrServer wrapper in the :test task
Rake::TestTask.new(:test_functionals) do |t|
t.pattern = 'test/functional/*_test.rb'
t.verbose = true
@@ -82,6 +83,8 @@ task :test do
# unit tests don't require a solr server
Rake::Task[:test_units].invoke
+ rm_rf "test/data" # remove functional test temp data directory
+
# wrap functional tests with a test-specific Solr server
got_error = TestSolrServer.wrap(:quiet => ENV['SOLR_CONSOLE'] ? false : true) do
Rake::Task[:test_functionals].invoke
@@ -94,8 +97,8 @@ namespace :test do
desc 'Measures test coverage'
# borrowed from here: http://clarkware.com/cgi/blosxom/2007/01/05#RcovRakeTask
task :coverage do
- rm_f "coverage"
- rm_f "coverage.data"
+ rm_rf "coverage"
+ rm_rf "coverage.data"
TestSolrServer.wrap do
system("rcov --aggregate coverage.data --text-summary -Ilib:test/functional test/functional/*_test.rb")
end