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

fix: update ls specs, parser definition & test files to support new options #4234

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rahulXs
Copy link
Contributor

@rahulXs rahulXs commented Oct 1, 2024

All Pull Requests:

Check all that apply:

  • Have you followed the guidelines in our Contributing document, including the instructions about commit messages?
  • No Sensitive Data in this change?
  • Is this PR to correct an issue?
  • Is this PR an enhancement?

Complete Description of Additions/Changes:

  • sosreport is now using new add_dir_listing wrapper method instead of current add_cmd_output effectively changing the ls parsers options from current format with options -lanR to new options -alZR.

  • This change is shipped in sos-4.8.0 with options -alhZR and later in sos-4.8.1 to options -alZR (dropping the -h flag).

  • The following 3 ls specs available in insights-core (sos_archive.py) has been updated to process new spec source:

ls_boot = simple_file("sos_commands/boot/ls_-lanR_.boot")
ls_dev = first_file(["sos_commands/block/ls_-lanR_.dev", "sos_commands/devicemapper/ls_-lanR_.dev"])
ls_sys_firmware = simple_file("sos_commands/boot/ls_-lanR_.sys.firmware")

Pytest for parsers:

 insights-core   issue46_core_ls_spec_change  pytest -v insights/tests/parsers/test_ls_boot.py
=========================================================================== test session starts ============================================================================
platform darwin -- Python 3.11.4, pytest-7.4.3, pluggy-1.3.0 -- /Users/rahushar/virtualenvs/gss-rules/bin/python3.11
cachedir: .pytest_cache
rootdir: /Users/rahushar/Projects/insights-core
configfile: setup.cfg
plugins: cov-4.1.0
collected 3 items

insights/tests/parsers/test_ls_boot.py::test_ls_boot PASSED                                                                                                          [ 33%]
insights/tests/parsers/test_ls_boot.py::test_boot_links PASSED                                                                                                       [ 66%]
insights/tests/parsers/test_ls_boot.py::test_doc_examples PASSED                                                                                                     [100%]

============================================================================ 3 passed in 0.06s =============================================================================
 insights-core   issue46_core_ls_spec_change  pytest -v insights/tests/parsers/test_ls_dev.py
=========================================================================== test session starts ============================================================================
platform darwin -- Python 3.11.4, pytest-7.4.3, pluggy-1.3.0 -- /Users/rahushar/virtualenvs/gss-rules/bin/python3.11
cachedir: .pytest_cache
rootdir: /Users/rahushar/Projects/insights-core
configfile: setup.cfg
plugins: cov-4.1.0
collected 2 items

insights/tests/parsers/test_ls_dev.py::test_ls_dev PASSED                                                                                                            [ 50%]
insights/tests/parsers/test_ls_dev.py::test_doc_examples PASSED                                                                                                      [100%]

============================================================================ 2 passed in 0.05s =============================================================================
 insights-core   issue46_core_ls_spec_change  pytest -v insights/tests/parsers/test_ls_sys_firmware.py
=========================================================================== test session starts ============================================================================
platform darwin -- Python 3.11.4, pytest-7.4.3, pluggy-1.3.0 -- /Users/rahushar/virtualenvs/gss-rules/bin/python3.11
cachedir: .pytest_cache
rootdir: /Users/rahushar/Projects/insights-core
configfile: setup.cfg
plugins: cov-4.1.0
collected 2 items

insights/tests/parsers/test_ls_sys_firmware.py::test_ls_sys_firmware PASSED                                                                                          [ 50%]
insights/tests/parsers/test_ls_sys_firmware.py::test_doc_examples PASSED                                                                                             [100%]

============================================================================ 2 passed in 0.06s =============================================================================

References

…ptions

Signed-off-by: Rahul Sharma <rahushar@redhat.com>
@Lorquas
Copy link
Member

Lorquas commented Oct 1, 2024

Can one of the admins verify this patch?

@codecov-commenter
Copy link

codecov-commenter commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.88%. Comparing base (7ff8c5e) to head (ad7b2d1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4234   +/-   ##
=======================================
  Coverage   76.88%   76.88%           
=======================================
  Files         757      757           
  Lines       41342    41344    +2     
  Branches     9526     9526           
=======================================
+ Hits        31785    31787    +2     
  Misses       8479     8479           
  Partials     1078     1078           
Flag Coverage Δ
unittests 76.86% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants