-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
Is your feature request related to a problem? Please describe.
Currently, rp agent doesn't integrate with pytest-rerunfailures plugin - it reports all retry attempts as a single test execution instead of separate test attempts with proper retry flags.
Describe the solution you'd like
I would like pytest-reportportal to properly integrate with pytest-rerunfailures by:
- Detecting when a test is being retried via pytest-rerunfailures
- Starting a new test item in ReportPortal for EACH retry attempt with
retry=trueflag - Setting proper retry metadata (retry number, total retries)
- Maintaining separate execution history for each retry attempt
Describe alternatives you've considered
Tried to implement pytest_runtest_setup hook by finishing previous item and starting new through item.config.py_test_service.rp with {"retry": True} in payload if item.execution_count > 1, but according to rp client new test item is created but i don't see it under my item in reportportal
Additional context
- pytest-rerunfailures implements retries in
pytest_runtest_protocolhook with a while loop - Currently, ReportPortal's
pytest_runtest_protocolhook starts the test once outside the retry loop and finishes it once after all retries - This causes all retry attempts to be reported under the same test item and without retry flag
- The
execution_countattribute from pytest-rerunfailures is available and can be used to detect retries
Metadata
Metadata
Assignees
Labels
No labels