Sha256: 011e9312d3f33fb7acd9cbf0edc38818e35d1192654c928f287224d949227ffe

Contents?: true

Size: 1.65 KB

Versions: 25

Compression:

Stored size: 1.65 KB

Contents

ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v4.10.4.zip"

require 'jettywrapper'
require 'engine_cart/rake_task'

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
  t.pattern =  'spec/**/*_spec.rb'
end

EngineCart.fingerprint_proc = EngineCart.rails_fingerprint_proc

desc "Run test suite"
task :ci => ['blacklight:generate', 'blacklight:clean'] do
  jetty_params = Jettywrapper.load_config('test')
  error = Jettywrapper.wrap(jetty_params) do
    Rake::Task["blacklight:fixtures"].invoke
    Rake::Task['blacklight:coverage'].invoke
  end
  raise "test failures: #{error}" if error
end

namespace :blacklight do
  desc "Load fixtures"
  task :fixtures => [:generate] do
    within_test_app do
      system "rake solr:marc:index_test_data RAILS_ENV=test"
      abort "Error running fixtures" unless $?.success?
    end
  end

  desc "Run tests with coverage"
  task :coverage do
    ENV['COVERAGE'] = 'true'
    Rake::Task["spec"].invoke
  end

  desc "Clean out the test jetty"
  task :clean => ['jetty:clean'] do
  end

  desc "Create the test rails app"
  task :generate => ['engine_cart:generate'] do
  end

  task :server do
    if File.exists? 'spec/internal'
      within_test_app do
        system "bundle update"
      end
    else
      Rake::Task['engine_cart:generate'].invoke
    end

    unless File.exists? 'jetty'
      Rake::Task['jetty:clean'].invoke
    end

    jetty_params = Jettywrapper.load_config
    jetty_params[:startup_wait]= 60

    Jettywrapper.wrap(jetty_params) do
      within_test_app do
        system "rake solr:marc:index_test_data"
        system "bundle exec rails s"
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
blacklight-5.19.2 tasks/blacklight.rake
blacklight-5.19.1 tasks/blacklight.rake
blacklight-5.19.0 tasks/blacklight.rake
blacklight-5.18.0 tasks/blacklight.rake
blacklight-5.17.2 tasks/blacklight.rake
blacklight-5.17.1 tasks/blacklight.rake
blacklight-5.17.0 tasks/blacklight.rake
blacklight-5.16.4 tasks/blacklight.rake
blacklight-5.16.3 tasks/blacklight.rake
blacklight-5.16.2 tasks/blacklight.rake
blacklight-5.16.1 tasks/blacklight.rake
blacklight-5.16.0 tasks/blacklight.rake
blacklight-5.15.0 tasks/blacklight.rake
blacklight-5.14.0 tasks/blacklight.rake
blacklight-5.13.1 tasks/blacklight.rake
blacklight-5.13.0 tasks/blacklight.rake
blacklight-5.11.3 tasks/blacklight.rake
blacklight-5.12.1 tasks/blacklight.rake
blacklight-5.12.0 tasks/blacklight.rake
blacklight-5.10.3 tasks/blacklight.rake