reportportal / agent-python-pytest

Framework integration with PyTest
Apache License 2.0
94 stars 103 forks source link

pytest-reportportal incompatible with pytest 8.0.0 #358

Closed itsMGA closed 5 months ago

itsMGA commented 6 months ago

So I m using pytest-reportportal library to generate rp launch

But for some reason (only happens on ubuntu server, launched via github actions wf) The errors are as follows

collected 403 items / 325 deselected / 78 selected
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/main.py", line 272, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/main.py", line 326, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_hooks.py", line 501, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 181, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_result.py", line 99, in get_result
INTERNALERROR>     raise exc.with_traceback(exc.__traceback__)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 166, in _multicall
INTERNALERROR>     teardown.throw(outcome._exception)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/logging.py", line 796, in pytest_runtestloop
INTERNALERROR>     return (yield)  # Run all the tests.
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 102, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/main.py", line 351, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_hooks.py", line 501, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 181, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_result.py", line 99, in get_result
INTERNALERROR>     raise exc.with_traceback(exc.__traceback__)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 166, in _multicall
INTERNALERROR>     teardown.throw(outcome._exception)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/warnings.py", line 109, in pytest_runtest_protocol
INTERNALERROR>     return (yield)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 166, in _multicall
INTERNALERROR>     teardown.throw(outcome._exception)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/assertion/__init__.py", line 174, in pytest_runtest_protocol
INTERNALERROR>     return (yield)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 87, in _multicall
INTERNALERROR>     next(wrapper_gen)  # first yield
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pytest_reportportal/plugin.py", line 263, in pytest_runtest_protocol
INTERNALERROR>     service.start_pytest_item(item)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pytest_reportportal/service.py", line 123, in wrap
INTERNALERROR>     func(*args, **kwargs)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pytest_reportportal/service.py", line 713, in start_pytest_item
INTERNALERROR>     self._create_suite_path(test_item)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pytest_reportportal/service.py", line 123, in wrap
INTERNALERROR>     func(*args, **kwargs)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pytest_reportportal/service.py", line 462, in _create_suite_path
INTERNALERROR>     path = self._tree_path[item]
INTERNALERROR> KeyError: <Function test_ipsec_domain_address>
itsMGA commented 6 months ago

https://stackoverflow.com/questions/77915735/pytest-reportportal-raises-test-names-key-errors More details here

HardNorth commented 6 months ago

@itsMGA, with no examples which reproduce the case I have no chances to fix this. Pytest is the most popular Agent in Python ecosystem with thousands of users, that means your case is really rare.

orazvaliev commented 6 months ago

@HardNorth we actually have the same issue. Still trying to sort this out

orazvaliev commented 6 months ago

@HardNorth @itsMGA okay it was simple. basically it conflicts with the new pytest 8.0.0

HardNorth commented 6 months ago

@orazvaliev, please provide any example to reproduce.

HardNorth commented 6 months ago

@orazvaliev Ohh, now it makes sense, OK, I'll double-check what it can be.

HardNorth commented 5 months ago

Fixed: https://github.com/reportportal/agent-python-pytest/releases/tag/5.4.0