-
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
outputFile dropped in v0.3.4 - related to Jenkins CI integration #58
Comments
Yeah, the support for this seems to have been removed in 0.3.4: https://github.com/karma-runner/karma-junit-reporter/pull/36/files#diff-168726dbe96b3ce427e7fedce31bb0bcR40 (Also, even if you were only using outputDir, the format of the output file name changed, which caused us a surprise this morning) It is still documented though, so should really either add it back or add a note that to the changelog that it is no longer supported. |
+1 |
2 similar comments
+1 |
+1 |
Yes this was an oversight when I merged #36. This option should be added back in for sure. Very sorry about tha |
Please checkout out #59 if that fixes the issue. |
hi @dignifiedquire thanks reading the new code, will fix partially... because of lines 44 and 46. Why we need output the browser name? 😃 (I use this config for CI flow, that will be executed by Jenkins CI) ps.: in v0.2.2 we can define all output path, so if I define the config: ...
// https://karma-runner.github.io/0.12/plus/jenkins.html
// https://github.com/karma-runner/karma-junit-reporter/tree/v0.2.2
junitReporter: {
outputFile: 'tests_out/junit/test-results.xml'
},
... this will generate the exactly output in the config: but with the proposed change if I config: ...
// https://karma-runner.github.io/0.13/plus/jenkins.html
// https://github.com/karma-runner/karma-junit-reporter/tree/fix-output-file
junitReporter: {
outputDir: 'tests_out/junit',
outputFile: 'test-results.xml'
},
... and for example choose the PhantomJS browser to run tests, this will generate: |
@erkobridee the issue is that when there are multiple browsers we need a way to distinguish different test reports, and your config file does not know anything about that. So we need to either add the browser name as a directory or to the file name. |
@dignifiedquire is it possible in somehow have one config to force this kind of output? (like we have in v0.2.2) Thanks |
@erkobridee agreed; it seems like anything after v0.2.2 breaks Jenkins integration because it won't know where to expect the file. I wonder if we need to fork junit-reporter into jenkins-reporter to restore this. (Actually I think someone has already done that...) |
I'm thinking... we could do like in v0.2.2 where, if we define well, that's my suggestion o/ What do you think? 😄 |
@erkobridee That makes sense (just ran into this issue as well) |
@simonvanderveldt I think the problem is trying to satisfy two different use cases. On one hand, a jUnit style reporter should be able to generate reports for each browser. However, for Jenkins integration, we (likely) just need the results of a Phantom (or other headless) test where we expect the results to always be in the same place. |
@simonvanderveldt like @evandavis said, when we thinking and integrating with Jenkins CI we expect only 1 file to be read by Jenkins CI (in CI server normally we have one linux serve without UI and we put tests with karma to run only in PhantomJS, so we are running Unit Tests I don't expect any weird behavior to execute javascript among each browser) 😄 |
Agreed. Also @erkobridee the help from the Publish JUnit test result report says
So it should match any file matching that pattern, not only But I guess you mean that you want to point it to 1 specific file which you know for sure contains the correct (in your case PhantomJS) results? |
@simonvanderveldt yeap, that was what we could do in v0.2.2 <o/ |
@erkobridee |
@simonvanderveldt interesting tip... I don't test this yet... o/ |
It looks like there were commits that fixed this issue, what is the status of this? We look forward to a patch release. |
I can understand that you need a predefined location, but the reporter will not know this, and if there are multiple browser reports written and we do not distinguish them they will overwrite each other which is really not a desired behaviour. One thing that would be possible is to not nest the folders, but instead allow a template string, so you could write: outputFile: 'results-${browser}.xml'
// or if you want to risk overwriting
outputFile: 'results.xml' But please first explore if the tip from @simonvanderveldt using a glob in Jenkins solves the issue. |
|
- karma-junit-reporter #59 karma-runner/karma-junit-reporter#59 - related to #58 karma-runner/karma-junit-reporter#58
@simonvanderveldt I test you suggestion and works fine 😄 well the actual "big" issue today is the Jenkins CI integration doc on Karma Runner v0.13 page is outdated... so I write one little project to make some tests... and doc how to config Jenkins CI correctly
one weird thing I saw... loading xml generate from v0.2.2 show only one entry and load xml generate from v0.3.4 and the commit from #59 generate 2 entries with copy: @dignifiedquire |
@simonvanderveldt @dignifiedquire |
Reading the Karma Runner v0.13 doc to integrate with Jenkins CI, there indicates to use
outputFile
But in the last version (0.3.4 index.js) I don't found this support in the code, until 0.3.3 in the index.js was loaded in line 10 and used inside writeXmlForBrowser function
for now to generate report to Jenkins CI I'm using v0.2.2 and Jenkins CI config from Karma Runner v0.12
The text was updated successfully, but these errors were encountered: