guard / guard-jasmine

The Swiss Army knife for automated Jasmine specs in your console.

Home Page:http://guard.github.io/guard-jasmine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

guard-jasmine failing on Travis CI

mattfield opened this issue · comments

Whilst trying in multiple configurations, guard-jasmine always returns the same error when running in Travis CI, "An error occurred: The Jasmine reporter is not available!", corresponding to this LOC.

This is happening when using the standard command in the documentation: bundle exec guard-jasmine --server-timeout=60. I've tried increasing the timeout to a high value, setting a port number rather than relying on a random default, and most else I can think of but with no success.

I had better luck using bundle exec rake jasmine:ci

@adamstrickland I've tried using the rake task too but it barfs a TypeError: can't convert nil into String. Adding the guard-jasmine command to the rake ci:travis task fails in the same way as above.

I rolled back to a "last known good" version that we've used before, version 1.15.1, and the problem is still present which makes it more likely that it might be something on the Travis CI end. I'm going to run against a clean Travis VM tomorrow to see if I can debug the issue further.

We run a rather large Jasmine spec suite multiple times a day successfully on Travis. To run the suite, we define a rake task in .travis.yml and install the latest PhantomJS manually:

language: ruby
bundler_args: --without development
rvm:
  - 2.0.0
env:
  global:
    - RAILS_ENV=test
before_install:
  - wget http://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2
  - tar -xf phantomjs-1.9.1-linux-x86_64.tar.bz2
  - sudo rm -rf /usr/local/phantomjs
  - sudo mv phantomjs-1.9.1-linux-x86_64 /usr/local/phantomjs
before_script:
  - rake db:create db:migrate
script: 'rake travis'

The travis task just runs RSpec and Guard::Jasmine:

desc 'Run all test'
task travis: [:spec, 'guard:jasmine']

and the Jasmine task is as follows:

begin

  require 'guard/jasmine/task'

  Guard::JasmineTask.new do |task|
    task.options = '-e test --specdoc failure --verbose true'
  end

rescue LoadError
  # Ignore task on production and asset environment
end

Travis has very slow IO, so depending on your asset size, compilation might take more than 60 seconds and you might want to try to increase the server timeout to 120 seconds (60 seconds is the default).

I've tried running increasing the timeout to 180 seconds to try and give as
much time as possible but I haven't tried defining a rake task in the YML
file. Installing latest phantomjs sounds like a good idea.

I'm going to be running against a clean Travis VM this morning to try and
isolate the issue. I'm becoming more convinced that there's something funny
going on with Travis rather that guard-jasmine.

On Friday, July 5, 2013, Michael Kessler wrote:

We run a rather large Jasmine spec suite multiple times a day successfully
on Travis. To run the suite, we define a rake task in .travis.yml and
install the latest PhantomJS manually:

language: rubybundler_args: --without developmentrvm:

  • 2.0.0env:
    global:
- RAILS_ENV=testbefore_install:

The travis task just runs RSpec and Guard::Jasmine:

desc 'Run all test'task travis: [:spec, 'guard:jasmine']

and the Jasmine task is as follows:

begin

require 'guard/jasmine/task'

Guard::JasmineTask.new do |task|
task.options = '-e test --specdoc failure --verbose true'
end
rescue LoadError

Ignore task on production and asset environmentend

Travis has very slow IO, so depending on your asset size, compilation
might take more than 60 seconds and you might want to try to increase the
server timeout to 120 seconds (60 seconds is the default).


Reply to this email directly or view it on GitHubhttps://github.com//issues/136#issuecomment-20502649
.

I'm closing this for now, since I see on other projects that guard-jasmine runs fine on Travis. Please reopen if you need more assistance...