Comments (23)
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.
from karma-junit-reporter.
+1
from karma-junit-reporter.
+1
from karma-junit-reporter.
+1
from karma-junit-reporter.
Yes this was an oversight when I merged #36. This option should be added back in for sure. Very sorry about tha
from karma-junit-reporter.
Please checkout out #59 if that fixes the issue.
from karma-junit-reporter.
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: tests_out/junit/test-results.xml
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: tests_out/junit/PHANTOMJS_{version}/test-results.xml
from karma-junit-reporter.
@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.
from karma-junit-reporter.
@dignifiedquire is it possible in somehow have one config to force this kind of output? (like we have in v0.2.2)
Thanks
from karma-junit-reporter.
@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...)
from karma-junit-reporter.
I'm thinking... we could do like in v0.2.2 where, if we define outputFile
this will define all output path and if we define only the outputDir
this should output report per browser
well, that's my suggestion o/
What do you think? 😄
from karma-junit-reporter.
@erkobridee That makes sense (just ran into this issue as well)
Does that mean that when setting outputFile
different browser results will all be present in that single file?
from karma-junit-reporter.
@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.
from karma-junit-reporter.
@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) 😄
from karma-junit-reporter.
Agreed.
Also @erkobridee the help from the Publish JUnit test result report says
To use this feature, first set up your build to run tests, then specify the path to JUnit XML files in the Ant glob syntax, such as */build/test-reports/.xml. Be sure not to include any non-report files into this pattern. You can specify multiple patterns of files separated by commas.
So it should match any file matching that pattern, not only test-results.xml
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?
from karma-junit-reporter.
@simonvanderveldt yeap, that was what we could do in v0.2.2 <o/
from karma-junit-reporter.
@erkobridee
Wouldn't tests_out/junit/TESTS-PhantomJS*.xml
in Jenkins together with outputDir: tests_out/junit
in karma.conf.js
work in that case?
from karma-junit-reporter.
@simonvanderveldt interesting tip... I don't test this yet... o/
from karma-junit-reporter.
It looks like there were commits that fixed this issue, what is the status of this? We look forward to a patch release.
from karma-junit-reporter.
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.
from karma-junit-reporter.
suite
is option flag as well, perhaps the xml file should be prefixed with suite if suite is specified.
from karma-junit-reporter.
@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
- [GitHub] erkobridee / jenkins-ci-and-karma-junit-reporter - Example to execute Karma Runner through Jenkinks CI and load xml report file
- releases
- v0.1.0 - karma-junit-reporter v0.2.2
- on post-build action to load test report xmls :
tests_out/junit/*.xml
- on post-build action to load test report xmls :
- v0.2.0 - karma-junit-reporter v0.3.4
- on post-build action to load test report xmls :
tests_out/junit/*.xml
- on post-build action to load test report xmls :
- v0.3.0-alpha - karma-junit-reporter commit b4583b5 related to #59
- on post-build action to load test report xmls :
tests_out/junit/**/*.xml
- on post-build action to load test report xmls :
- v0.1.0 - karma-junit-reporter v0.2.2
- releases
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
from karma-junit-reporter.
@simonvanderveldt @dignifiedquire
I found the cause of duplication, see my comments for b4583b5
from karma-junit-reporter.
Related Issues (20)
- Question about CLA and License HOT 4
- License of XSD file HOT 1
- Project Lifetime HOT 2
- Readme should say to add module as a plugin in karma.conf.js HOT 1
- Where does 2.0.0 come from? HOT 1
- Testcase name must be escaped HOT 2
- Text string with emoji crashes the karma HOT 3
- npm audit vulnerability with xmlbuilder package HOT 1
- Please consider releasing a new version. HOT 1
- Suite (package) name is not prepended to the classname attribute in the testcase element
- How to give custom test suite name using karma junit reporter? HOT 2
- Replacement of Path-is-absolute dependency HOT 1
- Windows machines not reporting browser and OS HOT 2
- Warnings HOT 2
- false positive failure with junit on skipped tests
- Any word on 2.0.2
- sometimes junit-reported just doesn't generate reports HOT 11
- link at bottom of readme should point to .io
- Reestablish CI/CD with GitHub Actions
- Is the project still maintained? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karma-junit-reporter.