From 6db3647ea60c87efdc930550d8f515e57f54daff Mon Sep 17 00:00:00 2001 From: James Mason Date: Thu, 12 Oct 2017 09:13:17 -0700 Subject: [PATCH 1/3] Trying travis without sudo - should run in container --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6650fbf9..53667578 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -sudo: required +sudo: false dist: trusty language: ruby cache: bundler From 33ccef59d50f7eb809f7f917934f41f0a160fcc8 Mon Sep 17 00:00:00 2001 From: James Mason Date: Fri, 13 Oct 2017 11:32:22 -0700 Subject: [PATCH 2/3] Trying to improve Travis run times. --- config/environments/test.rb | 7 +++++++ spec/spec_helper.rb | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/config/environments/test.rb b/config/environments/test.rb index 68c74dab..7f2ca59e 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -11,6 +11,13 @@ Osem::Application.configure do config.serve_static_files = true config.static_cache_control = 'public, max-age=3600' + # Use memory store for assets cache intest to avoid caching to tmp/assets, + # because it causes hiding of deprecation messages in stylesheets, and + # reduces performance. + config.assets.configure do |env| + env.cache = ActiveSupport::Cache.lookup_store(:memory_store) + end + # Do not eager load code on boot. config.eager_load = false diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d9283117..92420826 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -59,7 +59,13 @@ RSpec.configure do |config| Capybara.javascript_driver = :poltergeist Capybara.register_driver :poltergeist do |app| - Capybara::Poltergeist::Driver.new(app, phantomjs: Phantomjs.path, js_errors: false, window_size: [1920, 1080]) + Capybara::Poltergeist::Driver.new( + app, + phantomjs: Phantomjs.path, + js_errors: false, + window_size: [1920, 1080], + url_whitelist: ['http://www.example.com'] + ) end # Includes helpers and connect them to specific types of tests From cccbdb212053116e06296a30921e870b1c09988e Mon Sep 17 00:00:00 2001 From: James Mason Date: Thu, 19 Oct 2017 12:26:53 -0700 Subject: [PATCH 3/3] Split features into separate travis job --- .travis.yml | 3 ++- travis_script.sh | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 53667578..3450ea80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,8 @@ before_script: script: - "./travis_script.sh $TEST_SUITE" env: - - TEST_SUITE=rspec - TEST_SUITE=linters + - TEST_SUITE=rspec + - TEST_SUITE=features matrix: fast_finish: true diff --git a/travis_script.sh b/travis_script.sh index 77ca2329..761de021 100755 --- a/travis_script.sh +++ b/travis_script.sh @@ -17,7 +17,10 @@ case $TEST_SUITE in bundle exec haml-lint app/views ;; rspec) - bundle exec rspec --color --format documentation + bundle exec rspec --color --format documentation --exclude-pattern "spec/features/*_spec.rb" + ;; + features) + bundle exec rspec --color --format documentation spec/features/*_spec.rb ;; *) bundle exec rubocop -Dc .rubocop.yml