You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i've been evaluating this plugin with a pet project. it works great when i'm not using xdist. but when i run my tests with -n=2, i get this error:
_ ERROR at setup of TestPhones.test_changing_phone_type_hides_then_shows_number_input_field _
[gw1] linux -- Python 3.8.5 /opt/venv/bin/python3.8
request = <SubRequest 'git_data' for <Function test_verify_report_export_does_not_exist>>
@pytest.fixture(scope="session", autouse=True)
def git_data(request):
"""
Append git information into results session
"""
git_info = dict()
cmds = (
("git_commit_oneline", "git log --oneline -1 --no-decorate"),
("git_commit_sha", "git rev-parse HEAD"),
("git_commit_sha_short", "git rev-parse --short HEAD"),
("git_branch", "git rev-parse --abbrev-ref HEAD"),
("git_repo", "git config --get remote.origin.url"),
)
for key, command in cmds:
try:
git_info[key] = (
subprocess.check_output(command, shell=True, stderr=subprocess.DEVNULL)
.decode("utf-8")
.strip()
)
except subprocess.CalledProcessError:
pass
elk = request.config.pluginmanager.get_plugin("elk-reporter-runtime")
> elk.session_data.update(**git_info)
E AttributeError: 'NoneType' object has no attribute 'session_data'
../venv/lib/python3.8/site-packages/pytest_elk_reporter.py:470: AttributeError
what i think is happening is this test is running on a worker node which means that in pytest-elk-reporter's pytest_configure hook, the ElkReporter plugin is not being created or registered with the pluginmanager.
so that the ElkReporter plugin is created and registered regardless of node, the error goes away. looking at the data from error-free runs i don't see anything that would suggest the data quality suffered.
this leaves me wondering: what behavior is pytest-elk-reporter trying to avoid by only creating and registering the plugin if the test is isn't running on a worker node?
The text was updated successfully, but these errors were encountered:
pharmon-duo
changed the title
what is undesirable about initializing and registering the ElkReporter on a worker node?
question: what is the plugin avoiding by only creating and registering the plugin class on the master node with xdist on?
Apr 22, 2021
hey fruch!
i've been evaluating this plugin with a pet project. it works great when i'm not using xdist. but when i run my tests with
-n=2
, i get this error:what i think is happening is this test is running on a worker node which means that in pytest-elk-reporter's
pytest_configure
hook, theElkReporter
plugin is not being created or registered with the pluginmanager.if i remove this line:
pytest-elk-reporter/pytest_elk_reporter.py
Line 101 in 5247bb0
so that the
ElkReporter
plugin is created and registered regardless of node, the error goes away. looking at the data from error-free runs i don't see anything that would suggest the data quality suffered.this leaves me wondering: what behavior is pytest-elk-reporter trying to avoid by only creating and registering the plugin if the test is isn't running on a worker node?
The text was updated successfully, but these errors were encountered: