From fae29fd205db94e5245d2bf708033dab1d1280f8 Mon Sep 17 00:00:00 2001 From: Donnie Tognazzini Date: Fri, 12 Apr 2013 13:02:07 -0700 Subject: [PATCH 1/2] setting up selenium tests --- .travis.yml | 11 ++++++----- Rakefile | 25 +++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9df59d01..e5e77f51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,10 @@ rvm: - 1.8.7 - 1.9.3 -gemfile: - - gemfiles/3.0.gemfile - - gemfiles/3.1.gemfile - - gemfiles/3.2.gemfile +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + - bundle exec rake appraisal:install + - bundle exec rake test:integration:selenium:install -script: "bundle exec rake test:units" +script: "bundle exec rake test:integration:units test:integration:selenium" diff --git a/Rakefile b/Rakefile index dda28bff..bb952352 100644 --- a/Rakefile +++ b/Rakefile @@ -18,7 +18,24 @@ namespace :test do task :units do system("bundle exec rake -s appraisal test:units") end - + + namespace :selenium do + task :install do + for_each_directory_of('test/test_apps/[0-9]*/**/Gemfile') do |directory| + gemfile_path = File.join(directory, 'Gemfile') + appraisal = Appraisal::Appraisal.new("name", File.join(directory, 'Gemfile')) + + def appraisal.gemfile_path + @gemfile_path + end + + appraisal.instance_variable_set(:@gemfile_path, gemfile_path) + + appraisal.install + end + end + end + desc "Run selenium tests on all apps." task :selenium do if app_version = ENV['APP_VERSION'] @@ -34,9 +51,13 @@ end def run_test_in(directory, *tasks) env = "TEST=../../#{ENV['TEST']} " if ENV['TEST'] + run_in(directory, "#{env} bundle exec rake #{tasks.join(' ')}") +end + +def run_in(directory, command) puts '', directory, '' with_pruned_env('BUNDLE_GEMFILE') do - system("cd #{directory} && #{env} bundle exec rake #{tasks.join(' ')}") + system("cd #{directory} && #{command}") end end From b3c6af7a2604b8fb410b5fc4ce3238dc15d74fdd Mon Sep 17 00:00:00 2001 From: Donnie Tognazzini Date: Fri, 12 Apr 2013 14:37:25 -0700 Subject: [PATCH 2/2] removing rcov --- test/test_apps/3.0/Gemfile | 1 - test/test_apps/3.0/Gemfile.lock | 2 -- test/test_apps/3.1/Gemfile | 1 - test/test_apps/3.1/Gemfile.lock | 2 -- test/test_apps/3.2/Gemfile | 1 - test/test_apps/3.2/Gemfile.lock | 2 -- 6 files changed, 9 deletions(-) diff --git a/test/test_apps/3.0/Gemfile b/test/test_apps/3.0/Gemfile index 3f27b56c..47453dc8 100644 --- a/test/test_apps/3.0/Gemfile +++ b/test/test_apps/3.0/Gemfile @@ -7,5 +7,4 @@ gem 'jquery-rails' group :development do gem 'ae_page_objects', :path => '../../..' gem "mocha", "0.13.3", :require => false - gem "rcov", ">= 0" end diff --git a/test/test_apps/3.0/Gemfile.lock b/test/test_apps/3.0/Gemfile.lock index c366db28..6c1ef63b 100644 --- a/test/test_apps/3.0/Gemfile.lock +++ b/test/test_apps/3.0/Gemfile.lock @@ -87,7 +87,6 @@ GEM rdoc (~> 3.4) thor (~> 0.14.4) rake (10.0.4) - rcov (1.0.0) rdoc (3.12.2) json (~> 1.4) rubyzip (0.9.9) @@ -114,5 +113,4 @@ DEPENDENCIES jquery-rails mocha (= 0.13.3) rails (= 3.0.20) - rcov sqlite3 diff --git a/test/test_apps/3.1/Gemfile b/test/test_apps/3.1/Gemfile index 058c4212..3142b54e 100644 --- a/test/test_apps/3.1/Gemfile +++ b/test/test_apps/3.1/Gemfile @@ -7,5 +7,4 @@ gem 'jquery-rails' group :development do gem 'ae_page_objects', :path => '../../..' gem "mocha", "0.13.3", :require => false - gem "rcov", ">= 0" end diff --git a/test/test_apps/3.1/Gemfile.lock b/test/test_apps/3.1/Gemfile.lock index 6466509a..878c02c3 100644 --- a/test/test_apps/3.1/Gemfile.lock +++ b/test/test_apps/3.1/Gemfile.lock @@ -92,7 +92,6 @@ GEM rdoc (~> 3.4) thor (~> 0.14.6) rake (10.0.4) - rcov (1.0.0) rdoc (3.12.2) json (~> 1.4) rubyzip (0.9.9) @@ -124,5 +123,4 @@ DEPENDENCIES jquery-rails mocha (= 0.13.3) rails (= 3.1.12) - rcov sqlite3 diff --git a/test/test_apps/3.2/Gemfile b/test/test_apps/3.2/Gemfile index 948aebd7..c5cc8710 100644 --- a/test/test_apps/3.2/Gemfile +++ b/test/test_apps/3.2/Gemfile @@ -7,5 +7,4 @@ gem 'jquery-rails' group :development do gem 'ae_page_objects', :path => '../../..' gem "mocha", "0.13.3", :require => false - gem "rcov", ">= 0" end diff --git a/test/test_apps/3.2/Gemfile.lock b/test/test_apps/3.2/Gemfile.lock index 14411b5b..5157dfc4 100644 --- a/test/test_apps/3.2/Gemfile.lock +++ b/test/test_apps/3.2/Gemfile.lock @@ -90,7 +90,6 @@ GEM rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) rake (10.0.4) - rcov (1.0.0) rdoc (3.12.2) json (~> 1.4) rubyzip (0.9.9) @@ -123,5 +122,4 @@ DEPENDENCIES jquery-rails mocha (= 0.13.3) rails (= 3.2.13) - rcov sqlite3