johnbintz / jasmine-headless-webkit

This project is dead. You should use Karma instead. I do.
http://karma-runner.github.io/
196 stars 99 forks source link

Enhancement : Formatter options #73

Open pjfitzgibbons opened 12 years ago

pjfitzgibbons commented 12 years ago

HI,

I'd love to see rspec-style formatter options for the run-time output.

I'd even be willing to help coding this with some small direction.

Thoughts?

Peter Fitzgibbons

johnbintz commented 12 years ago

I'm reworking how formatters and output and such are being done in the give-me-file-handles branch, with the ultimate goal being that, not only can additional options be passed in, but different reporters can be used. I expect to have that branch merged in with master within this week. Once that's done, we can start looking into doing this (and I'll definitely be grateful for the help. :D )

If you have time, take a look at that other branch and make sure everything over there is working for you, and that'll help speed the process along.

johnbintz commented 12 years ago

OK, I finally got around to this and it's all merged into HEAD. You can use RSpec-like formatter options for writing to different files with different reporters:

jasmine-headless-webkit -f File:report.txt -f Tap:tap-output.txt -f Console

From that small example, you can see there are three built-in reporters:

Take it for a spin. It's still kind of young and needs more eyes on it.

bunnymatic commented 12 years ago

I noticed what seemed like sporadic success/failure with these. I'm running with the new qt 4.8.2 and your repo

Using jasmine-headless-webkit (0.9.0.rc.2) from git://github.com/johnbintz/jasmine-headless-webkit.git (at master) with native extensions 

When i get a file include list from jhw, i get the following

(512)$ be jasmine-headless-webkit -l
.../.rvm/gems/ruby-1.8.7-p334@bedsider/gems/jasmine-core-1.2.0/lib/jasmine-core/jasmine.js
.../.rvm/gems/ruby-1.8.7-p334@bedsider/gems/jasmine-core-1.2.0/lib/jasmine-core/jasmine-html.js
.../.rvm/gems/ruby-1.8.7-p334@bedsider/gems/jasmine-core-1.2.0/lib/jasmine-core/jasmine.css
.../.rvm/gems/ruby-1.8.7-p334@bedsider/bundler/gems/jasmine-headless-webkit-30e1ff8e51ad/vendor/assets/javascripts/jasmine-extensions.coffee
.../.rvm/gems/ruby-1.8.7-p334@bedsider/bundler/gems/jasmine-headless-webkit-30e1ff8e51ad/vendor/assets/javascripts/intense.coffee
.../.rvm/gems/ruby-1.8.7-p334@bedsider/bundler/gems/jasmine-headless-webkit-30e1ff8e51ad/vendor/assets/javascripts/headless_reporter_result.js
.../.rvm/gems/ruby-1.8.7-p334@bedsider/bundler/gems/jasmine-headless-webkit-30e1ff8e51ad/vendor/assets/javascripts/jasmine.HeadlessReporter.coffee
.../.rvm/gems/ruby-1.8.7-p334@bedsider/bundler/gems/jasmine-headless-webkit-30e1ff8e51ad/vendor/assets/javascripts/jasmine.HeadlessReporter.ConsoleBase.coffee
.../.rvm/gems/ruby-1.8.7-p334@bedsider/bundler/gems/jasmine-headless-webkit-30e1ff8e51ad/vendor/assets/javascripts/jsDump.js
.../.rvm/gems/ruby-1.8.7-p334@bedsider/bundler/gems/jasmine-headless-webkit-30e1ff8e51ad/vendor/assets/javascripts/beautify-html.js
/projects/...myapp/public/javascripts/jquery-1.4.4.js
/projects/...myapp/public/javascripts/jquery-ui-1.7.2.js
...

What seems odd is that in the repo (github) you clearly have other formatters under vendor/assets/javascripts/jasmine.*Reporter but non of those seemed to come down in the bundle install. Does that make any sense?

I've removed and reinstalled JHW and Jasmine a couple times with no apparent difference. And finally, I have seen verbose output, but if i run the command

bundle exec jasmine-headless-webkit --f Verbose

twice in a row, i might get verbose output once or 0 times. Tap also seemed to give me something. But less consistently.

I will also add that I have some failing tests and wonder if JS Failures from the tests are interrupting the output.

I'd appreciate any pointers.

Thanks Jon

bunnymatic commented 12 years ago

While trying to track down my errors (with no output :( ) i decided to try running things one by one. Doing that, i get some output for some specs. This makes me think that if there is a failure (which it seems there probably is with the 'null' is not an object), then the formatters just plain fail. Maybe there's not much that can be done about that.

But I thought it might be worth mentioning...

Here's the shell script:

for f in ./spec/javascripts/*_spec.js; do
  echo "Running $f"
  bundle exec jasmine-headless-webkit -f Console $f
done

and a snippet of the output

Running ./spec/javascripts/feature_admin_spec.js
TypeError: 'null' is not an object
Running ./spec/javascripts/feature_new_or_edit_spec.js
TypeError: 'null' is not an object
..............................................................................................................
PASS: 110 tests, 0 failures, 0.346 secs.

Test ordering seed: --seed 7911
Running ./spec/javascripts/feature_show_spec.js
...

But even that is not consistent. A later run, i got this:

TypeError: 'null' is not an object
Running ./spec/javascripts/feature_admin_spec.js
TypeError: 'null' is not an object
Running ./spec/javascripts/feature_new_or_edit_spec.js
TypeError: 'null' is not an object
Running ./spec/javascripts/feature_show_spec.js
TypeError: 'null' is not an object

Notice - no console output :(

johnbintz commented 12 years ago

You're right -- clearly something is dying, but the disturbing lack of backtraces in Qt WebKit makes that very very difficult to track down (amongst other problems). I wish I could be of more assistance, but other projects have been sapping my time away lately, so I can't dedicate as much to JHW as I used to. I know the Qt project was working on getting WebKit to compile with using V8 instead of JavaScriptCore, which would probably help with tracking down issues since you actually get real backtraces w/ V8. You might want to look into the state of that and see if that helps at all. I was doing that periodically a few months ago, with a tiny bit of success. Maybe it's gotten better? shrug

bunnymatic commented 12 years ago

Thanks for the heads up.

I grabbed your source code the other day and was definitely wondering "where do i hook in here to get some more information". Sounds like it may be qt. I suppose, if i was going to dedicate some opensource time, i could look that way. But i may just give a shrug and hope it comes around.

What's sad is that the tests pass in the browser, so I think we should be fine. I spent about 1 week converting our 800 specs from BlueRidge to Jasmine to take advantage of the speed of Jasmine and JHW.

Well... i guess that branch will just have to wait.

Thanks a bunch for the reply and thanks for JHW.

Cheers Jon

On Fri, May 25, 2012 at 3:42 AM, John Bintz reply@reply.github.com wrote:

You're right -- clearly something is dying, but the disturbing lack of backtraces in Qt WebKit makes that very very difficult to track down (amongst other problems). I wish I could be of more assistance, but other projects have been sapping my time away lately, so I can't dedicate as much to JHW as I used to. I know the Qt project was working on getting WebKit to compile with using V8 instead of JavaScriptCore, which would probably help with tracking down issues since you actually get real backtraces w/ V8. You might want to look into the state of that and see if that helps at all. I was doing that periodically a few months ago, with a tiny bit of success. Maybe it's gotten better? shrug


Reply to this email directly or view it on GitHub: https://github.com/johnbintz/jasmine-headless-webkit/issues/73#issuecomment-5927589

Visit http://bunnymatic.com