Re: Anaconda and python-coverage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



На  6.02.2014 18:44, Chris Lumens написа:
I'm experimenting with python-coverage and have an updates.img
against a RHEL 7 tree which successfully starts, stops and saves the
resulting data from coverage.

My issue is that when doing a coverage report I don't see much info
for anaconda and pyanaconda.

The only line for anaconda is about /usr/sbin/anaconda.

The rest are blivet, pykickstart, meh, dbus and other python modules
but not pyanaconda. Any ideas ?

Hm, no clever ideas right now, no.  Can you link to what patches you've
done to anaconda to try it out?

It's a single patch to start/stop/save coverage from inside anaconda. I have hard-coded paths and it may not stop/save cleanly in case of a crash or traceback but works well-enough for testing purposes.


To see a sample coverage report on a RHEL 7 system do:

$ mv anaconda.coverage .coverage
$ coverage report



--
Alex

diff --git a/anaconda b/anaconda
index 53b5e18..432e12c 100755
--- a/anaconda
+++ b/anaconda
@@ -30,12 +30,25 @@
 
 # This toplevel file is a little messy at the moment...
 
+try:
+    import coverage
+    cov = coverage.coverage(data_file='/mnt/sysimage/root/anaconda.coverage', branch=True)
+    cov.start()
+except:
+    coverage = None
+    
 import atexit, sys, os, re, time, subprocess
 from tempfile import mkstemp
 # keep up with process ID of the window manager if we start it
 wm_pid = None
 
 def exitHandler(rebootData, storage, exitCode=None):
+    # stop and save coverage here b/c later on the file system may not be available
+    if coverage is not None:
+        cov.stop()
+        if os.path.isdir('/mnt/sysimage/root'):
+            cov.save()
+
     from pyanaconda import isys
     from pyanaconda.flags import flags
 
(dp1
S'collector'
p2
S'coverage v3.0.1'
p3
sS'lines'
p4
(dp5
S'/usr/lib/python2.6/site-packages/dogtail/utils.py'
p6
(lp7
I6
aI11
aI13
aI14
aI15
aI16
aI17
aI18
aI19
aI20
aI21
aI23
aI69
aI106
aI117
aI118
aI120
aI131
aI152
aI154
aI158
aI159
aI160
aI161
aI163
aI165
aI166
aI167
aI168
aI171
aI172
aI174
aI181
aI187
aI192
aI193
aI194
aI195
aI196
aI197
aI198
aI202
aI203
aI204
aI205
aI206
aI207
aI208
aI209
aI212
aI213
asS'/usr/lib/python2.6/site-packages/dogtail/errors.py'
p8
(lp9
I4
aI5
aI6
aI8
aI9
aI20
aI23
aI24
asS'/usr/bin/dogtail-recorder'
p10
(lp11
I2
aI3
aI4
aI5
aI7
aI8
asS'/usr/lib/python2.6/site-packages/dogtail/logging.py'
p12
(lp13
I6
aI11
aI12
aI13
aI14
aI15
aI16
aI17
aI20
aI23
aI24
aI25
aI26
aI28
aI36
aI37
aI39
aI42
aI47
aI48
aI52
aI53
aI54
aI55
aI56
aI57
aI60
aI84
aI87
aI88
aI89
aI95
aI96
aI97
aI98
aI100
aI101
aI102
aI105
aI106
aI112
aI115
aI116
aI117
aI127
aI129
aI130
aI131
aI132
aI133
aI135
aI142
aI145
aI146
aI148
aI149
aI151
aI153
aI154
aI157
aI160
aI161
aI165
aI185
aI187
aI188
aI194
asS'/usr/lib/python2.6/site-packages/dogtail/config.py'
p14
(lp15
I3
aI4
aI6
aI7
aI8
aI10
aI101
aI102
aI103
aI104
aI106
aI107
aI108
aI110
aI112
aI113
aI114
aI115
aI116
aI117
aI118
aI121
aI122
aI123
aI124
aI125
aI126
aI127
aI128
aI129
aI132
aI133
aI134
aI135
aI136
aI137
aI138
aI139
aI140
aI141
aI144
aI147
aI149
aI151
aI152
aI153
aI154
aI156
aI170
aI171
aI172
aI173
aI177
aI184
aI186
aI192
aI194
aI200
aI207
aI209
asS'/usr/lib/python2.6/site-packages/dogtail/__init__.py'
p16
(lp17
I6
aI10
aI11
aI12
aI13
aI15
ass.
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux