Skip to content

Unable to change paths in cobertura report #413

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

Closed
EricStG opened this issue May 17, 2019 · 9 comments · Fixed by #661
Closed

Unable to change paths in cobertura report #413

EricStG opened this issue May 17, 2019 · 9 comments · Fixed by #661
Assignees
Labels
enhancement General enhancement request feature-request New feature request tenet-reporters Issue related to coverage output files(reporters) up-for-grabs Good issue for contributors

Comments

@EricStG
Copy link
Contributor

EricStG commented May 17, 2019

Getting an issue where our application is compiled within docker and we're trying to export the cobertura xml file from it.

Since the filename attribute is the full path to the file, we need to do a search a replace.

Adding the root of the project to sources/source and using relative paths for filename, it would be a lot easier to manager.

@sasivishnu
Copy link
Contributor

I agree, this will be nice enhancement. Instead of doing only for cobertura format, It will be good to do for all other format's except Team City. We can add one more options, --format --relative-code-path

@MarcoRossignoli
Copy link
Collaborator

could be similar to #408?
and #408 (comment) could fix?

@MarcoRossignoli MarcoRossignoli added the needs more info More details are needed label May 19, 2019
@sasivishnu
Copy link
Contributor

sasivishnu commented May 20, 2019

I don't think so. Its different.

Seems like Coverlet was using relative path earlier but @tonerdo changed it.
#295 (Comment)

This happens because I switched to using absolute paths. #356 re-includes the source element

I think, change was done as part of #260
de558c5?diff=unified

There is an open issue for similar request in Icov Format, #263

@MarcoRossignoli MarcoRossignoli added enhancement General enhancement request and removed needs more info More details are needed labels May 21, 2019
@viceice
Copy link
Contributor

viceice commented May 21, 2019

jenkins don't like absolute path, I would like to see a switch to change to relative path.

@MarcoRossignoli
Copy link
Collaborator

FYI #408 (comment)

@daveMueller
Copy link
Collaborator

In #614 we changed the cobertura report back to using relative paths so that the jenkins plugin is working again and the source link option is still supported.
The difference is that currently the root dir of the OS is used in sources/source and not the root of the project. Most likely this could be changed but I'm not really sure how to determine the root of the project? To be precise, I'm not sure about the definition of project root. Is it the .csproj files, the .sln file or even the repository?
@MarcoRossignoli What do you think?

@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Dec 18, 2019

@daveMueller I think that we shouldn't search the "root" of a project, but the algs should simply try to find longest shared absolute(per drive on win) and add to sources, the relative parts will go inside file attribute.

Report is "unrelated" to project structure and we don't know how a project will be setup, could be created at runtime, could o couldn't have a sln an so on...report wants only "locate" source files.
Something similar to trie structure where the absolute stops at first fork and letter are folders.

@daveMueller
Copy link
Collaborator

@MarcoRossignoli I got it. Is it OK when I work on it?

@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Dec 18, 2019

Yes thank's! Assigned to you, let me know if it's ok...there is no obligation but it's useful to keep track of stuff on issue list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement General enhancement request feature-request New feature request tenet-reporters Issue related to coverage output files(reporters) up-for-grabs Good issue for contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants