insights-core
insights-core copied to clipboard
[New-parser] parser_mpirun_version
All Pull Requests:
Check all that apply:
- [x] Have you followed the guidelines in our Contributing document, including the instructions about commit messages?
- [ ] Is this PR to correct an issue?
- [ ] Is this PR an enhancement?
Complete Description of Additions/Changes:
Adding a Specs for Advisory rule mpirun_version
@mohitkumarrh
The output collected by the command has to be collected in the file. Please add an entry in https://github.com/RedHatInsights/insights-core/blob/master/insights/specs/insights_archive.py. Use the mangle command (https://insights-core.readthedocs.io/en/latest/api_index.html?highlight=mangle#insights.core.spec_factory.mangle_command) to generate the file_path.
Please also create a file in https://github.com/RedHatInsights/insights-core/tree/master/docs/shared_parsers_catalog for documentation.
@psachin I have added an entry in insights_archive.py. I'll add the documentation too.
@psachin - Thanks for the review. I have made the suggested changes, Please review. py.test:
(venv) ➜ insights-core git:(parser_mpirun_version) ✗ py.test -svk mpirun --cov=insights.parsers.mpirun
============================================================= test session starts =============================================================
platform darwin -- Python 3.6.5, pytest-5.2.1, py-1.10.0, pluggy-0.13.1 -- /Users/mohitkumar/Insights/venv/bin/python
cachedir: .pytest_cache
rootdir: /Users/mohitkumar/Insights/insights-core, inifile: setup.cfg, testpaths: insights
plugins: cov-2.12.1
collecting 181 items Downloading a fresh and hot uploader.json...
collected 2875 items / 2872 deselected / 3 selected
insights/tests/parsers/test_mpirun.py::test_mpirun_version PASSED
insights/tests/parsers/test_mpirun.py::test_mpirun_version_ab PASSED
insights/tests/parsers/test_mpirun.py::test_doc_examples PASSED
---------- coverage: platform darwin, python 3.6.5-final-0 -----------
Name Stmts Miss Branch BrPart Cover Missing
------------------------------------------------------------------------
insights/parsers/mpirun.py 12 0 6 0 100%
------------------------------------------------------------------------
TOTAL 12 0 6 0 100%
===================================================== 3 passed, 2872 deselected in 7.87s ======================================================
@psachin please review
➜ insights-core git:(parser_mpirun_version) ✗ py.test -svk mpirun --cov=insights.parsers.mpirun
=================================================== test session starts ====================================================
platform darwin -- Python 3.9.1, pytest-7.1.2, pluggy-1.0.0 -- /Users/mohitkumar/.pyenv/versions/3.9.1/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/mohitkumar/Insights/insights-core, configfile: setup.cfg, testpaths: insights
plugins: cov-3.0.0
collecting 181 items Downloading a fresh and hot uploader.json...
collected 2875 items / 2872 deselected / 3 selected
insights/tests/parsers/test_mpirun.py::test_mpirun_version PASSED
insights/tests/parsers/test_mpirun.py::test_mpirun_version_ab PASSED
insights/tests/parsers/test_mpirun.py::test_doc_examples PASSED
---------- coverage: platform darwin, python 3.9.1-final-0 -----------
Name Stmts Miss Branch BrPart Cover Missing
------------------------------------------------------------------------
insights/parsers/mpirun.py 14 0 8 0 100%
------------------------------------------------------------------------
TOTAL 14 0 8 0 100%
============================================ 3 passed, 2872 deselected in 6.14s ============================================
Also, this spec requires approval before this PR can be merged.
@mohitkumarrh - as mentioned by Bob, Spec approval is required before merging this parser, I cannot find any MR/issues for it in the insights-core-assets repo, would you please open one for it?
@xiangce - Hey as we discussed today, I have made all the changes in PR you asked me to make, please have a Review now.
py.test:
(venv) ➜ insights-core git:(parser_mpirun_version) ✗ py.test -svk mpirun --cov=insights.parsers.mpirun
========================================================= test session starts ==========================================================
platform darwin -- Python 3.6.5, pytest-5.2.1, py-1.10.0, pluggy-0.13.1 -- /Users/mohitkumar/Insights/venv/bin/python
cachedir: .pytest_cache
rootdir: /Users/mohitkumar/Insights/insights-core, inifile: setup.cfg, testpaths: insights
plugins: cov-2.12.1
collecting 181 items Downloading a fresh and hot uploader.json...
collected 2875 items / 2872 deselected / 3 selected
insights/tests/parsers/test_mpirun.py::test_mpirun_version PASSED
insights/tests/parsers/test_mpirun.py::test_mpirun_version_ab PASSED
insights/tests/parsers/test_mpirun.py::test_doc_examples PASSED
---------- coverage: platform darwin, python 3.6.5-final-0 -----------
Name Stmts Miss Branch BrPart Cover Missing
------------------------------------------------------------------------
insights/parsers/mpirun.py 12 0 6 0 100%
------------------------------------------------------------------------
TOTAL 12 0 6 0 100%
================================================== 3 passed, 2872 deselected in 7.56s ==================================================
@xiangce - I renamed the file by mistake, I have update the file name please have a look