Запуск тестов с промежуточного сервера rails phantomjs

У меня есть приложение rails, когда я настроил пользовательский интерфейс для тестирования администратора, чтобы наша группа тестирования могла вводить критерии и запускать динамические критерии через набор тестов.

У меня есть задание cron, которое проверяет наличие тестов в очереди, ожидающих запуска, а затем запускает их по одному через капибару и полтергейст/фантомы.

Это работает на моем локальном компьютере для разработки в среде разработки, но когда я развертываю его в промежуточной среде на нашем удаленном сервере, он не находит никаких активов, то есть js, css и изображений.

Глядя на источник, похоже, что он пытается получить их от http://127.0.0.1:3000/assets, что и является проблемой.

Я попытался изменить assets_host так, чтобы он совпадал с промежуточной средой, но, похоже, не изменил его.

Может кто-нибудь помочь с этим ?

Вот мой файл env test.rb

MyApp::Application.configure do

  config.session_store :redis_store, :key => 'staging'

  # Settings specified here will take precedence over those in config/application.rb

  # The test environment is used exclusively to run your application's
  # test suite. You never need to work with it otherwise. Remember that
  # your test database is "scratch space" for the test suite and is wiped
  # and recreated between test runs. Don't rely on the data there!
  config.cache_classes = true

  # Disable Rails's static asset server (Apache or nginx will already do this)
  config.serve_static_assets = false

  # Compress JavaScripts and CSS
  config.assets.compress = true

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = true

  # Generate digests for assets URLs
  config.assets.digest = true

  # Log error messages when you accidentally call methods on nil
  #config.whiny_nils = true

  config.eager_load = false

  # Show full error reports and disable caching
  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false

  # Raise exceptions instead of rendering exception templates
  config.action_dispatch.show_exceptions = false

  # Disable request forgery protection in test environment
  config.action_controller.allow_forgery_protection    = false

  # Tell Action Mailer not to deliver emails to the real world.
  # The :test delivery method accumulates sent emails in the
  # ActionMailer::Base.deliveries array.
  config.action_mailer.delivery_method = :test

  # Raise exception on mass assignment protection for Active Record models
  config.active_record.mass_assignment_sanitizer = :strict

  # Print deprecation notices to the stderr
  config.active_support.deprecation = :stderr

  config.action_controller.asset_host = "http://dev1.domain.com/staging"
end

person Rick Moss    schedule 08.05.2014    source источник
comment
Не могли бы вы немного яснее рассказать о своей архитектуре? Когда вы развертываете свое приложение на промежуточной стадии, вы развертываете приложение с RAILS_ENV=production, но запускаете задание cron с RAILS_ENV=test или что-то еще?   -  person Dave Schweisguth    schedule 14.05.2014
comment
stackoverflow.com/questions/21045997/ связанные ?   -  person Vrashabh Irde    schedule 18.05.2014