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

Run failing when using --allure-severities with xdist(-n 2) option #477

Closed
1 of 3 tasks
jaemedina opened this issue Mar 12, 2020 · 1 comment
Closed
1 of 3 tasks
Labels
bug Something isn't working theme:pytest

Comments

@jaemedina
Copy link

jaemedina commented Mar 12, 2020

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Output

============================= test session starts ==============================
platform darwin -- Python 2.7.10, pytest-4.6.9, py-1.8.0, pluggy-0.13.0
rootdir: /Users/JacobMedina/Documents/selenium, inifile: pytest.ini
plugins: xdist-1.31.0, forked-1.1.3, allure-pytest-2.8.11
gw0 I / gw1 I
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/_pytest/main.py", line 204, in wrap_session
INTERNALERROR> config.hook.pytest_sessionstart(session=session)
INTERNALERROR> File "/Library/Python/2.7/site-packages/pluggy/hooks.py", line 286, in call
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/Library/Python/2.7/site-packages/pluggy/manager.py", line 92, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/Library/Python/2.7/site-packages/pluggy/manager.py", line 86, in
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/Library/Python/2.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/Library/Python/2.7/site-packages/pluggy/callers.py", line 81, in get_result
INTERNALERROR> _reraise(*ex) # noqa
INTERNALERROR> File "/Library/Python/2.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/xdist/dsession.py", line 78, in pytest_sessionstart
INTERNALERROR> nodes = self.nodemanager.setup_nodes(putevent=self.queue.put)
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/xdist/workermanage.py", line 64, in setup_nodes
INTERNALERROR> nodes.append(self.setup_node(spec, putevent))
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/xdist/workermanage.py", line 73, in setup_node
INTERNALERROR> node.setup()
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/xdist/workermanage.py", line 264, in setup
INTERNALERROR> self.channel.send((self.workerinput, args, option_dict, change_sys_path))
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/execnet/gateway_base.py", line 729, in send
INTERNALERROR> self.gateway._send(Message.CHANNEL_DATA, self.id, dumps_internal(item))
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/execnet/gateway_base.py", line 1371, in dumps_internal
INTERNALERROR> return _Serializer().save(obj)
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/execnet/gateway_base.py", line 1389, in save
INTERNALERROR> self._save(obj)
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/execnet/gateway_base.py", line 1407, in _save
INTERNALERROR> dispatch(self, obj)
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/execnet/gateway_base.py", line 1494, in save_tuple
INTERNALERROR> self._save(item)
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/execnet/gateway_base.py", line 1407, in _save
INTERNALERROR> dispatch(self, obj)
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/execnet/gateway_base.py", line 1490, in save_dict
INTERNALERROR> self._write_setitem(key, value)
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/execnet/gateway_base.py", line 1484, in _write_setitem
INTERNALERROR> self._save(value)
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/execnet/gateway_base.py", line 1407, in _save
INTERNALERROR> dispatch(self, obj)
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/execnet/gateway_base.py", line 1505, in save_set
INTERNALERROR> self._write_set(s, opcode.SET)
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/execnet/gateway_base.py", line 1500, in _write_set
INTERNALERROR> self._save(item)
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/execnet/gateway_base.py", line 1407, in _save
INTERNALERROR> dispatch(self, obj)
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/execnet/gateway_base.py", line 1494, in save_tuple
INTERNALERROR> self._save(item)
INTERNALERROR> File "/Users/JacobMedina/Library/Python/2.7/lib/python/site-packages/execnet/gateway_base.py", line 1405, in _save
INTERNALERROR> raise DumpError("can't serialize {}".format(tp))
INTERNALERROR> DumpError: can't serialize <enum 'Severity'>


If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

@allure.severity(allure.severity_level.CRITICAL)
def critical_test_1():
print('Hi')

@allure.severity(allure.severity_level.CRITICAL)
def critical_test_2():
print('Hi')


execute:
$ pytest PATH/TO/TEST.py --allure-severities critical --alluredir=./allure-result -n 2
The tests do not run and it outputs the error I pasted above.

What is the expected behavior?

Select the critical cases and run them in parallel with xdist.

What is the motivation / use case for changing the behavior?

The current workaround is to use both @allure.severity() and @pytest.mark.critical, with pytest -m critical so that allure generates critical test results and critical tests can be run in parallel. It would be more convenient to just use Allure's severity marking to handle both.

Please tell us about your environment:

  • Allure version: 2.13.0
  • Test framework: pytest@4.6.9
  • Allure adaptor: allure-pytest@2.8.11
  • Xdist: 1.31.0

Other information

@delatrie
Copy link
Contributor

Starting from 5.1.0 pytest provides config.invocation_params property containing unchanged arguments passed to pytest.main() which xdist prefers to use instead of full-blown config.options (where the troublesome severity value is sitting). See pytest-dev/pytest#5564.

Hence, this issue is not relevant anymore. Just update to pytest 5.1.0+ and you`re good.

@delatrie delatrie closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2022
@delatrie delatrie added bug Something isn't working theme:pytest labels Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working theme:pytest
Projects
None yet
Development

No branches or pull requests

2 participants