allankp / pytest-testrail

pytest plugin for integration with TestRail, for creating testruns and updating results
MIT License
96 stars 124 forks source link

Testrail results are not published while using xdist threading #52

Closed apdastous closed 6 years ago

apdastous commented 6 years ago

Normal run which results in test run being created and test results being published: ` $ pytest -v --testrail --tr-url=xxxxxxxxx --tr-email=xxxxxxxxxxxx --tr-password=xxxxxxxxxxxxxx --tr-config=testrail.conf ================================================= test session starts ================================================== platform linux2 -- Python 2.7.12, pytest-3.6.0, py-1.5.3, pluggy-0.6.0 -- /home/apd/virtual_envs/test_xxxx/bin/python2 cachedir: .pytest_cache pytest-testrail: a new testrun will be created rootdir: /home/apd/projects/test_xxxx, inifile: plugins: xdist-1.22.2, testrail-1.1.4, forked-0.2 collecting 8 items [testrail] New testrun created with name "xxxxxxxxxx" and ID=41805 collected 8 items

tests/test_xxxx.py::test_xxxx::test PASSED [ 12%] tests/test_xxxx.py::test_xxxx::test PASSED [ 25%] tests/test_xxxx.py::test_xxxx::test PASSED [ 37%] tests/test_xxxx.py::test_xxxx::test PASSED [ 50%] tests/test_xxxx.py::test_xxxx::test PASSED [ 62%] tests/test_xxxx.py::testrail <- ../../virtual_envs/test_xxxx/local/lib/python2.7/site-packages/pytest_testrail/plugin.py PASSED [ 75%] tests/test_xxxx.py::test_xxxx::test PASSED [ 87%] tests/test_xxxx.py::testrail <- ../../virtual_envs/test_xxxx/local/lib/python2.7/site-packages/pytest_testrail/plugin.py PASSED [100%][testrail] Start publishing [testrail] Testcases to publish: 3809126, 3809127 [testrail] Option "Don't publish blocked testcases" activated [testrail] Blocked testcases excluded: [testrail] End publishing

============================================== 8 passed in 27.70 seconds =============================================== `

With xdist's -n option which results in test run being created but no test results are published: ` $ pytest -v -n 4 --testrail --tr-url=https://xxxxxxxxxxxx/ --tr-email=xxxxxxxxxxx --tr-password=xxxxxxxxxx --tr-config=testrail.conf ================================================= test session starts ================================================== platform linux2 -- Python 2.7.12, pytest-3.6.0, py-1.5.3, pluggy-0.6.0 -- /home/apd/virtual_envs/test_xxxx/bin/python2 cachedir: .pytest_cache pytest-testrail: a new testrun will be created rootdir: /home/apd/projects/test_xxxx, inifile: plugins: xdist-1.22.2, testrail-1.1.4, forked-0.2 [gw0] linux2 Python 2.7.12 cwd: /home/apd/projects/test_xxxx [gw1] linux2 Python 2.7.12 cwd: /home/apd/projects/test_xxxx [gw2] linux2 Python 2.7.12 cwd: /home/apd/projects/test_xxxx [gw3] linux2 Python 2.7.12 cwd: /home/apd/projects/test_xxxx [gw0] Python 2.7.12 (default, Dec 4 2017, 14:50:18) -- [GCC 5.4.0 20160609] [gw2] Python 2.7.12 (default, Dec 4 2017, 14:50:18) -- [GCC 5.4.0 20160609] [gw3] Python 2.7.12 (default, Dec 4 2017, 14:50:18) -- [GCC 5.4.0 20160609] [gw1] Python 2.7.12 (default, Dec 4 2017, 14:50:18) -- [GCC 5.4.0 20160609] gw0 [8] / gw1 [8] / gw2 [8] / gw3 [8] scheduling tests via LoadScheduling

tests/test_adios.py::test_xxxx::test tests/test_adios.py::test_xxxx::test tests/test_adios.py::test_xxxx::test tests/test_adios.py::test_xxxx::test [gw0] [ 12%] PASSED tests/test_xxxx.py::test_xxxx::test tests/test_xxxx.py::test_xxxx::test [gw2] [ 25%] PASSED tests/test_xxxx.py::test_xxxx::test tests/test_xxxx.py::test_xxxx::test [gw1] [ 37%] PASSED tests/test_xxxx.py::test_xxxx::test tests/test_xxxx.py::testrail <- ../../virtual_envs/wqa_adios/local/lib/python2.7/site-packages/pytest_testrail/plugin.py [gw1] [ 50%] PASSED tests/test_xxxx.py::testrail <- ../../virtual_envs/wqa_adios/local/lib/python2.7/site-packages/pytest_testrail/plugin.py [gw3] [ 62%] PASSED tests/test_xxxx.py::test_xxxx::test tests/test_xxxx.py::testrail <- ../../virtual_envs/test_xxxx/local/lib/python2.7/site-packages/pytest_testrail/plugin.py [gw3] [ 75%] PASSED tests/test_xxxx.py::testrail <- ../../virtual_envs/test_xxxx/local/lib/python2.7/site-packages/pytest_testrail/plugin.py [gw0] [ 87%] PASSED tests/test_xxxx.py::test_xxxx::test [gw2] [100%] PASSED tests/test_xxxx.py::test_xxxx::test [testrail] Start publishing [testrail] End publishing `

testrail.conf looks like: [TESTRUN] assignedto_id = 438 project_id = 68 suite_id = 25022 name = xxxxxxxxx

Sorry, had to anonymize a lot of this output. Let me know if anything is unclear.

allankp commented 6 years ago

@apdastous At this time x-dist is not supported

Also why not upgrade to py3 😉