jasmine / jasmine-gem

Jasmine ruby gem
682 stars 275 forks source link

rake jasmine:ci no longer defines RSpec examples #163

Closed zephyr-dev closed 11 years ago

zephyr-dev commented 11 years ago

We are using 56ca703 of jasmine-gem with 18c3056 of jasmine (core) with our Rails 4 application.

Jasmine reports failures, and we see them in the output, but they do not get propagated to the RSpec layer, which always reports zero failures out of zero examples.

We noticed that this commit stops calling into RspecFormatter: cdcb1a9

And that this commit removes RspecFormatter entirely: 2b240c4

When we run rake jasmine:ci in our Rails project, we get this output:

$ rake jasmine:ci
/Users/gust/.rvm/rubies/ruby-2.0.0-p0/bin/ruby -S rspec /Users/gust/workspace/jasmine-gem/lib/jasmine/run_specs.rb --colour --format progress -r /Users/gust/workspace/sirocco/config/environment
[2013-07-24 12:05:28] INFO  WEBrick 1.3.1
[2013-07-24 12:05:28] INFO  ruby 2.0.0 (2013-02-24) [x86_64-darwin12.3.0]
[2013-07-24 12:05:28] INFO  WEBrick::HTTPServer#start: pid=97639 port=61237
Waiting for jasmine server on 61237...
jasmine server started.
Waiting for suite to finish in browser ...
          HomeController .logIn for a successful login fetches the user for the loginForm's email and password.

          Expected { email : 'user@example.com' } to equal { email : 'user@example.com2' }.
          stack@http://localhost:61237/__jasmine__/jasmine.js:1219
buildExpectationResult@http://localhost:61237/__jasmine__/jasmine.js:1196
Env/expectationResultFactory@http://localhost:61237/__jasmine__/jasmine.js:435
Spec.prototype.addExpectationResult@http://localhost:61237/__jasmine__/jasmine.js:252
addExpectationResult@http://localhost:61237/__jasmine__/jasmine.js:393
Expectation.prototype.wrapCompare/<@http://localhost:61237/__jasmine__/jasmine.js:1142
@http://localhost:61237/__spec__/controllers/home_controller_spec.js:22
4 specs, 1 failure
No examples found.

Finished in 0.00008 seconds
0 examples, 0 failures
[2013-07-24 12:05:29] INFO  going to shutdown ...
[2013-07-24 12:05:29] INFO  WEBrick::HTTPServer#start done.

What are the plans for rake jasmine:ci? For now, it doesn't return a useful status code.

jboyens commented 11 years ago

We are in the process of removing dependencies from the Jasmine gem. RSpec is one of those dependencies.

For CI, you'll probably want to use the JUnit XML Formatter we added.

ragaskar commented 11 years ago

To be clear, it's intended that rake jasmine:ci returns a proper exit code, it's just that we'll no longer depend on rspec to help us generate that code. We have a bug for this issue here: https://www.pivotaltracker.com/story/show/54005119.

In the meantime, if you need Jenkins or Teamcity to fail, as JR suggests it sounds like you can configure jasmine to use the JUnit XML formatter by updating your jasmine_helper.rb such that it reads:

Jasmine.configure do |config|
 config.formatters = [Jasmine::Formatters::JUnitXml]
end

Local rake tasks won't return proper exit codes until the bug is fixed.