-
Notifications
You must be signed in to change notification settings - Fork 144
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
Fix: Modified how classname is generated to be usable in sonar #36
Conversation
It looks like this still requires the describe statement to match the filename, e.g.: something.spec.js
results in:
Sonar looks for a file named "Something Great.js" I don't really see an easy workaround for this because jasmine doesn't report the filename. |
And nested describes like this: describe('x',function() {
it('should do something with x', function() {}
describe('y', function() {
it('should do something with y', function() {}
}
} will generate a report like this: <testsuite name="SomeTest" errors="0" failures="0" tests="2" time="....">
<testcase name="should do something with x" time="..." classname="PhantomJS_1_9_8_(Mac_OS_X).x"/>
<testcase name="should do something with y" time="..." classname="PhantomJS_1_9_8_(Mac_OS_X).x y"/>
</testsuite> |
When this pull request will be merged ? I need this in my project, but I can't merge it manually because of continuous integration which do a "npm install" on each build... Thanks |
Still hoping to get this merged... |
I created a grunt plugin which fixes this issue for sonar, by fixing the test repor. It will match each spec to the original files. Take a look at: https://github.com/mdasberg/grunt-karma-sonar |
@MoziMos sorry for the late feedback and thanks for the contribution, could you please
|
I believe it does. |
yes it does supersede that pull request. I'll add some documentation to the read me doc and update this pull request. Thanks. |
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
ping @MoziMos |
CLAs look good, thanks! |
Updated the README.md file. Please review. Thanks! |
Thanks @MoziMos, could you rebase onto the latest |
Hello done with the rebase to the latest master. |
@MoziMos still need an update to the commit message, and it seems it still won't merge cleanly, are you sure you pulled in the latest master before you rebased? |
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
CLAs look good, thanks! |
Modified how classname is generated to be usable in sonar Updated Readme.md Modified README.md Fix: Change how classname is generated to be usable in sonar Modified how classname is generated to be usable in sonar Updated Readme.md Modified README.md Removed extra semicolons and spaces Fix for additional test errors regarding semi colons
Fix: Modified how classname is generated to be usable in sonar
Thanks |
These changes will allow assigning of relative path to classnames. Relative path of the test file will be constructed using sonar.tests property and junitReporter "suite" property. I also applied the xml schema change to use this
format (from #26):
In the case below, test files are located in site-main-php/src/main/webapp/public/js/tests/models directory.
Sonar property example:
Grunt file reporters property example:
Example junit xml report: