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

feat(ci): add coverage check for changed python file #4200

Merged
merged 14 commits into from
Sep 12, 2024
Merged

Conversation

xiangce
Copy link
Contributor

@xiangce xiangce commented Aug 27, 2024

  • add a script for checking python coverage in insights.tools
  • use the script in ci/cd pipelines to check updated python
  • remove unused mocking of os.path.join in test_copy_dir
  • Jira: RHINENG-12134

All Pull Requests:

Check all that apply:

  • 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:

Add your description here

@xiangce xiangce force-pushed the coverage_ci branch 7 times, most recently from 0473da5 to 3cf77a8 Compare August 27, 2024 09:18
@xiangce xiangce changed the title WIP feat(ci): add coverage check for the changed python file Aug 27, 2024
@xiangce xiangce force-pushed the coverage_ci branch 22 times, most recently from 2f47c87 to de98c4d Compare August 27, 2024 12:08
@xiangce xiangce force-pushed the coverage_ci branch 4 times, most recently from d01867a to 45ac6ed Compare September 2, 2024 06:22
@xiangce xiangce changed the title feat(ci): add coverage check for the changed python file feat(ci): add coverage check for changed python file Sep 2, 2024
@xiangce xiangce marked this pull request as ready for review September 2, 2024 07:17
@xiangce xiangce requested a review from JoySnow September 2, 2024 08:42
Copy link
Collaborator

@JoySnow JoySnow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiangce The coverage check LGTM .

skontar and others added 13 commits September 5, 2024 19:49
* Enhance httpd_conf mapper and shared reducer

Mapper:
- improved full_data field to store not only last found
  value, but also all previous ones in a list

Reducer:
- store parsed data in data field not only the last value,
  but also all found values as the list.
- added methods get_active_setting, get_setting_list to get
  more complex data structures with more data than backward
  compatible method get_valid_setting

https://bugzilla.redhat.com/show_bug.cgi?id=1455516

* Resolved review comments

* Remove unused import
* Enhance httpd_conf to support nested sections
- IfModule section is nest-able
- Support all the sections (includes nested sections)
- Re-define section name with a tuple in format of:('type', 'name')
  e.g.: ('IfModule', 'prefork.c')
- Remove the useless data and rename the `full_data` to `data`
- Remove the deprecated `get_valid_setting` from master branch
  `insights-plugin` does not depend on the master branch
- Re-design the `get_active_setting`
- Remove the filter: Do not filter httpd_conf from now on

* WIP: Version 1
- supported all kinds of sections includes nest-able sections
- revert get_setting_list() and enhance get_active_setting()

* Move `ParsedData` to parser `httpd_conf.py` as a global type
- by moving `ParsedData` simplify the logic of the two 'get_' in combiner
- Improve the dostrings and examples
- Enhance test coverage to 100%

* Enhance get_setting_list and get_active_setting
- get_setting_list returns empty list instead of None when nothing is found
- get_active_setting:
  returns an empty list when section is specified and nothing is found
  returns None when section is not specified and nothing is found
* Adding method from LogFileOutput

* Testing new method

* Now use timestamp formats for error and regular times

* Updated to time_format property, added standard and error formats for ProxyLog
- It's necessary to remove the `filters` because of some plugins, 
  such as load_nfsmod_failed, need to check if their content is empty.
* New method in HttpdConfAll combiner to list sections.
Needed by upcoming httpd hardening rule.

* Fixed docstring, simplified code.

* Fixed a docstring.
* Support mode was missing some config being passed in
The mounts combiner has one performance issue for IBM gpfs running hosts. As this combiner is not necessary, remove it by this MR. Use parsers.mount when you need mount information.
   IBM GPFS internal mount: https://www.ibm.com/support/pages/gpfs-internal-and-external-mount-states

Signed-off-by: Chen lizhong <[email protected]>
Signed-off-by: Xiangce Liu <[email protected]>
- add a script for checking python coverage in insights.tools
- use the script in ci/cd pipelines to check updated python
- Jira: RHINENG-12134

Signed-off-by: Xiangce Liu <[email protected]>
@xiangce xiangce merged commit 26f1c35 into master Sep 12, 2024
4 of 11 checks passed
@xiangce xiangce deleted the coverage_ci branch September 12, 2024 02:06
xiangce added a commit that referenced this pull request Sep 12, 2024
- add a script for checking python coverage in insights.tools
   it can be not "required"
- use the script in ci/cd pipelines to check updated python
- remove unused mocking of os.path.join in test_copy_dir
- Jira: RHINENG-12134

Signed-off-by: Xiangce Liu <[email protected]>
(cherry picked from commit 26f1c35)
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.

8 participants