Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
89 changed files
with
207 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
default: | ||
startup_wait: 15 | ||
jetty_port: <%= ENV['TEST_JETTY_PORT'] || 8888 %> | ||
<%= ENV['TEST_JETTY_PATH'] ? "jetty_home: " + ENV['TEST_JETTY_PATH'] : '' %> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
platforms :jruby do | ||
gem 'jruby-openssl' | ||
gem 'activerecord-jdbcsqlite3-adapter' | ||
gem 'jdbc-sqlite3' | ||
gem 'mediashelf-loggable', '>= 0.4.8' | ||
gem 'therubyrhino' | ||
end | ||
|
||
platforms :ruby do | ||
gem 'sqlite3' | ||
gem 'execjs' | ||
gem 'therubyracer', '~> 0.10.2' | ||
end | ||
|
||
gem 'blacklight', :path => '../../' | ||
gem 'jquery-rails' | ||
|
||
# For testing | ||
group :development, :test do | ||
gem 'rspec-rails', '~> 2.12.0' | ||
end | ||
|
||
group :test do | ||
gem 'generator_spec' | ||
gem 'cucumber-rails', :require => false | ||
gem 'database_cleaner', '>= 1.0.0.RC1' | ||
if defined? :JRUBY_VERSION | ||
gem 'capybara', '~> 1.0' | ||
else | ||
gem 'capybara' | ||
end | ||
gem 'rcov', :platform => :mri_18 | ||
gem 'simplecov', :platform => :mri_19 | ||
gem 'simplecov-rcov', :platform => :mri_19 | ||
end | ||
|
||
gem 'jettywrapper', '>= 1.2.0' | ||
|
40 changes: 40 additions & 0 deletions
40
spec/test_app_templates/lib/generators/test_app_generator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
require 'rails/generators' | ||
|
||
class TestAppGenerator < Rails::Generators::Base | ||
source_root File.expand_path("../../../../test_app_templates", __FILE__) | ||
|
||
def fix_travis_rails_4 | ||
if ENV['TRAVIS'] | ||
insert_into_file 'app/assets/stylesheets/application.css', :before =>'/*' do | ||
"@charset \"UTF-8\";\n" | ||
end | ||
end | ||
end | ||
|
||
def copy_rspec_rake_task | ||
copy_file "lib/tasks/rspec.rake" | ||
end | ||
|
||
def remove_index | ||
remove_file "public/index.html" | ||
remove_file 'app/assets/images/rails.png' | ||
end | ||
|
||
def run_blacklight_generator | ||
say_status("warning", "GENERATING BL", :yellow) | ||
|
||
generate 'blacklight', '--devise' | ||
end | ||
|
||
def run_cucumber_generator | ||
say_status("warning", "GENERATING cucumber", :yellow) | ||
|
||
generate 'cucumber:install' | ||
end | ||
|
||
def run_test_support_generator | ||
say_status("warning", "GENERATING test_support", :yellow) | ||
|
||
generate 'blacklight:test_support' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'rspec/core/rake_task' | ||
desc "run the blacklight gem spec" | ||
gem_home = File.expand_path('../../../../..', __FILE__) | ||
RSpec::Core::RakeTask.new(:myspec) do |t| | ||
t.pattern = gem_home + '/spec/**/*_spec.rb' | ||
t.rspec_opts = "--colour" | ||
t.ruby_opts = "-I#{gem_home}/spec" | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v4.0.0.zip" | ||
APP_ROOT = File.expand_path("../..", __FILE__) | ||
|
||
TEST_APP_TEMPLATES = 'spec/test_app_templates' | ||
TEST_APP = 'spec/internal' | ||
|
||
require 'jettywrapper' | ||
require 'rspec/core/rake_task' | ||
|
||
|
||
task :ci => 'jetty:clean' do | ||
ENV['environment'] = "test" | ||
jetty_params = Jettywrapper.load_config | ||
jetty_params[:startup_wait]= 60 | ||
error = Jettywrapper.wrap(jetty_params) do | ||
Rake::Task["blacklight:fixtures"].invoke | ||
Rake::Task['blacklight:coverage'].invoke | ||
Rake::Task['blacklight:cucumber'].invoke | ||
end | ||
raise "test failures: #{error}" if error | ||
# Only create documentation if the tests have passed | ||
#Rake::Task["active_fedora:doc"].invoke | ||
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["blacklight:spec"].invoke | ||
end | ||
|
||
desc "Run specs" | ||
task :spec => [:generate] do |t| | ||
focused_spec = ENV['SPEC'] ? " SPEC=#{File.join(GEM_ROOT, ENV['SPEC'])}" : '' | ||
within_test_app do | ||
system "rake myspec#{focused_spec}" | ||
abort "Error running spec" unless $?.success? | ||
end | ||
end | ||
|
||
desc "Run cucumber features" | ||
task :cucumber => [:generate] do |t| | ||
within_test_app do | ||
system "rake blacklight:cucumber" | ||
abort "Error running cucumber" unless $?.success? | ||
end | ||
end | ||
|
||
|
||
desc "Clean out the test rails app" | ||
task :clean do | ||
puts "Removing sample rails app" | ||
`rm -rf #{TEST_APP}` | ||
end | ||
|
||
desc "Create the test rails app" | ||
task :generate do | ||
unless File.exists?('spec/internal/Rakefile') | ||
puts "Generating rails app" | ||
`rails new #{TEST_APP}` | ||
puts "Copying gemfile" | ||
`cat #{TEST_APP_TEMPLATES}/Gemfile.extra >> #{TEST_APP}/Gemfile` | ||
puts "Copying generator" | ||
`cp -r #{TEST_APP_TEMPLATES}/lib/generators #{TEST_APP}/lib` | ||
within_test_app do | ||
puts "Bundle install" | ||
`bundle install` | ||
puts "running test_app_generator" | ||
system "rails generate test_app" | ||
|
||
puts "running migrations" | ||
puts `rake db:migrate db:test:prepare` | ||
end | ||
end | ||
puts "Done generating test app" | ||
end | ||
|
||
|
||
|
||
end | ||
|
||
def within_test_app | ||
FileUtils.cd(TEST_APP) | ||
Bundler.with_clean_env do | ||
yield | ||
end | ||
FileUtils.cd(APP_ROOT) | ||
end |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.