xenserver / status-report

Program that gathers data for xenserver host diagnostics
GNU Lesser General Public License v2.1
1 stars 9 forks source link

CP-45506: Fix asking if /etc/systemd/* should be collected #48

Closed bernhardkaindl closed 10 months ago

bernhardkaindl commented 10 months ago

Note on the test for this change:

The change in this PR is covered by two different container-based tests.

These are not unit tests, but tests which run bugtool as an external process in a container and ensure that the requested functionality is not broken by checking that /etc/systemd is still archived into a tarball inside the main bugball.

These are the links to the two lines (one for tar output archives, one for zip output archives) in the simple shell script based test (which runs inside a container) that extracts and later verifies the contents of the /etc/systemd.tar tarball in the output archive:

https://github.com/xenserver/status-report/actions/runs/7500658225/job/20419801112?pr=48#step:7:26 https://github.com/xenserver/status-report/actions/runs/7500658225/job/20419801112?pr=48#step:7:66

The same from the Python2-based namespace container test:

https://github.com/xenserver/status-report/actions/runs/7500658225/job/20419801391?pr=48#step:5:92 https://github.com/xenserver/status-report/actions/runs/7500658225/job/20419801391?pr=48#step:5:92


Commit message:

For CP-45506 (Package /etc/systemd into a tarball), I had assumed that I'd have to move the tree_output() for /etc/systemd to after where the tarball for /etc/systemd is declared, but this was not needed.

Moving it had the side effect that in interactive mode (a question if each individual file shall be collected - hundreds of questions usually), the /etc/systemd tarball was simply always collected.

This commit fixes this by reverting this move, back to the original location of this line, to before the question if the files in /etc/systemd/* shall be collected.

github-actions[bot] commented 10 months ago

Coverage

Pytest Code coverage comment for Python 2.7
FileStmtsMissCoverMissing
xen-bugtool152329780%77–79, 84, 95, 100–101, 410, 486, 491, 511, 517, 540, 602, 620, 637, 685–688, 692–693, 707, 711, 726–727, 733–734, 739, 749, 754, 757–760, 766, 771–773, 776–777, 780–781, 784, 825–827, 962–976, 978–987, 1048, 1056, 1174, 1176, 1180–1181, 1204, 1222, 1225–1227, 1230–1234, 1237–1238, 1242–1244, 1250–1256, 1259–1263, 1265–1281, 1284–1292, 1295–1296, 1298, 1300–1301, 1303–1311, 1314, 1316–1319, 1321, 1323–1324, 1358, 1386, 1401, 1409–1410, 1414–1416, 1418, 1425, 1427–1431, 1433, 1463–1465, 1467–1472, 1475–1479, 1483–1484, 1486, 1503–1504, 1506, 1508–1509, 1511–1513, 1515–1522, 1524–1529, 1533–1534, 1536, 1538, 1540, 1556–1557, 1559, 1561–1563, 1566–1567, 1569, 1571–1573, 1576–1577, 1579, 1581–1584, 1587–1597, 1600–1604, 1613, 1626, 1636, 1640, 1675–1677, 1750, 1785, 1824, 1884, 1927, 1930–1931, 1969, 1976, 1982, 1984–1987, 1990–2000, 2091–2093, 2096–2098, 2110, 2129–2131, 2171–2175, 2187, 2205
integration
   __init__.py00100% 
   conftest.py180100% 
   namespace_container.py35197%85
   test_system_load.py180100% 
   test_xenserverconfig.py130100% 
   utils.py61493%18, 31, 66, 104
mocks/xen
   __init__.py00100% 
mocks/xen/lowlevel
   __init__.py00100% 
mocks/xen/lowlevel/xc
   __init__.py50100% 
unit
   __init_\.py00100% 
   conftest.py28967%34, 36–40, 42–44
   test_dir_list.py110100% 
   test_fs_funcs.py100100% 
   test_load_plugins.py50100% 
   test_main.py101892%161, 238–240, 242–245
   test_output.py640100% 
   test_process_output.py110100% 
   test_xapidb_filter.py190100% 
TOTAL192231983% 

Tests Skipped Failures Errors Time
19 1 :zzz: 0 :x: 0 :fire: 2.273s :stopwatch:
codecov-commenter commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (942bc97) 58.44% compared to head (2649c4a) 84.90%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #48 +/- ## =========================================== + Coverage 58.44% 84.90% +26.45% =========================================== Files 8 15 +7 Lines 1651 1928 +277 =========================================== + Hits 965 1637 +672 + Misses 686 291 -395 ``` | [Flag](https://app.codecov.io/gh/xenserver/status-report/pull/48/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xenserver) | Coverage Δ | | |---|---|---| | [python2.7](https://app.codecov.io/gh/xenserver/status-report/pull/48/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xenserver) | `83.40% <94.24%> (?)` | | | [python3.10.13](https://app.codecov.io/gh/xenserver/status-report/pull/48/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xenserver) | `83.74% <100.00%> (?)` | | | [unittest](https://app.codecov.io/gh/xenserver/status-report/pull/48/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xenserver) | `83.74% <100.00%> (+25.29%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xenserver#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 10 months ago

Coverage

Python3 coverage comment from https://github.com/marketplace/actions/pytest-coverage-comment
FileStmtsMissCoverMissing
__init__.py00100% 
conftest.py320100% 
test_dir_list.py110100% 
test_fs_funcs.py100100% 
test_load_plugins.py50100% 
test_main.py1030100% 
test_output.py640100% 
test_process_output.py110100% 
test_xapidb_filter.py190100% 
xen-bugtool152328981%95, 100–101, 410, 491, 511, 517, 540, 602, 620, 637, 685–688, 692–693, 707, 711, 726–727, 733–734, 739, 749, 754, 766, 771–773, 776–777, 780–781, 784, 825–827, 846, 962–976, 978–987, 1048, 1056, 1174, 1176, 1180–1181, 1204, 1222, 1225–1227, 1230–1234, 1237–1238, 1242–1244, 1250–1256, 1259–1263, 1265–1281, 1284–1292, 1295–1296, 1298, 1300–1301, 1303–1311, 1314, 1316–1319, 1321, 1323–1324, 1358, 1386, 1401, 1409–1410, 1414–1416, 1418, 1425, 1427–1431, 1433, 1463–1465, 1467–1472, 1475–1479, 1483–1484, 1486, 1503–1504, 1506, 1508–1509, 1511–1513, 1515–1522, 1524–1529, 1533–1534, 1536, 1538, 1540, 1556–1557, 1559, 1561–1563, 1566–1567, 1569, 1571–1573, 1576–1577, 1579, 1581–1584, 1587–1597, 1600–1604, 1614, 1626, 1636, 1640, 1675–1677, 1785, 1809, 1824, 1884, 1927, 1930–1931, 1969, 1976, 1982, 1984–1987, 1990–2000, 2091–2093, 2096–2098, 2110, 2129–2131, 2171–2175, 2187, 2205
TOTAL177828983% 

Tests Skipped Failures Errors Time
15 0 :zzz: 0 :x: 0 :fire: 0.965s :stopwatch: