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

[pytest/coverage]: add coverage for all scripts #1041

Merged
merged 1 commit into from
Aug 9, 2020

Conversation

lguohan
Copy link
Contributor

@lguohan lguohan commented Aug 9, 2020

Signed-off-by: Guohan Lu lguohan@gmail.com

- What I did
add coverage for all scripts

- How I did it

- How to verify it

---------- coverage: platform linux2, python 2.7.16-final-0 ----------
Name                                       Stmts   Miss  Cover
--------------------------------------------------------------
acl_loader/__init__.py                         0      0   100%
acl_loader/main.py                           541    367    32%
clear/__init__.py                              0      0   100%
clear/bgp_frr_v6.py                           44     44     0%
clear/bgp_quagga_v4.py                        44     44     0%
clear/bgp_quagga_v6.py                        44     44     0%
clear/main.py                                179    106    41%
config/__init__.py                             0      0   100%
config/aaa.py                                132     82    38%
config/config_mgmt.py                        345    116    66%
config/feature.py                             25      5    80%
config/main.py                              2280   1683    26%
config/mlnx.py                               134     93    31%
config/nat.py                                680    570    16%
connect/__init__.py                            0      0   100%
connect/main.py                               55     55     0%
consutil/__init__.py                           0      0   100%
consutil/lib.py                               79     79     0%
consutil/main.py                              70     70     0%
counterpoll/__init__.py                        0      0   100%
counterpoll/main.py                          126    126     0%
crm/__init__.py                                0      0   100%
crm/main.py                                  289    289     0%
debug/__init__.py                              0      0   100%
debug/main.py                                153    153     0%
fwutil/__init__.py                             5      5     0%
fwutil/lib.py                                474    474     0%
fwutil/log.py                                 44     44     0%
fwutil/main.py                               243    243     0%
pcieutil/__init__.py                           0      0   100%
pcieutil/main.py                              75     75     0%
pddf_fanutil/__init__.py                       0      0   100%
pddf_fanutil/main.py                         182    182     0%
pddf_ledutil/__init__.py                       0      0   100%
pddf_ledutil/main.py                          60     60     0%
pddf_psuutil/__init__.py                       0      0   100%
pddf_psuutil/main.py                         203    203     0%
pddf_thermalutil/__init__.py                   0      0   100%
pddf_thermalutil/main.py                     104    104     0%
pfcwd/__init__.py                              0      0   100%
pfcwd/main.py                                198    198     0%
psuutil/__init__.py                            0      0   100%
psuutil/main.py                               66     66     0%
scripts/aclshow                              127     13    90%
scripts/db_migrator.py                       189    189     0%
scripts/dropconfig                           215    103    52%
scripts/dropstat                             216     21    90%
scripts/dump_nat_entries.py                   12     12     0%
scripts/fast-reboot-dump.py                  204    204     0%
scripts/filter_fdb_entries.py                 87     87     0%
scripts/gearboxutil                          131     21    84%
scripts/intfstat                             194     42    78%
scripts/intfutil                             314    100    68%
scripts/port2alias                            32      5    84%
scripts/psushow                               59      9    85%
scripts/route_check.py                       172    172     0%
scripts/sfpshow                              168     36    79%
scripts/update_json.py                        35     35     0%
sfputil/__init__.py                            0      0   100%
sfputil/main.py                              338    338     0%
show/__init__.py                               0      0   100%
show/bgp_frr_v4.py                            36     36     0%
show/bgp_frr_v6.py                            33     33     0%
show/bgp_quagga_v4.py                         20     20     0%
show/bgp_quagga_v6.py                         15     15     0%
show/feature.py                               34      0   100%
show/main.py                                1892   1359    28%
show/mlnx.py                                  80     62    23%
sonic_installer/__init__.py                    0      0   100%
sonic_installer/bootloader/__init__.py         9      9     0%
sonic_installer/bootloader/aboot.py          136    136     0%
sonic_installer/bootloader/bootloader.py      32     32     0%
sonic_installer/bootloader/grub.py            60     60     0%
sonic_installer/bootloader/onie.py            27     27     0%
sonic_installer/bootloader/uboot.py           61     61     0%
sonic_installer/common.py                     21     21     0%
sonic_installer/exception.py                   2      2     0%
sonic_installer/main.py                      412    412     0%
ssdutil/__init__.py                            0      0   100%
ssdutil/main.py                               50     50     0%
utilities_common/__init__.py                   0      0   100%
utilities_common/cli.py                       26      9    65%
utilities_common/db.py                         5      0   100%
utilities_common/intf_filter.py               30     18    40%
utilities_common/netstat.py                   35     15    57%
utilities_common/util_base.py                 32     32     0%
watchdogutil/__init__.py                       0      0   100%
watchdogutil/main.py                          54     54     0%
--------------------------------------------------------------
TOTAL                                      12469   9430    24%
Coverage HTML written to dir htmlcov
Coverage XML written to file coverage.xml

- Previous command output (if the output of a command-line utility has changed)

- New command output (if the output of a command-line utility has changed)

Signed-off-by: Guohan Lu <lguohan@gmail.com>
@lguohan
Copy link
Contributor Author

lguohan commented Aug 9, 2020

add coverage for all scripts. let's use this to improve our unit test coverage in this repo.

@lguohan lguohan merged commit fa7fb3a into sonic-net:master Aug 9, 2020
@lguohan lguohan deleted the cov2 branch August 9, 2020 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants