Several people asked for support of pytest-monitor also monitoring failing tests. This PR includes the necessary changes for this feature.
Changes made in overview:
Extending database table TEST_METRICS with a column TEST_PASSED to make failing and passing test logs in database distinguishable
Setting an attribute "passed" that is handed to add_test_info() call, indicating if the test passed or not (for database entry)
Moving memory profiler module into own module inside codebase (unmaintained) and doing the necessary changes to report the memory usage of functions raising Exceptions [see next section].
Adding logic for auto-migrating old databases to include the new column.
Adding a cmd option to disable monitoring failed tests, monitoring failed tests is the standard
The memory profiler change
In order to get the memory usage of failing functions, the memory_profiler module had to be changed. The first approach was to make a PR on the memory_profiler project, this was marked as unmaintained though.
My options were to
1) use another profiler instead or
2) just simplify the profiler logic and include it in the pytest-monitor plugin itself.
I went with the second option in order to avoid big dependencies like Xray which furthermore would have needed socket based communication. This is why I introduced a new module profiler.py into the codebase being responsible for memory profiling (by making use of Process class and psutils).
Type of change
[x] New feature (non-breaking change which adds functionality)
[x] This change requires a documentation update
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes (not just the CI)
~- [ ] Any dependent changes have been merged and published in downstream modules~
[x] I have provided a link to the issue this PR adresses in the Description section above (If there is none yet,
create one !)
@js-dieu I decided to propose my changes independent on what the original plans were, maybe it is of help, maybe not. However, this is my take on the issue.
Description
Fixes issue #65 .
DEPENDS ON: #79 (#80), https://github.com/CFMTech/pytest-monitor/pull/78
Several people asked for support of pytest-monitor also monitoring failing tests. This PR includes the necessary changes for this feature.
Changes made in overview:
TEST_METRICS
with a columnTEST_PASSED
to make failing and passing test logs in database distinguishableThe memory profiler change
In order to get the memory usage of failing functions, the memory_profiler module had to be changed. The first approach was to make a PR on the memory_profiler project, this was marked as unmaintained though.
My options were to 1) use another profiler instead or 2) just simplify the profiler logic and include it in the pytest-monitor plugin itself.
I went with the second option in order to avoid big dependencies like Xray which furthermore would have needed socket based communication. This is why I introduced a new module profiler.py into the codebase being responsible for memory profiling (by making use of Process class and psutils).
Type of change
Checklist:
Status: Code Review Needed
,Business: Test Needed
orStatus: In Progress
if you are still working on the PR)@js-dieu I decided to propose my changes independent on what the original plans were, maybe it is of help, maybe not. However, this is my take on the issue.