-
-
Notifications
You must be signed in to change notification settings - Fork 439
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
Handle Windows/Unix path separator differences in combine #903
Comments
It has changed its internal format to sqlite and still doesn't provide a way to merge runs from different OSes, see nedbat/coveragepy#903
It has changed its internal format to sqlite and still doesn't provide a way to merge runs from different OSes, see nedbat/coveragepy#903
In case anyone is facing the same problem, here is a script to fix the files before combining: import sys
import sqlite3
def main(argv):
paths = argv[1:]
for path in paths:
# https://github.com/nedbat/coveragepy/issues/903
conn = sqlite3.connect(path)
conn.execute("UPDATE file set path = REPLACE(path, '\\', '/')")
conn.commit()
conn.close()
if __name__ == "__main__":
sys.exit(main(sys.argv)) |
Just ran into this problem myself. The script from @lazka worked flawlessly. Thanks! |
(Sorry this has gotten so stale...) Do you have a way to demonstrate the problem? When you use the |
Feel free to re-open this if you can provide more information. |
As they don't share a common prefix I don't know how I would use "[paths]". I tried some things (creating a dummy paths entry) but there was no change.
@nedbat I don't have rights to re-open. |
Is your feature request related to a problem? Please describe.
I'm generating coverage data on Windows and Linux machines and want to combine them to a final html report. To get the different base paths sorted I use the new relative_path option which works nicely (except for #899), thanks for that!
The problem now is that the combine command doesn't merge "foo/bar/quux.py" with "foo\bar\quux.py" and as a result they get treated as separate files.
When I then try to generate a html report it complains that "foo\bar\quux.py" doesn't exist.
Describe the solution you'd like
I'd like that combine normalizes the path separators to "/" (which is valid on Windows as well) before trying to combine two reports or that the paths get normalized to "/" before being written to the sqlite DB.
Example Data
Here are two .coverage files for the same test run on Windows an Linux as an example:
coverage-example.zip
The text was updated successfully, but these errors were encountered: