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

On Linux, packages get installed in places coverage.py doesn't ignore #74

Open
nedbat opened this issue Jun 24, 2010 · 6 comments
Open
Labels
bug Something isn't working report

Comments

@nedbat
Copy link
Owner

nedbat commented Jun 24, 2010

Nikola Skoric reported on the nose-users list that too many packages were being measured, namely nose and lxml:

nick@rilmir:~/code/travapi$ coverage report                                            
Name                                                                                       Stmts   Exec  Cover                                                                            
--------------------------------------------------------------------------------------------------------------                                                                            
/usr/local/lib/python2.6/dist-packages/lxml-2.2.6-py2.6-linux-i686.egg/lxml/__init__           1      1   100%                                                                            
/usr/local/lib/python2.6/dist-packages/lxml-2.2.6-py2.6-linux-i686.egg/lxml/_elementpath     128     15    11%                                                                            
/usr/local/lib/python2.6/dist-packages/lxml-2.2.6-py2.6-linux-i686.egg/lxml/cssselect        610    336    55%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/case                                             170     47    27%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/core                                             154     22    14%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/failure                                           20      8    40%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/importer                                          92     53    57%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/loader                                           331    136    41%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/plugins/capture                                   53     14    26%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/plugins/cover                                    164      5     3%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/plugins/errorclass                                65     10    15%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/plugins/logcapture                               120     15    12%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/plugins/manager                                  261     39    14%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/proxy                                             99     43    43%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/result                                           128     31    24%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/selector                                         130     71    54%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/suite                                            379    180    47%                                                                            
/usr/local/lib/python2.6/dist-packages/nose/util                                             350     77    22%
test/test_account 15     15   100%
test/test_resources 28     27    96%
test/test_village 26     22    84%
travapi/__init__  1      1   100%
travapi/account 64     61    95%
travapi/const 17     17   100%
travapi/fetch134     92    68%
travapi/resources140    118    84%
travapi/village128    116    90%
--------------------------------------------------------------------------------------------------------------
TOTAL                                                                                       3808   1572    41%

His "coverage debug sys" output is:

nick@rilmir:~/code/travapi$ coverage debug sys
-- sys ----------------------------------------
        version: 3.3.1                         
       coverage: /usr/local/lib/python2.6/dist-packages/coverage/__init__.pyc
   cover_prefix: /usr/local/lib/python2.6/dist-packages/coverage             
   pylib_prefix: /usr/lib/python2.6                                          
         tracer: Tracer                                                      
      data_path: /media/data/home/code/travapi/.coverage                     
         python: 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3]  
       platform: Linux-2.6.28-18-generic-i686-with-Ubuntu-9.04-jaunty        
            cwd: /media/data/home/code/travapi                               
           path:                                                             
                 /usr/local/bin                                              
                 /usr/local/lib/python2.6/dist-packages/Whoosh-0.3.16-py2.6.egg
                 /usr/local/lib/python2.6/dist-packages/lxml-2.2.6-py2.6-linux-i686.egg
                 /usr/local/lib/python2.6/dist-packages/distribute-0.6.12-py2.6.egg    
                 /usr/local/lib/python2.6/dist-packages/pip-0.7.2-py2.6.egg            
                 /usr/lib/python2.6                                                    
                 /usr/lib/python2.6/plat-linux2                                        
                 /usr/lib/python2.6/lib-tk                                             
                 /usr/lib/python2.6/lib-old                                            
                 /usr/lib/python2.6/lib-dynload                                        
                 /usr/lib/python2.6/dist-packages                                      
                 /usr/lib/python2.6/dist-packages/PIL                                  
                 /var/lib/python-support/python2.6                                     
                 /var/lib/python-support/python2.6/gtk-2.0                             
                 /usr/local/lib/python2.6/dist-packages                                
    environment:                                                                       

He reports that he installed them with "pip install nose"


@nedbat
Copy link
Owner Author

nedbat commented Jun 24, 2010

@nedbat
Copy link
Owner Author

nedbat commented Oct 14, 2012

Original comment by sourcefrog (Bitbucket: sourcefrog, GitHub: sourcefrog)


Somewhat related (but afaics a different codepath), on Ubuntu Precise, with coverage installed from python-coverage, it also fails to exclude itself from the report:

% echo 'print 42' >> test.py
% python-coverage erase
% python-coverage run test.py
42
% python-coverage report
Name                                     Stmts   Miss  Cover
------------------------------------------------------------
/usr/share/pyshared/coverage/collector     132    127     4%
/usr/share/pyshared/coverage/control       236    235     1%
/usr/share/pyshared/coverage/execfile       35     16    54%
test                                         2      0   100%
------------------------------------------------------------
TOTAL                                      405    378     7%

@nedbat
Copy link
Owner Author

nedbat commented Nov 17, 2012

@sourcefrog: Can you show me the output of "coverage debug sys" ? It looks like you may have two coverage.py's installed, and it's somehow using both?

@nedbat
Copy link
Owner Author

nedbat commented Nov 21, 2012

From #python today, another report of this. Here's the "coverage debug sys":

$ python-coverage debug sys
-- sys ----------------------------------------
        version: 3.4
       coverage: /usr/lib/python2.7/dist-packages/coverage/__init__.pyc
      cover_dir: /usr/lib/python2.7/dist-packages/coverage
     pylib_dirs:
                 /usr/lib/python2.7
         tracer: Tracer
      data_path: /home/dev/vminstaller/.coverage
         python: 2.7.3 (default, Aug  1 2012, 05:14:39) [GCC 4.6.3]
       platform: Linux-3.2.0-33-generic-x86_64-with-Ubuntu-12.04-precise
            cwd: /home/dev/vminstaller
           path:
                 /usr/bin
                 /home/cr3/lib/python
                 /usr/lib/python2.7
                 /usr/lib/python2.7/plat-linux2
                 /usr/lib/python2.7/lib-tk
                 /usr/lib/python2.7/lib-old
                 /usr/lib/python2.7/lib-dynload
                 /usr/local/lib/python2.7/dist-packages
                 /usr/lib/python2.7/dist-packages
                 /usr/lib/python2.7/dist-packages/PIL
                 /usr/lib/python2.7/dist-packages/gst-0.10
                 /usr/lib/python2.7/dist-packages/gtk-2.0
                 /usr/lib/pymodules/python2.7
                 /usr/lib/python2.7/dist-packages/ubuntu-sso-client
                 /usr/lib/python2.7/dist-packages/ubuntuone-client
                 /usr/lib/python2.7/dist-packages/ubuntuone-control-panel
                 /usr/lib/python2.7/dist-packages/ubuntuone-couch
                 /usr/lib/python2.7/dist-packages/ubuntuone-installer
                 /usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol
    environment:
                 PYTHONPATH = /home/cr3/lib/python

And here's the coverage report:

/usr/share/pyshared/coverage/collector         132    127     4%   3-229, 236-244, 248-292
/usr/share/pyshared/coverage/control           236    235     1%   3-355, 358-624
/usr/share/pyshared/coverage/execfile           35     14    60%   3-17, 42-43, 48, 58-65
test                                            33      6    82%   21-24, 27, 48
vminstaller/__init__                             2      0   100%
vminstaller/command                             12      7    42%   17-24
vminstaller/disk                                80      0   100%
vminstaller/initrd                              70     12    83%   102-119, 128, 135, 147, 154
vminstaller/iso/__init__                         0      0   100%
vminstaller/iso/inode                          157      3    98%   110, 161, 202
vminstaller/iso/tests/__init__                   0      0   100%
vminstaller/iso/tests/test_inode               228      0   100%
vminstaller/monitor                             27      0   100%
vminstaller/scripts/__init__                     0      0   100%
vminstaller/scripts/application                 39      0   100%
vminstaller/scripts/logger                      52     16    69%   33-44, 48-59, 71-72, 89
vminstaller/scripts/tests/__init__               0      0   100%
vminstaller/scripts/tests/test_application      82      0   100%
vminstaller/scripts/tests/test_logger           37      0   100%
vminstaller/testing/__init__                     0      0   100%
vminstaller/testing/temp                        54      0   100%
vminstaller/testing/tests/__init__               0      0   100%
vminstaller/testing/tests/test_temp             81      0   100%
vminstaller/testing/tests/test_unique           21      0   100%
vminstaller/testing/unique                      19      0   100%
vminstaller/tests/__init__                      25      4    84%   37-41
vminstaller/tests/test_disk                    147      0   100%
vminstaller/tests/test_initrd                   71      0   100%
vminstaller/tests/test_monitor                  68      0   100%
--------------------------------------------------------------------------
TOTAL                                    

veloutin reports that the files in /...2.7/dist-packages/ are symlinks to those in /..pyshared/

@nedbat
Copy link
Owner Author

nedbat commented Nov 23, 2012

I split the second issue into its own ticket: #214.

@nedbat
Copy link
Owner Author

nedbat commented Dec 18, 2016

Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary)


Is there a way to reproduce this issue now that #214 fixed at least part of it (if not all of it ;-) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working report
Projects
None yet
Development

No branches or pull requests

1 participant