Giter VIP home page Giter VIP logo

Comments (9)

MikeDombo avatar MikeDombo commented on August 13, 2024 1

Oh! Obviously you had thought of that.

Thanks

from cobertura-action.

yuvgeek avatar yuvgeek commented on August 13, 2024 1

Any update on this issue?

from cobertura-action.

hannseman avatar hannseman commented on August 13, 2024

Thanks!

Have you tried setting only_changed_files: true?

from cobertura-action.

MikeDombo avatar MikeDombo commented on August 13, 2024

Actually, I tried it, but the report has no files in it, despite the diff containing changed tests and files which those tests covered.

from cobertura-action.

Phil-Barber avatar Phil-Barber commented on August 13, 2024

Hey I noticed from a little digging that my issue here was that my coverage report was generated with source = <> config set.
This means that the filesChanged list from the report is missing the base dir from the filename property.
eg.
File is treepoints/auth/api/users.py, but in the report it is just auth/api/users.py.
Phil-Barber#1

One possible solution would be to parse the source(s) from the report xml and then explode the filepaths with the added source(s) (and maybe check to see if they exist in the repo?) so that the filtering here works correctly:
https://github.com/5monkeys/cobertura-action/blob/master/src/action.js#L85

I'd be happy to attempt a fix if you're happy with my proposal?

This also may have nothing to do with Mike's problem....

For now I've changed my coverage::run::source to use ::omit instead of source, so the report is generated from the project root

from cobertura-action.

scottrice10 avatar scottrice10 commented on August 13, 2024

Bump, if the file names returned from Github don't match with the relative file names in the covertura.xml report, this is still broken. Would be great to fix.

from cobertura-action.

kevinvalk avatar kevinvalk commented on August 13, 2024

Same here, you already have link_missing_lines_source_dir. Maybe this can be used as wel in the name matching?

from cobertura-action.

AbdelHamdi avatar AbdelHamdi commented on August 13, 2024

Is this fixed? because I am facing the same issue. The comment does not include the changed files, but a single line for all files report. @Phil-Barber could you please explain more your workaround :)

from cobertura-action.

Phil-Barber avatar Phil-Barber commented on August 13, 2024

Is this fixed? because I am facing the same issue. The comment does not include the changed files, but a single line for all files report. @Phil-Barber could you please explain more your workaround :)

It's been a while but if I recall correctly:
Using the source configuration in coverage changes the outputted filepaths to be relative to that source directory rather than to the root directory. This created a mismatch between the paths the action is checking (with the source dir prepended) and the paths in the coverage (which don't prepend the source dir).

My workaround was to use the omit configuration instead of the source option to omit everything except the source dir. This means the generated coverage report generates paths that are relative to the root dir and so this action correctly identifies them.

from cobertura-action.

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.