Coder Social home page Coder Social logo

Comments (23)

tonyfinn avatar tonyfinn commented on July 19, 2024

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.

mpellerin42 avatar mpellerin42 commented on July 19, 2024

+1

from karma-junit-reporter.

evandavis avatar evandavis commented on July 19, 2024

+1

from karma-junit-reporter.

leigh-mckenzie-pi avatar leigh-mckenzie-pi commented on July 19, 2024

+1

from karma-junit-reporter.

dignifiedquire avatar dignifiedquire commented on July 19, 2024

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.

dignifiedquire avatar dignifiedquire commented on July 19, 2024

Please checkout out #59 if that fixes the issue.

from karma-junit-reporter.

erkobridee avatar erkobridee commented on July 19, 2024

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.

dignifiedquire avatar dignifiedquire commented on July 19, 2024

@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.

erkobridee avatar erkobridee commented on July 19, 2024

@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.

evandavis avatar evandavis commented on July 19, 2024

@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.

erkobridee avatar erkobridee commented on July 19, 2024

@evandavis @dignifiedquire

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.

simonvanderveldt avatar simonvanderveldt commented on July 19, 2024

@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.

evandavis avatar evandavis commented on July 19, 2024

@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.

erkobridee avatar erkobridee commented on July 19, 2024

@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.

simonvanderveldt avatar simonvanderveldt commented on July 19, 2024

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.

erkobridee avatar erkobridee commented on July 19, 2024

@simonvanderveldt yeap, that was what we could do in v0.2.2 <o/

from karma-junit-reporter.

simonvanderveldt avatar simonvanderveldt commented on July 19, 2024

@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.

erkobridee avatar erkobridee commented on July 19, 2024

@simonvanderveldt interesting tip... I don't test this yet... o/

from karma-junit-reporter.

TheSavior avatar TheSavior commented on July 19, 2024

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.

dignifiedquire avatar dignifiedquire commented on July 19, 2024

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.

TheSavior avatar TheSavior commented on July 19, 2024

suite is option flag as well, perhaps the xml file should be prefixed with suite if suite is specified.

from karma-junit-reporter.

erkobridee avatar erkobridee commented on July 19, 2024

@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
      • v0.2.0 - karma-junit-reporter v0.3.4
        • on post-build action to load test report xmls : tests_out/junit/*.xml
      • 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

one weird thing I saw...

loading xml generate from v0.2.2 show only one entry
tests_result_v0 2 2

and load xml generate from v0.3.4 and the commit from #59 generate 2 entries
tests_result_v0 3 4

with copy: @dignifiedquire

from karma-junit-reporter.

aindlq avatar aindlq commented on July 19, 2024

@simonvanderveldt @dignifiedquire
I found the cause of duplication, see my comments for b4583b5

from karma-junit-reporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.