Git Product home page Git Product logo

Comments (5)

mikepenz avatar mikepenz commented on July 17, 2024

@alandefreitas thank you for the report.

there seems to be a lot of different variants of test output. and normally (at least based on the reports I have) the information is on the testcase instead. See the example here: https://github.com/mikepenz/action-junit-report/blob/main/test_results/junit-web-test/expected.xml#L19-L22

Which junit export do you use? in which language? Do you have example test result output?

from action-junit-report.

alandefreitas avatar alandefreitas commented on July 17, 2024

Yes. That makes sense. I'm sure you wouldn't have used the testcase element unless it worked for most use cases or at least some relevant use case. I've been using Catch2 to generate reports. The report files are OK but it's definitely not the most common generator. (In any case, I wrote a small tool to adjust the reports so it's all fine.)

So I quickly did some independent research and found out the failure element is the one that canonically allows the file and line elements. That might be wrong at some level, but it did make a lot of sense to me since each failure can be at a different line. In fact, if I recall correctly, the code that generates the annotations is iterating the failures and not the testcases.

The current code already tries to get it from the testcase and then the testsuite. I guess the testcase is the most common place for the filename then. On the other hand, if the failure element has a filename, this is even more specific than the testcase and probably what the report means. In that case, I think I would try the attribute from failure first, then fallback to the testcase, then the testsuite, because it generalizes well to what the code already does.

from action-junit-report.

mikepenz avatar mikepenz commented on July 17, 2024

@alandefreitas thank you very much for the additional details.

It surely makes sense if it is part of some standards, and doesn't seem as it would affect current functionality either. As such it would be great to get an example export (can be greatly simplified) to add to the test-cases, as I want to make sure such cases won't break with future updates

from action-junit-report.

alandefreitas avatar alandefreitas commented on July 17, 2024

Yes. That makes sense.

Here's a very small example generated with Catch2: https://gist.github.com/alandefreitas/2c92b53acadd4af446103985c79df47b

from action-junit-report.

mikepenz avatar mikepenz commented on July 17, 2024

Thank you

from action-junit-report.

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.