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=true flag
- 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_protocol hook with a while loop
- Currently, ReportPortal's
pytest_runtest_protocol hook 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_count attribute from pytest-rerunfailures is available and can be used to detect retries
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:
retry=trueflagDescribe alternatives you've considered
Tried to implement
pytest_runtest_setuphook by finishing previous item and starting new throughitem.config.py_test_service.rpwith{"retry": True}in payload ifitem.execution_count > 1, but according to rp client new test item is created but i don't see it under my item in reportportalAdditional context
pytest_runtest_protocolhook with a while looppytest_runtest_protocolhook starts the test once outside the retry loop and finishes it once after all retriesexecution_countattribute from pytest-rerunfailures is available and can be used to detect retries