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

Problem when combining windows generated data on linux machine #618

Closed
nedbat opened this issue Nov 21, 2017 · 7 comments
Closed

Problem when combining windows generated data on linux machine #618

nedbat opened this issue Nov 21, 2017 · 7 comments
Labels
bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Nov 21, 2017

Originally reported by Anonymous


If i have the following directory structure:

- project/
    - module/
        - tests/
            - file.py

a coveragerc with the folowing paths configuration:

[paths]
source =
    project/module
    */project/module
    *\project\module

The windows data file contains:

!coverage.py: This is a private format, don't read it directly!{"lines":{"C:\\a\\path\\somewhere\\coveragepy_test\\project\\module\\tests\\file.py":[1,2,3,4]}}

When i run, on a Linux machine:

$ coverage combine coverage.win.paths

the resulting coverage data file is:

!coverage.py: This is a private format, don't read it directly!{"lines":{"/tmp/coveragepy_test/project/module/tests\\file.py":[1,2,3,4]}}

I tried many different [paths] configuration with no luck.

I'm uploading a .tar.gz with the same scenario so you only need to do coverage combine coverage.win.paths to see the problem happening.

let me know if I can provide more information.

thanks!


@nedbat
Copy link
Owner Author

nedbat commented Nov 21, 2017

Original comment by Bruno Gola (Bitbucket: brunogola, GitHub: Unknown)


sorry, I didn't notice I wasn't logged in when submitting the issue.

@nedbat
Copy link
Owner Author

nedbat commented Jan 21, 2018

@brunogola Can you say more about what the actual problem is? Where do things go wrong?

@nedbat
Copy link
Owner Author

nedbat commented Jan 21, 2018

This sounds like something having to do with [paths]. I can help figure out what's going wrong if you link to the code, etc.

@nedbat
Copy link
Owner Author

nedbat commented Jan 22, 2018

Original comment by Bruno Gola (Bitbucket: brunogola, GitHub: Unknown)


hi @nedbat, the problem is that the resulting data file has a wrong path ("/tmp/coveragepy_test/project/module/tests\file.py")

if you download the .tar file and run (on linux):

#!bash
coverage combine coverage.win.path

check the .coverage file.

there is a .coveragerc in the .tar, i believe the [paths] setting is right.

thanks for the reply

@nedbat
Copy link
Owner Author

nedbat commented Jan 23, 2018

OK, I finally understand: the specific wrong thing is the backslash in the path, since it should be a Linux path. Interestingly, if you swap the last two lines in your [paths] configuration, it works, though it might not then on Windows. I'm looking into it.

@nedbat
Copy link
Owner Author

nedbat commented Jan 23, 2018

This is fixed in 87e7ffae9f6f (bb)

@nedbat
Copy link
Owner Author

nedbat commented Feb 3, 2018

This was included in coverage.py v4.5, released today.

@nedbat nedbat closed this as completed Feb 3, 2018
@nedbat nedbat added major bug Something isn't working labels Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant