-
Notifications
You must be signed in to change notification settings - Fork 4
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
Exception for filename= with coverage 4.4 #10
Comments
Well, travis autotests does not show this error: https://travis-ci.org/tumb1er/coverage2clover/builds/231042026 |
Thank you, I'll look tomorrow.
|
fixed in #13 |
After seeing your fix and working with the coverage maintainer, I see that my repo actually exposed another bug first. This was no output for two files with the same name in two modules. Thanks for fixing that, but the real problem I was trying to show was an incomplete filespec output by coverage for two different files in two modules. I've altered the repo to run two tests, the original and one for this other case. Please check the repo again to see what I mean. I hope the second test fails also for you and you'll see what I mean. |
When I run latest version, I got: === test session starts
platform linux2 -- Python 2.7.12, pytest-3.0.7, py-1.4.33, pluggy-0.4.0
rootdir: /home/tumbler/PycharmProjects/coverage2clover_bug-master, inifile:
plugins: cov-2.5.0
collected 2 items
tests/test.py ..Coverage.py warning: No data was collected. (no-data-collected)
---------- coverage: platform linux2, python 2.7.12-final-0 ----------
Coverage XML written to file coverage1.xml
=== 2 passed in 0.01 seconds
Traceback (most recent call last):
File "/data/cc/virtualenv/bin/py.test", line 11, in <module>
sys.exit(main())
...
File "/data/cc/virtualenv/local/lib/python2.7/site-packages/coverage/config.py", line 427, in read_coverage_config
raise CoverageException("Couldn't read '%s' as a config file" % fname)
coverage.misc.CoverageException: Couldn't read '.coveragerc_noinitfiles' as a config file
==== Running coverage2clover with two __init__.py files... Is it correct? |
sorry, pull again |
Running coverage2clover with two init.py files... <?xml version='1.0' encoding='utf-8'?>
<coverage clover="4.4" generated="12-05-17">
<project timestamp="12-05-17">
<metrics classes="3" conditionals="0" coveredconditionals="0"
coveredelements="0" coveredstatements="0" elements="4"
files="3" loc="3" ncloc="4" packages="1" statements="4"/>
<package name="">
<metrics classes="3" conditionals="0" coveredconditionals="0"
coveredelements="0" coveredstatements="0" elements="4"
files="3" loc="3" ncloc="4" statements="4"/>
<class filename="__init__.py" name="__init__.py">
<metrics conditionals="0" coveredconditionals="0"
coveredelements="0" coveredstatements="0" elements="0"
files="1" loc="1" ncloc="0" statements="0"/>
</class>
<class filename="bar.py" name="bar.py">
<metrics conditionals="0" coveredconditionals="0"
coveredelements="0" coveredstatements="0" elements="2"
files="1" loc="1" ncloc="2" statements="2"/>
</class>
<class filename="foo.py" name="foo.py">
<metrics conditionals="0" coveredconditionals="0"
coveredelements="0" coveredstatements="0" elements="2"
files="1" loc="1" ncloc="2" statements="2"/>
</class>
</package>
</project>
</coverage> Running coverage2clover for foo.py and bar.py... <?xml version='1.0' encoding='utf-8'?>
<coverage clover="4.4" generated="12-05-17">
<project timestamp="12-05-17">
<metrics classes="2" conditionals="0" coveredconditionals="0"
coveredelements="0" coveredstatements="0" elements="4"
files="2" loc="2" ncloc="4" packages="1" statements="4"/>
<package name="">
<metrics classes="2" conditionals="0" coveredconditionals="0"
coveredelements="0" coveredstatements="0" elements="4"
files="2" loc="2" ncloc="4" statements="4"/>
<class filename="bar.py" name="bar.py">
<metrics conditionals="0" coveredconditionals="0"
coveredelements="0" coveredstatements="0" elements="2"
files="1" loc="1" ncloc="2" statements="2"/>
</class>
<class filename="foo.py" name="foo.py">
<metrics conditionals="0" coveredconditionals="0"
coveredelements="0" coveredstatements="0" elements="2"
files="1" loc="1" ncloc="2" statements="2"/>
</class>
</package>
</project>
</coverage> I'm not sure if there is any bug... |
So maybe your fix solved both problems? I get the following output from showbug.sh for the second (foo/bar) test: ==== Running coverage2clover for foo.py and bar.py...
wc: bar.py: open: No such file or directory
Traceback (most recent call last):
File "/Users/dmulter/Documents/xxx/projects/github/coverage2clover_bug/.virtualenv/bin/coverage2clover", line 27, in <module>
cov.open(inputfile)
File "/Users/dmulter/Documents/xxx/projects/github/coverage2clover_bug/.virtualenv/lib/python2.7/site-packages/clover/__init__.py", line 138, in open
c.count_loc()
File "/Users/dmulter/Documents/xxx/projects/github/coverage2clover_bug/.virtualenv/lib/python2.7/site-packages/clover/__init__.py", line 80, in count_loc
output = subprocess.check_output(['wc', '-l', self.filename])
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['wc', '-l', 'bar.py']' returned non-zero exit status 1 |
In #12 I merged to version 1.3 complete removal of 'wc' call. Also, your bug repo requirements.txt still contains c2c==1.2, not the last version. |
Confirmed the bug is fixed for me, thanks for the quick turnaround! |
The latest version of coverage has changed how they output the XML file and this has broken the ability to read the file in this tool. More details in their repo here:
https://bitbucket.org/ned/coveragepy/issues/578/incomplete-file-path-in-xml-report
The text was updated successfully, but these errors were encountered: