Skip to content
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

Option to use relative file paths in xml report #948

Closed
kammala opened this issue Feb 27, 2020 · 5 comments · Fixed by CSCfi/oidc-client#35 or CSCfi/beacon-python#162
Closed

Option to use relative file paths in xml report #948

kammala opened this issue Feb 27, 2020 · 5 comments · Fixed by CSCfi/oidc-client#35 or CSCfi/beacon-python#162
Labels
enhancement fixed

Comments

@kammala
Copy link

@kammala kammala commented Feb 27, 2020

Is your feature request related to a problem? Please describe.
There is an option for run command to store only relative file paths. It is very useful while running your tests inside one environment(e.g. docker) and using results in another one(e.g. on Jenkins node). It is also common to generate cobertura report in the same environment you are running tests, but this report always includes absolute path for sources(I think, because of this line). This way it is impossible for tools like Jenkins Cobertura plugin or Sonarqube to find source files properly(Sonarqube either fails to parse coverage report at all or raises warning, for example).

Describe the solution you'd like
json reports use paths from .coverage file and thus respect this relative_files setting from run section.
It would be nice either to not canonicalize paths for sources or to have an option which will skip path normalization(this way it may be more backward compatible)

Describe alternatives you've considered
I tried to use combine and define sources in [path] section of config but it ends up with absolute path in the end report anyway.

@kammala kammala added the enhancement label Feb 27, 2020
@kammala
Copy link
Author

@kammala kammala commented Feb 27, 2020

inspired by discussion in #597

@nedbat
Copy link
Owner

@nedbat nedbat commented Feb 27, 2020

This seems very reasonable :)

@roniemartinez
Copy link

@roniemartinez roniemartinez commented Mar 11, 2020

Same issue here :( CodeClimate outside of docker fails as the report is using absolute path.

@nedbat nedbat added this to the 5.0.4 milestone Mar 11, 2020
@nedbat
Copy link
Owner

@nedbat nedbat commented Mar 16, 2020

As of f668d6f, using [run] relative_files=True will make the XML report store relative file names.

@nedbat nedbat closed this as completed Mar 16, 2020
@nedbat nedbat added the fixed label Mar 17, 2020
@nedbat
Copy link
Owner

@nedbat nedbat commented Mar 17, 2020

This is now available in coverage v5.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement fixed
Projects
None yet
3 participants