-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standard reporter interface #531
Comments
I reviewed Mocha's reporter interface first. Important details:
There are also two more events that relate to the
The reporter can be set by calling Mocha will only allow a single reporter. Mocha does not have an event for assertions. |
Jasmine reporters are classes that can implement up to 6 core eventing methods which will be invoked during the appropriate times:
Reporters are added via Jasmine will allow using multiple reporters simultaneously. Jasmine does not have an event for assertions. |
That is looking promising, since the overall structure in all three projects is the same. QUnit only has one level of nesting for "suites", so the common standard should include the nesting, even if we won't make use of it. The EventEmmiter style that Mocha implements and we've discussed previously (#422) seems like a good starting point. Both mocha and jasmine use "suite" for the component we call "module". That reminds me of the discussion in #190. Not that I have any interest in reopening that once more. |
Are we looking for a standard reporting interface (e.g. the EventEmitter interface, and a standardised set of event names and arguments, which HTML or CLI formatters can use to display results and indicate progress). Or for a standard test suite summary format (e.g. like a JSON variant of jUnit TestSuite XML output) that one would retrieve at once to store and display results (either all, or just the failures). I suppose both are interesting, but they're different things. I think the latter is more valuable for now (for grunt plugins and browserstack/saucelabs interpreters). The way to get that summary is probably not a big deal and can be slightly different per test framework (it's unlikely they'd factor out that one line of code to be the same between all frameworks). It'd be like |
Regarding the summary format, see also jquery/testswarm#183. |
After today's QUnit meeting, @JamesMGreene put together a proposal: https://gist.github.com/JamesMGreene/9786246 Couple of thoughts on https://gist.github.com/JamesMGreene/9786246/90f16610b02b8267d18f61b7648b6364ca84da39:
|
@Krinkle: I did some changes based on your suggestions: https://gist.github.com/leobalter/226637d148577ac9b5c3 I did some research about reserved words as well to check for irregularities, everything is ok. |
@garu is a friend who is a Perl developers used to the TAP specification. I've talked to him and he gently agreed to help prototyping the methods for the TAP output. Btw, now I also saw that we should expand the methods exportation to handle the passed data in each of the callback arguments. Probably Jasmine and Mocha are both different from QUnit too. |
Created central org and repo for discussion and prototying: https://github.com/js-reporters/js-reporters Discussions: https://github.com/js-reporters/js-reporters/issues/ Will be inviting folks from the various unit testing framework teams to join. |
Gsoc 2015 - I am interested in this project idea. but I cant understand this and how to work. Any help or references would be great. |
@asped08 you should check out https://github.com/js-reporters/js-reporters - starting with the readme there, then going into the open issues, there's plenty to read. |
Based on a discussion on IRC about "why would a reporter consume TAP?", I think there are multiple scenarios that we should at least consider. For QUnit we currently have a pretty simple model for just one abstraction layer:
Runner runs tests, reporter registers event handlers to output result, usually via HTML reporter in the browser, but could also be on CLI etc. When running tests in CI envs, the often an intermediate data format that is picked up by something else:
Here the runner could write JUnit XML to disk (that would effectively be another reporter, though), which then is picked up by a Jenkins plugin that visulizes test failures over time. Instead of xml, this could also use TAP. Instead of a Jenkins plugin, this could get visualized using a HTML reporter. In that case, we'd have TAP fed into a reporter. The jsreporter project is currently mostly about the runner interface that provides the data in the first place. That's an important aspect and worth focusing on. It would also be great to do research on other data formats and interchangable reporters (e.g. around |
Thanks for the clarification!
My point on IRC was that the TAP-Reporter would be one of the (interchangeable) reporters, as in http://mochajs.org/#tap-reporter and not directly part of the standardized interface. |
Yes, I agree, that's a better description. |
We're definitely using js-reporters as our standard reporter interface. |
We want to provide a reporter interface that we can share with other testing tools like Jasmine and Mocha, to make it easier for integration tools - like Karma, browserstack-runner, grunt plugins - to hook into QUnit and other tools. Anyone writing a new JavaScript testing tool should be encouraged to provide the same interface, making it more reasonable to support these tools.
This requires a bunch of research. So far we identified two components that need to be standardised:
done
should provide the full datastructure, other events should help to output progressRelated tickets:
The text was updated successfully, but these errors were encountered: