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

Add tcms-api calls to pytest plugin. #30

Closed
wants to merge 3 commits into from

Conversation

brymut
Copy link
Contributor

@brymut brymut commented Jan 9, 2021

Add tcms-api calls to pytest plugin to communicate and report test results Kiwi TCMS.

still wip.

@brymut
Copy link
Contributor Author

brymut commented Jan 9, 2021

Running into a problem with XML-RPC client, protocol error 431, line too long. Still need to it work out and add testing.

@brymut
Copy link
Contributor Author

brymut commented Jan 9, 2021

`=========================================================================================== test session starts ===========================================================================================
platform darwin -- Python 3.7.8, pytest-6.2.1, py-1.10.0, pluggy-0.13.1
rootdir: /Users/bryanmutai/open-source/pytest-plugin
plugins: Faker-5.0.1, kiwitcms-pytest-plugin-0.1.0
collected 7 items

tests/test_pytest_kiwitcms.py F
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in call
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 348, in pytest_runtestloop
INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in call
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/runner.py", line 109, in pytest_runtest_protocol
INTERNALERROR> runtestprotocol(item, nextitem=nextitem)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/runner.py", line 127, in runtestprotocol
INTERNALERROR> reports.append(call_and_report(item, "teardown", log, nextitem=nextitem))
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/runner.py", line 219, in call_and_report
INTERNALERROR> hook.pytest_runtest_logreport(report=report)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in call
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/terminal.py", line 519, in pytest_runtest_logreport
INTERNALERROR> ] = self.config.hook.pytest_report_teststatus(report=rep, config=self.config)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in call
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 203, in _multicall
INTERNALERROR> gen.send(outcome)
INTERNALERROR> File "/Users/bryanmutai/open-source/pytest-plugin/tcms_pytest_plugin/plugin.py", line 46, in pytest_report_teststatus
INTERNALERROR> self.status_id = backend.get_status_id('PASSED')
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 133, in get_status_id
INTERNALERROR> 'name': name
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1112, in call
INTERNALERROR> return self.__send(self.__name, args)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1452, in __request
INTERNALERROR> verbose=self.__verbose
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1154, in request
INTERNALERROR> return self.single_request(host, handler, request_body, verbose)
INTERNALERROR> File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1187, in single_request
INTERNALERROR> dict(resp.getheaders())
INTERNALERROR> xmlrpc.client.ProtocolError: <ProtocolError for 127.0.0.1:8000/xml-rpc/: 431 Line too long>

=========================================================================================== 1 failed in 16.40s ============================================================================================

@brymut brymut marked this pull request as ready for review January 9, 2021 16:08
@brymut brymut force-pushed the new-plugin branch 2 times, most recently from 52ffdcf to 20a9792 Compare January 10, 2021 04:34
@atodorov
Copy link
Member

Let's start by using the same way to kick off the tests. I'm trying to start the plugin from the current git checkout without installing it (b/c I want to avoid installing every time something changes) with the following command:

PYTHONPATH=. pytest -p tcms_pytest_plugin

and I do get a different result than you:

$ PYTHONPATH=. pytest -p tcms_pytest_plugin
========================================================== test session starts ===========================================================
platform linux -- Python 3.6.12, pytest-6.2.1, py-1.10.0, pluggy-0.13.1
rootdir: /home/senko/pytest-plugin
collected 7 items                                                                                                                        

tests/test_pytest_kiwitcms.py FFFFFF.                                                                                              [100%]

================================================================ FAILURES ================================================================
________________________________________________________ test_file_configuration _________________________________________________________

testdir = <Testdir local('/tmp/pytest-of-senko/pytest-6/test_file_configuration1')>

    @pytest.mark.usefixtures("config_file")
    def test_file_configuration(testdir):
        """Load configuration from ~/.tcms.conf."""
        testdir.makepyfile(
            """
            def test_file_configuration(pytestconfig):
                plugin = pytestconfig.pluginmanager.get_plugin("pytest-kiwitcms")
                assert plugin.api_url == "http://example.com"
                assert plugin.username == "admin"
                assert plugin.password == "secret"
        """
        )
        result = testdir.runpytest("--kiwitcms", "-v")
>       result.stdout.fnmatch_lines(["*::test_file_configuration PASSED*"])
E       Failed: remains unmatched: '*::test_file_configuration PASSED*'

/home/senko/pytest-plugin/tests/test_pytest_kiwitcms.py:27: Failed
---------------------------------------------------------- Captured stderr call ----------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --kiwitcms
  inifile: None
  rootdir: /tmp/pytest-of-senko/pytest-6/test_file_configuration1

_________________________________________________________ test_env_configuration _________________________________________________________

testdir = <Testdir local('/tmp/pytest-of-senko/pytest-6/test_env_configuration0')>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f4a663b8f60>

    def test_env_configuration(testdir, monkeypatch):
        """If ~/.tcms.conf doesn't exist - use env variables."""
        for envvar, value in DEFAULT_CONFIG:
            monkeypatch.setenv(envvar, value)
        testdir.makepyfile(
            """
            def test_env_configuration(pytestconfig):
                plugin = pytestconfig.pluginmanager.get_plugin("pytest-kiwitcms")
                assert plugin.api_url == "http://another.com"
                assert plugin.username == "user"
                assert plugin.password == "random"
            """
        )
        result = testdir.runpytest("--kiwitcms", "-v")
>       result.stdout.fnmatch_lines(["*::test_env_configuration PASSED*"])
E       Failed: remains unmatched: '*::test_env_configuration PASSED*'

/home/senko/pytest-plugin/tests/test_pytest_kiwitcms.py:45: Failed
---------------------------------------------------------- Captured stderr call ----------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --kiwitcms
  inifile: None
  rootdir: /tmp/pytest-of-senko/pytest-6/test_env_configuration0

______________________________________ test_config_file_precedence[TCMS_API_URL-http://another.com] ______________________________________

testdir = <Testdir local('/tmp/pytest-of-senko/pytest-6/test_config_file_precedence0')>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f4a66324438>, envvar = 'TCMS_API_URL', value = 'http://another.com'

    @pytest.mark.parametrize("envvar, value", DEFAULT_CONFIG)
    @pytest.mark.usefixtures("config_file")
    def test_config_file_precedence(testdir, monkeypatch, envvar, value):
        """Values from ~/.tcms.conf have higher priority than env variables."""
        monkeypatch.setenv(envvar, value)
        testdir.makepyfile(
            """
            def test_config_file_precedence(pytestconfig):
                plugin = pytestconfig.pluginmanager.get_plugin("pytest-kiwitcms")
                assert plugin.api_url == "http://example.com"
                assert plugin.username == "admin"
                assert plugin.password == "secret"
            """
        )
        result = testdir.runpytest("--kiwitcms", "-v")
>       result.stdout.fnmatch_lines(["*::test_config_file_precedence PASSED*"])
E       Failed: remains unmatched: '*::test_config_file_precedence PASSED*'

/home/senko/pytest-plugin/tests/test_pytest_kiwitcms.py:64: Failed
---------------------------------------------------------- Captured stderr call ----------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --kiwitcms
  inifile: None
  rootdir: /tmp/pytest-of-senko/pytest-6/test_config_file_precedence0

____________________________________________ test_config_file_precedence[TCMS_USERNAME-user] _____________________________________________

testdir = <Testdir local('/tmp/pytest-of-senko/pytest-6/test_config_file_precedence1')>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f4a66301588>, envvar = 'TCMS_USERNAME', value = 'user'

    @pytest.mark.parametrize("envvar, value", DEFAULT_CONFIG)
    @pytest.mark.usefixtures("config_file")
    def test_config_file_precedence(testdir, monkeypatch, envvar, value):
        """Values from ~/.tcms.conf have higher priority than env variables."""
        monkeypatch.setenv(envvar, value)
        testdir.makepyfile(
            """
            def test_config_file_precedence(pytestconfig):
                plugin = pytestconfig.pluginmanager.get_plugin("pytest-kiwitcms")
                assert plugin.api_url == "http://example.com"
                assert plugin.username == "admin"
                assert plugin.password == "secret"
            """
        )
        result = testdir.runpytest("--kiwitcms", "-v")
>       result.stdout.fnmatch_lines(["*::test_config_file_precedence PASSED*"])
E       Failed: remains unmatched: '*::test_config_file_precedence PASSED*'

/home/senko/pytest-plugin/tests/test_pytest_kiwitcms.py:64: Failed
---------------------------------------------------------- Captured stderr call ----------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --kiwitcms
  inifile: None
  rootdir: /tmp/pytest-of-senko/pytest-6/test_config_file_precedence1

___________________________________________ test_config_file_precedence[TCMS_PASSWORD-random] ____________________________________________

testdir = <Testdir local('/tmp/pytest-of-senko/pytest-6/test_config_file_precedence2')>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f4a663b87f0>, envvar = 'TCMS_PASSWORD', value = 'random'

    @pytest.mark.parametrize("envvar, value", DEFAULT_CONFIG)
    @pytest.mark.usefixtures("config_file")
    def test_config_file_precedence(testdir, monkeypatch, envvar, value):
        """Values from ~/.tcms.conf have higher priority than env variables."""
        monkeypatch.setenv(envvar, value)
        testdir.makepyfile(
            """
            def test_config_file_precedence(pytestconfig):
                plugin = pytestconfig.pluginmanager.get_plugin("pytest-kiwitcms")
                assert plugin.api_url == "http://example.com"
                assert plugin.username == "admin"
                assert plugin.password == "secret"
            """
        )
        result = testdir.runpytest("--kiwitcms", "-v")
>       result.stdout.fnmatch_lines(["*::test_config_file_precedence PASSED*"])
E       Failed: remains unmatched: '*::test_config_file_precedence PASSED*'

/home/senko/pytest-plugin/tests/test_pytest_kiwitcms.py:64: Failed
---------------------------------------------------------- Captured stderr call ----------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --kiwitcms
  inifile: None
  rootdir: /tmp/pytest-of-senko/pytest-6/test_config_file_precedence2

__________________________________________________________ test_empty_variable ___________________________________________________________

testdir = <Testdir local('/tmp/pytest-of-senko/pytest-6/test_empty_variable0')>

    def test_empty_variable(testdir):
        """Any empty value in config variables will lead to program exiting."""
        testdir.makepyfile(
            """
            def test_empty_variable(pytestconfig):
                plugin = pytestconfig.pluginmanager.get_plugin("pytest-kiwitcms")
            """
        )
        result = testdir.runpytest("--kiwitcms", "-v")
>       result.stderr.fnmatch_lines(["Exit: Option api_url is empty"])
E       Failed: nomatch: 'Exit: Option api_url is empty'
E           and: 'ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]'
E           and: 'pytest: error: unrecognized arguments: --kiwitcms'
E           and: '  inifile: None'
E           and: '  rootdir: /tmp/pytest-of-senko/pytest-6/test_empty_variable0'
E           and: ''
E       remains unmatched: 'Exit: Option api_url is empty'

/home/senko/pytest-plugin/tests/test_pytest_kiwitcms.py:77: Failed
---------------------------------------------------------- Captured stderr call ----------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --kiwitcms
  inifile: None
  rootdir: /tmp/pytest-of-senko/pytest-6/test_empty_variable0

======================================================== short test summary info =========================================================
FAILED tests/test_pytest_kiwitcms.py::test_file_configuration - Failed: remains unmatched: '*::test_file_configuration PASSED*'
FAILED tests/test_pytest_kiwitcms.py::test_env_configuration - Failed: remains unmatched: '*::test_env_configuration PASSED*'
FAILED tests/test_pytest_kiwitcms.py::test_config_file_precedence[TCMS_API_URL-http://another.com] - Failed: remains unmatched: '*::tes...
FAILED tests/test_pytest_kiwitcms.py::test_config_file_precedence[TCMS_USERNAME-user] - Failed: remains unmatched: '*::test_config_file...
FAILED tests/test_pytest_kiwitcms.py::test_config_file_precedence[TCMS_PASSWORD-random] - Failed: remains unmatched: '*::test_config_fi...
FAILED tests/test_pytest_kiwitcms.py::test_empty_variable - Failed: nomatch: 'Exit: Option api_url is empty'
====================================================== 6 failed, 1 passed in 0.32s =======================================================

So am I starting the plugin correctly ? If no what's your command then ?

@@ -76,3 +76,27 @@ def test_empty_variable(pytestconfig):
result = testdir.runpytest("--kiwitcms", "-v")
result.stderr.fnmatch_lines(["Exit: Option api_url is empty"])
assert result.ret == 1


def test_kiwitcms_pytest(testdir):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are other test functions in this file which are using the config_test fixture which contains the URL http://example.com which is a real URL serving HTTP but nothing to do with Kiwi TCMS. Can that also be a source of your issues ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, will try this out as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the issue

@brymut
Copy link
Contributor Author

brymut commented Jan 10, 2021

oh right, I am using pytest --kiwitcms. @atodorov I can confirm that the error consistently happens on my end when I run using the --kiwitcms but works as expected when run using PYTHONPATH=. pytest -p tcms_pytest_plugin

@atodorov
Copy link
Member

OK, we've got to start speaking the same language here.

oh right, I am using pytest --kiwitcms.

Explain how you setup your environment ? When I try executing this command I get:

ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --kiwitcms
  inifile: None
  rootdir: /home/senko/pytest-plugin

The only way I can figure out how to do this is to actually install the plugin into the venv. Which means I have to install it every time when there's a change in the source code. Otherwise you will be running the installed version, not what is in the git checkout. So I need more details here.

@atodorov I can confirm that the error consistently happens on my end when I run using the --kiwitcms

Is that the error from your original comment that you are talking about? If that's the case formatting the traceback for readability will be mighty helpful.

but works as expected when run using PYTHONPATH=. pytest -p tcms_pytest_plugin

What does "as expected" mean here? When I run this command I get a bunch of errors listed above. Are you getting the same errors or a different result? If different then what exactly ?

@brymut
Copy link
Contributor Author

brymut commented Jan 11, 2021

Explain how you set up your environment? When I try executing this command I get:

I installed using pip install -e tcms_pytest_plugin I think installs it in an editable mode, I haven't had to reinstall every time I edit source. I remember doing the same for the django plugin.

Is that the error from your original comment that you are talking about? If that's the case formatting the traceback for readability will be mighty helpful.

Yes, I'm constantly getting an error from the xmlrpc client xmlrpc.client.ProtocolError: <ProtocolError for 127.0.0.1:8000/xml-rpc/: 431 Line too long>
The full log:

(pytest-plugin) bryanmutai@cexs-MacBook-Pro pytest-plugin % pytest --kiwitcms                        
====================================================================================== test session starts ======================================================================================
platform darwin -- Python 3.7.8, pytest-6.2.1, py-1.10.0, pluggy-0.13.1
rootdir: /Users/bryanmutai/open-source/pytest-plugin
plugins: Faker-5.0.1, kiwitcms-pytest-plugin-0.1.0
collected 7 items                                                                                                                                                                               

tests/test_pytest_kiwitcms.py F
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 348, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/runner.py", line 109, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/runner.py", line 127, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "teardown", log, nextitem=nextitem))
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/runner.py", line 219, in call_and_report
INTERNALERROR>     hook.pytest_runtest_logreport(report=report)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/terminal.py", line 519, in pytest_runtest_logreport
INTERNALERROR>     ] = self.config.hook.pytest_report_teststatus(report=rep, config=self.config)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/Users/bryanmutai/open-source/pytest-plugin/tcms_pytest_plugin/plugin.py", line 48, in pytest_report_teststatus
INTERNALERROR>     self.status_id = backend.get_status_id('PASSED')
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 133, in get_status_id
INTERNALERROR>     'name': name
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1112, in __call__
INTERNALERROR>     return self.__send(self.__name, args)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1452, in __request
INTERNALERROR>     verbose=self.__verbose
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1154, in request
INTERNALERROR>     return self.single_request(host, handler, request_body, verbose)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1187, in single_request
INTERNALERROR>     dict(resp.getheaders())
INTERNALERROR> xmlrpc.client.ProtocolError: <ProtocolError for 127.0.0.1:8000/xml-rpc/: 431 Line too long>

====================================================================================== 1 failed in 16.56s =======================================================================================

It looks like its failing whenever when trying to get the status Id of the test execution INTERNALERROR> self.status_id = backend.get_status_id('PASSED')

What does "as expected" mean here? When I run this command I get a bunch of errors listed above. Are you getting the same errors or a different result? If different then what exactly ?

Sorry, I should've been more clear, I meant when I run using PYTHONPATH=. pytest -p tcms_pytest_plugin that the pytest test run completes with the full report of the test results as shown when you run it in this comment without ending early with the xmlrpc.client.ProtocolError: <ProtocolError for 127.0.0.1:8000/xml-rpc/: 431 Line too long> I'm getting.

Actually, I'm still not getting your result when I run using PYTHONPATH=. pytest -p tcms_pytest_plugin I also, still get the xmlrpc.client.ProtocolError: <ProtocolError for 127.0.0.1:8000/xml-rpc/: 431 Line too long> from the xmlrpc client multiple times within each test result, the difference is that the test runner completes all the tests.

pytest-plugin) bryanmutai@cexs-MacBook-Pro pytest-plugin % PYTHONPATH=. pytest -p tcms_pytest_plugin
====================================================================================== test session starts ======================================================================================
platform darwin -- Python 3.7.8, pytest-6.2.1, py-1.10.0, pluggy-0.13.1
rootdir: /Users/bryanmutai/open-source/pytest-plugin
plugins: kiwitcms-pytest-plugin-0.1.0, Faker-5.0.1
collected 7 items                                                                                                                                                                               

tests/test_pytest_kiwitcms.py FFFFFF.                                                                                                                                                     [100%]

=========================================================================================== FAILURES ============================================================================================
____________________________________________________________________________________ test_file_configuration ____________________________________________________________________________________

testdir = <Testdir local('/private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_file_configuration1')>

    @pytest.mark.usefixtures("config_file")
    def test_file_configuration(testdir):
        """Load configuration from ~/.tcms.conf."""
        testdir.makepyfile(
            """
            def test_file_configuration(pytestconfig):
                plugin = pytestconfig.pluginmanager.get_plugin("pytest-kiwitcms")
                assert plugin.api_url == "http://example.com"
                assert plugin.username == "admin"
                assert plugin.password == "secret"
        """
        )
        result = testdir.runpytest("--kiwitcms", "-v")
>       result.stdout.fnmatch_lines(["*::test_file_configuration PASSED*"])
E       Failed: nomatch: '*::test_file_configuration PASSED*'
E           and: '============================= test session starts =============================='
E           and: 'platform darwin -- Python 3.7.8, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/bin/python3.7'
E           and: 'cachedir: .pytest_cache'
E           and: 'rootdir: /private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_file_configuration1'
E           and: 'plugins: kiwitcms-pytest-plugin-0.1.0, Faker-5.0.1'
E           and: 'collecting ... collected 1 item'
E           and: ''
E           and: 'test_file_configuration.py::test_file_configuration FAILED               [100%]'
E           and: ''
E           and: '=================================== FAILURES ==================================='
E           and: '___________________________ test_file_configuration ____________________________'
E           and: ''
E           and: 'pytestconfig = <_pytest.config.Config object at 0x10dedfc10>'
E           and: ''
E           and: '    def test_file_configuration(pytestconfig):'
E           and: '        plugin = pytestconfig.pluginmanager.get_plugin("pytest-kiwitcms")'
E           and: '>       assert plugin.api_url == "http://example.com"'
E           and: "E       AttributeError: 'KiwiTCMSPlugin' object has no attribute 'api_url'"
E           and: ''
E           and: 'test_file_configuration.py:3: AttributeError'
E           and: '=========================== short test summary info ============================'
E           and: 'FAILED test_file_configuration.py::test_file_configuration - AttributeError: ...'
E           and: '============================== 1 failed in 11.72s =============================='
E       remains unmatched: '*::test_file_configuration PASSED*'

/Users/bryanmutai/open-source/pytest-plugin/tests/test_pytest_kiwitcms.py:27: Failed
------------------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------------------
============================= test session starts ==============================
platform darwin -- Python 3.7.8, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/bin/python3.7
cachedir: .pytest_cache
rootdir: /private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_file_configuration1
plugins: kiwitcms-pytest-plugin-0.1.0, Faker-5.0.1
collecting ... collected 1 item

test_file_configuration.py::test_file_configuration FAILED               [100%]

=================================== FAILURES ===================================
___________________________ test_file_configuration ____________________________

pytestconfig = <_pytest.config.Config object at 0x10dedfc10>

    def test_file_configuration(pytestconfig):
        plugin = pytestconfig.pluginmanager.get_plugin("pytest-kiwitcms")
>       assert plugin.api_url == "http://example.com"
E       AttributeError: 'KiwiTCMSPlugin' object has no attribute 'api_url'

test_file_configuration.py:3: AttributeError
=========================== short test summary info ============================
FAILED test_file_configuration.py::test_file_configuration - AttributeError: ...
============================== 1 failed in 11.72s ==============================
____________________________________________________________________________________ test_env_configuration _____________________________________________________________________________________

testdir = <Testdir local('/private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_env_configuration0')>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x10df7d550>

    def test_env_configuration(testdir, monkeypatch):
        """If ~/.tcms.conf doesn't exist - use env variables."""
        for envvar, value in DEFAULT_CONFIG:
            monkeypatch.setenv(envvar, value)
        testdir.makepyfile(
            """
            def test_env_configuration(pytestconfig):
                plugin = pytestconfig.pluginmanager.get_plugin("pytest-kiwitcms")
                assert plugin.api_url == "http://another.com"
                assert plugin.username == "user"
                assert plugin.password == "random"
            """
        )
        result = testdir.runpytest("--kiwitcms", "-v")
>       result.stdout.fnmatch_lines(["*::test_env_configuration PASSED*"])
E       Failed: nomatch: '*::test_env_configuration PASSED*'
E           and: '============================= test session starts =============================='
E           and: 'platform darwin -- Python 3.7.8, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/bin/python3.7'
E           and: 'cachedir: .pytest_cache'
E           and: 'rootdir: /private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_env_configuration0'
E           and: 'plugins: kiwitcms-pytest-plugin-0.1.0, Faker-5.0.1'
E           and: 'collecting ... collected 1 item'
E           and: 'INTERNALERROR> Traceback (most recent call last):'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 269, in wrap_session'
E           and: 'INTERNALERROR>     session.exitstatus = doit(config, session) or 0'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 323, in _main'
E           and: 'INTERNALERROR>     config.hook.pytest_runtestloop(session=session)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__'
E           and: 'INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec'
E           and: 'INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 337, in traced_hookexec'
E           and: 'INTERNALERROR>     return outcome.get_result()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result'
E           and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 52, in from_call'
E           and: 'INTERNALERROR>     result = func()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 335, in <lambda>'
E           and: 'INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>'
E           and: 'INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall'
E           and: 'INTERNALERROR>     return outcome.get_result()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result'
E           and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall'
E           and: 'INTERNALERROR>     res = hook_impl.function(*args)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/open-source/pytest-plugin/tcms_pytest_plugin/plugin.py", line 36, in pytest_runtestloop'
E           and: 'INTERNALERROR>     backend.configure()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 77, in configure'
E           and: 'INTERNALERROR>     self.run_id = self.get_run_id()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 413, in get_run_id'
E           and: 'INTERNALERROR>     for case in self.rpc.TestRun.get_cases(run_id):'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1112, in __call__'
E           and: 'INTERNALERROR>     return self.__send(self.__name, args)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1452, in __request'
E           and: 'INTERNALERROR>     verbose=self.__verbose'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1154, in request'
E           and: 'INTERNALERROR>     return self.single_request(host, handler, request_body, verbose)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1187, in single_request'
E           and: 'INTERNALERROR>     dict(resp.getheaders())'
E           and: 'INTERNALERROR> xmlrpc.client.ProtocolError: <ProtocolError for 127.0.0.1:8000/xml-rpc/: 431 Line too long>'
E           and: ''
E           and: '============================ no tests ran in 4.85s ============================='
E       remains unmatched: '*::test_env_configuration PASSED*'

/Users/bryanmutai/open-source/pytest-plugin/tests/test_pytest_kiwitcms.py:45: Failed
------------------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------------------
============================= test session starts ==============================
platform darwin -- Python 3.7.8, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/bin/python3.7
cachedir: .pytest_cache
rootdir: /private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_env_configuration0
plugins: kiwitcms-pytest-plugin-0.1.0, Faker-5.0.1
collecting ... collected 1 item
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 337, in traced_hookexec
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 52, in from_call
INTERNALERROR>     result = func()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 335, in <lambda>
INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/bryanmutai/open-source/pytest-plugin/tcms_pytest_plugin/plugin.py", line 36, in pytest_runtestloop
INTERNALERROR>     backend.configure()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 77, in configure
INTERNALERROR>     self.run_id = self.get_run_id()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 413, in get_run_id
INTERNALERROR>     for case in self.rpc.TestRun.get_cases(run_id):
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1112, in __call__
INTERNALERROR>     return self.__send(self.__name, args)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1452, in __request
INTERNALERROR>     verbose=self.__verbose
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1154, in request
INTERNALERROR>     return self.single_request(host, handler, request_body, verbose)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1187, in single_request
INTERNALERROR>     dict(resp.getheaders())
INTERNALERROR> xmlrpc.client.ProtocolError: <ProtocolError for 127.0.0.1:8000/xml-rpc/: 431 Line too long>

============================ no tests ran in 4.85s =============================
_________________________________________________________________ test_config_file_precedence[TCMS_API_URL-http://another.com] __________________________________________________________________

testdir = <Testdir local('/private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_config_file_precedence0')>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x10dfdd6d0>, envvar = 'TCMS_API_URL', value = 'http://another.com'

    @pytest.mark.parametrize("envvar, value", DEFAULT_CONFIG)
    @pytest.mark.usefixtures("config_file")
    def test_config_file_precedence(testdir, monkeypatch, envvar, value):
        """Values from ~/.tcms.conf have higher priority than env variables."""
        monkeypatch.setenv(envvar, value)
        testdir.makepyfile(
            """
            def test_config_file_precedence(pytestconfig):
                plugin = pytestconfig.pluginmanager.get_plugin("pytest-kiwitcms")
                assert plugin.api_url == "http://example.com"
                assert plugin.username == "admin"
                assert plugin.password == "secret"
            """
        )
        result = testdir.runpytest("--kiwitcms", "-v")
>       result.stdout.fnmatch_lines(["*::test_config_file_precedence PASSED*"])
E       Failed: nomatch: '*::test_config_file_precedence PASSED*'
E           and: '============================= test session starts =============================='
E           and: 'platform darwin -- Python 3.7.8, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/bin/python3.7'
E           and: 'cachedir: .pytest_cache'
E           and: 'rootdir: /private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_config_file_precedence0'
E           and: 'plugins: kiwitcms-pytest-plugin-0.1.0, Faker-5.0.1'
E           and: 'collecting ... collected 1 item'
E           and: 'INTERNALERROR> Traceback (most recent call last):'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 269, in wrap_session'
E           and: 'INTERNALERROR>     session.exitstatus = doit(config, session) or 0'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 323, in _main'
E           and: 'INTERNALERROR>     config.hook.pytest_runtestloop(session=session)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__'
E           and: 'INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec'
E           and: 'INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 337, in traced_hookexec'
E           and: 'INTERNALERROR>     return outcome.get_result()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result'
E           and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 52, in from_call'
E           and: 'INTERNALERROR>     result = func()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 335, in <lambda>'
E           and: 'INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>'
E           and: 'INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall'
E           and: 'INTERNALERROR>     return outcome.get_result()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result'
E           and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall'
E           and: 'INTERNALERROR>     res = hook_impl.function(*args)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/open-source/pytest-plugin/tcms_pytest_plugin/plugin.py", line 36, in pytest_runtestloop'
E           and: 'INTERNALERROR>     backend.configure()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 77, in configure'
E           and: 'INTERNALERROR>     self.run_id = self.get_run_id()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 389, in get_run_id'
E           and: 'INTERNALERROR>     product_id, product_name = self.get_product_id(0)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 164, in get_product_id'
E           and: "INTERNALERROR>     test_plan = self.rpc.TestPlan.filter({'pk': plan_id})"
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1112, in __call__'
E           and: 'INTERNALERROR>     return self.__send(self.__name, args)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1452, in __request'
E           and: 'INTERNALERROR>     verbose=self.__verbose'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1154, in request'
E           and: 'INTERNALERROR>     return self.single_request(host, handler, request_body, verbose)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1187, in single_request'
E           and: 'INTERNALERROR>     dict(resp.getheaders())'
E           and: 'INTERNALERROR> xmlrpc.client.ProtocolError: <ProtocolError for 127.0.0.1:8000/xml-rpc/: 431 Line too long>'
E           and: ''
E           and: '============================ no tests ran in 0.01s ============================='
E       remains unmatched: '*::test_config_file_precedence PASSED*'

/Users/bryanmutai/open-source/pytest-plugin/tests/test_pytest_kiwitcms.py:64: Failed
------------------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------------------
============================= test session starts ==============================
platform darwin -- Python 3.7.8, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/bin/python3.7
cachedir: .pytest_cache
rootdir: /private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_config_file_precedence0
plugins: kiwitcms-pytest-plugin-0.1.0, Faker-5.0.1
collecting ... collected 1 item
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 337, in traced_hookexec
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 52, in from_call
INTERNALERROR>     result = func()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 335, in <lambda>
INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/bryanmutai/open-source/pytest-plugin/tcms_pytest_plugin/plugin.py", line 36, in pytest_runtestloop
INTERNALERROR>     backend.configure()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 77, in configure
INTERNALERROR>     self.run_id = self.get_run_id()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 389, in get_run_id
INTERNALERROR>     product_id, product_name = self.get_product_id(0)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 164, in get_product_id
INTERNALERROR>     test_plan = self.rpc.TestPlan.filter({'pk': plan_id})
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1112, in __call__
INTERNALERROR>     return self.__send(self.__name, args)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1452, in __request
INTERNALERROR>     verbose=self.__verbose
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1154, in request
INTERNALERROR>     return self.single_request(host, handler, request_body, verbose)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1187, in single_request
INTERNALERROR>     dict(resp.getheaders())
INTERNALERROR> xmlrpc.client.ProtocolError: <ProtocolError for 127.0.0.1:8000/xml-rpc/: 431 Line too long>

============================ no tests ran in 0.01s =============================
________________________________________________________________________ test_config_file_precedence[TCMS_USERNAME-user] ________________________________________________________________________

testdir = <Testdir local('/private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_config_file_precedence1')>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x10e0b5350>, envvar = 'TCMS_USERNAME', value = 'user'

    @pytest.mark.parametrize("envvar, value", DEFAULT_CONFIG)
    @pytest.mark.usefixtures("config_file")
    def test_config_file_precedence(testdir, monkeypatch, envvar, value):
        """Values from ~/.tcms.conf have higher priority than env variables."""
        monkeypatch.setenv(envvar, value)
        testdir.makepyfile(
            """
            def test_config_file_precedence(pytestconfig):
                plugin = pytestconfig.pluginmanager.get_plugin("pytest-kiwitcms")
                assert plugin.api_url == "http://example.com"
                assert plugin.username == "admin"
                assert plugin.password == "secret"
            """
        )
        result = testdir.runpytest("--kiwitcms", "-v")
>       result.stdout.fnmatch_lines(["*::test_config_file_precedence PASSED*"])
E       Failed: nomatch: '*::test_config_file_precedence PASSED*'
E           and: '============================= test session starts =============================='
E           and: 'platform darwin -- Python 3.7.8, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/bin/python3.7'
E           and: 'cachedir: .pytest_cache'
E           and: 'rootdir: /private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_config_file_precedence1'
E           and: 'plugins: kiwitcms-pytest-plugin-0.1.0, Faker-5.0.1'
E           and: 'collecting ... collected 1 item'
E           and: 'INTERNALERROR> Traceback (most recent call last):'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 269, in wrap_session'
E           and: 'INTERNALERROR>     session.exitstatus = doit(config, session) or 0'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 323, in _main'
E           and: 'INTERNALERROR>     config.hook.pytest_runtestloop(session=session)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__'
E           and: 'INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec'
E           and: 'INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 337, in traced_hookexec'
E           and: 'INTERNALERROR>     return outcome.get_result()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result'
E           and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 52, in from_call'
E           and: 'INTERNALERROR>     result = func()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 335, in <lambda>'
E           and: 'INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>'
E           and: 'INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall'
E           and: 'INTERNALERROR>     return outcome.get_result()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result'
E           and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall'
E           and: 'INTERNALERROR>     res = hook_impl.function(*args)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/open-source/pytest-plugin/tcms_pytest_plugin/plugin.py", line 36, in pytest_runtestloop'
E           and: 'INTERNALERROR>     backend.configure()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 77, in configure'
E           and: 'INTERNALERROR>     self.run_id = self.get_run_id()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 389, in get_run_id'
E           and: 'INTERNALERROR>     product_id, product_name = self.get_product_id(0)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 164, in get_product_id'
E           and: "INTERNALERROR>     test_plan = self.rpc.TestPlan.filter({'pk': plan_id})"
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1112, in __call__'
E           and: 'INTERNALERROR>     return self.__send(self.__name, args)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1452, in __request'
E           and: 'INTERNALERROR>     verbose=self.__verbose'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1154, in request'
E           and: 'INTERNALERROR>     return self.single_request(host, handler, request_body, verbose)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1187, in single_request'
E           and: 'INTERNALERROR>     dict(resp.getheaders())'
E           and: 'INTERNALERROR> xmlrpc.client.ProtocolError: <ProtocolError for 127.0.0.1:8000/xml-rpc/: 431 Line too long>'
E           and: ''
E           and: '============================ no tests ran in 0.01s ============================='
E       remains unmatched: '*::test_config_file_precedence PASSED*'

/Users/bryanmutai/open-source/pytest-plugin/tests/test_pytest_kiwitcms.py:64: Failed
------------------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------------------
============================= test session starts ==============================
platform darwin -- Python 3.7.8, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/bin/python3.7
cachedir: .pytest_cache
rootdir: /private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_config_file_precedence1
plugins: kiwitcms-pytest-plugin-0.1.0, Faker-5.0.1
collecting ... collected 1 item
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 337, in traced_hookexec
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 52, in from_call
INTERNALERROR>     result = func()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 335, in <lambda>
INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/bryanmutai/open-source/pytest-plugin/tcms_pytest_plugin/plugin.py", line 36, in pytest_runtestloop
INTERNALERROR>     backend.configure()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 77, in configure
INTERNALERROR>     self.run_id = self.get_run_id()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 389, in get_run_id
INTERNALERROR>     product_id, product_name = self.get_product_id(0)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 164, in get_product_id
INTERNALERROR>     test_plan = self.rpc.TestPlan.filter({'pk': plan_id})
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1112, in __call__
INTERNALERROR>     return self.__send(self.__name, args)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1452, in __request
INTERNALERROR>     verbose=self.__verbose
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1154, in request
INTERNALERROR>     return self.single_request(host, handler, request_body, verbose)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1187, in single_request
INTERNALERROR>     dict(resp.getheaders())
INTERNALERROR> xmlrpc.client.ProtocolError: <ProtocolError for 127.0.0.1:8000/xml-rpc/: 431 Line too long>

============================ no tests ran in 0.01s =============================
_______________________________________________________________________ test_config_file_precedence[TCMS_PASSWORD-random] _______________________________________________________________________

testdir = <Testdir local('/private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_config_file_precedence2')>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x10e125a10>, envvar = 'TCMS_PASSWORD', value = 'random'

    @pytest.mark.parametrize("envvar, value", DEFAULT_CONFIG)
    @pytest.mark.usefixtures("config_file")
    def test_config_file_precedence(testdir, monkeypatch, envvar, value):
        """Values from ~/.tcms.conf have higher priority than env variables."""
        monkeypatch.setenv(envvar, value)
        testdir.makepyfile(
            """
            def test_config_file_precedence(pytestconfig):
                plugin = pytestconfig.pluginmanager.get_plugin("pytest-kiwitcms")
                assert plugin.api_url == "http://example.com"
                assert plugin.username == "admin"
                assert plugin.password == "secret"
            """
        )
        result = testdir.runpytest("--kiwitcms", "-v")
>       result.stdout.fnmatch_lines(["*::test_config_file_precedence PASSED*"])
E       Failed: nomatch: '*::test_config_file_precedence PASSED*'
E           and: '============================= test session starts =============================='
E           and: 'platform darwin -- Python 3.7.8, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/bin/python3.7'
E           and: 'cachedir: .pytest_cache'
E           and: 'rootdir: /private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_config_file_precedence2'
E           and: 'plugins: kiwitcms-pytest-plugin-0.1.0, Faker-5.0.1'
E           and: 'collecting ... collected 1 item'
E           and: 'INTERNALERROR> Traceback (most recent call last):'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 269, in wrap_session'
E           and: 'INTERNALERROR>     session.exitstatus = doit(config, session) or 0'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 323, in _main'
E           and: 'INTERNALERROR>     config.hook.pytest_runtestloop(session=session)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__'
E           and: 'INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec'
E           and: 'INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 337, in traced_hookexec'
E           and: 'INTERNALERROR>     return outcome.get_result()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result'
E           and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 52, in from_call'
E           and: 'INTERNALERROR>     result = func()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 335, in <lambda>'
E           and: 'INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>'
E           and: 'INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall'
E           and: 'INTERNALERROR>     return outcome.get_result()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result'
E           and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall'
E           and: 'INTERNALERROR>     res = hook_impl.function(*args)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/open-source/pytest-plugin/tcms_pytest_plugin/plugin.py", line 36, in pytest_runtestloop'
E           and: 'INTERNALERROR>     backend.configure()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 77, in configure'
E           and: 'INTERNALERROR>     self.run_id = self.get_run_id()'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 389, in get_run_id'
E           and: 'INTERNALERROR>     product_id, product_name = self.get_product_id(0)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 164, in get_product_id'
E           and: "INTERNALERROR>     test_plan = self.rpc.TestPlan.filter({'pk': plan_id})"
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1112, in __call__'
E           and: 'INTERNALERROR>     return self.__send(self.__name, args)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1452, in __request'
E           and: 'INTERNALERROR>     verbose=self.__verbose'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1154, in request'
E           and: 'INTERNALERROR>     return self.single_request(host, handler, request_body, verbose)'
E           and: 'INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1187, in single_request'
E           and: 'INTERNALERROR>     dict(resp.getheaders())'
E           and: 'INTERNALERROR> xmlrpc.client.ProtocolError: <ProtocolError for 127.0.0.1:8000/xml-rpc/: 431 Line too long>'
E           and: ''
E           and: '============================ no tests ran in 0.01s ============================='
E       remains unmatched: '*::test_config_file_precedence PASSED*'

/Users/bryanmutai/open-source/pytest-plugin/tests/test_pytest_kiwitcms.py:64: Failed
------------------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------------------
============================= test session starts ==============================
platform darwin -- Python 3.7.8, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/bin/python3.7
cachedir: .pytest_cache
rootdir: /private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_config_file_precedence2
plugins: kiwitcms-pytest-plugin-0.1.0, Faker-5.0.1
collecting ... collected 1 item
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 337, in traced_hookexec
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 52, in from_call
INTERNALERROR>     result = func()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 335, in <lambda>
INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/bryanmutai/open-source/pytest-plugin/tcms_pytest_plugin/plugin.py", line 36, in pytest_runtestloop
INTERNALERROR>     backend.configure()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 77, in configure
INTERNALERROR>     self.run_id = self.get_run_id()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 389, in get_run_id
INTERNALERROR>     product_id, product_name = self.get_product_id(0)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 164, in get_product_id
INTERNALERROR>     test_plan = self.rpc.TestPlan.filter({'pk': plan_id})
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1112, in __call__
INTERNALERROR>     return self.__send(self.__name, args)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1452, in __request
INTERNALERROR>     verbose=self.__verbose
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1154, in request
INTERNALERROR>     return self.single_request(host, handler, request_body, verbose)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/lib/python3.7/xmlrpc/client.py", line 1187, in single_request
INTERNALERROR>     dict(resp.getheaders())
INTERNALERROR> xmlrpc.client.ProtocolError: <ProtocolError for 127.0.0.1:8000/xml-rpc/: 431 Line too long>

============================ no tests ran in 0.01s =============================
______________________________________________________________________________________ test_empty_variable ______________________________________________________________________________________

testdir = <Testdir local('/private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_empty_variable0')>

    def test_empty_variable(testdir):
        """Any empty value in config variables will lead to program exiting."""
        testdir.makepyfile(
            """
            def test_empty_variable(pytestconfig):
                plugin = pytestconfig.pluginmanager.get_plugin("pytest-kiwitcms")
            """
        )
        result = testdir.runpytest("--kiwitcms", "-v")
>       result.stderr.fnmatch_lines(["Exit: Option api_url is empty"])
E       Failed: remains unmatched: 'Exit: Option api_url is empty'

/Users/bryanmutai/open-source/pytest-plugin/tests/test_pytest_kiwitcms.py:77: Failed
------------------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------------------
============================= test session starts ==============================
platform darwin -- Python 3.7.8, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/bin/python3.7
cachedir: .pytest_cache
rootdir: /private/var/folders/45/3yn_sz95505d4jl19sw92l7w0000gp/T/pytest-of-bryanmutai/pytest-31/test_empty_variable0
plugins: kiwitcms-pytest-plugin-0.1.0, Faker-5.0.1
collecting ... collected 1 item
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 337, in traced_hookexec
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 52, in from_call
INTERNALERROR>     result = func()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 335, in <lambda>
INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/bryanmutai/open-source/pytest-plugin/tcms_pytest_plugin/plugin.py", line 36, in pytest_runtestloop
INTERNALERROR>     backend.configure()
INTERNALERROR>   File "/Users/bryanmutai/.pyenv/versions/3.7.8/envs/pytest-plugin/lib/python3.7/site-packages/tcms_api/plugin_helpers.py", line 77, in configure

@atodorov
Copy link
Member

I installed using pip install -e tcms_pytest_plugin I think installs it in an editable mode, I haven't had to reinstall every time I edit source. I remember doing the same for the django plugin.

OK, got it. IDK enough about editable mode installs but in any case we should strive for being able to run the plugin from source during CI & development. However this is probalby unrelated to the current error.

It looks like its failing whenever when trying to get the status Id of the test execution INTERNALERROR> self.status_id = backend.get_status_id('PASSED')

Your code seems to call backend.configure() which performs the login with the remote API. Can you debug the following items:

  • what's your remote URL ? Try backend.rpc.server.uri
  • Try calling some of the RPC methods before doing anything useful in the plugin, e.g. backend.rpc.TestExecutionStatus.filter() or backend.rpc.Product.filter()

Actually, I'm still not getting your result when I run using PYTHONPATH=. pytest -p tcms_pytest_plugin I also, still get the xmlrpc.client.ProtocolError: <ProtocolError for 127.0.0.1:8000/xml-rpc/: 431 Line too long> from the xmlrpc client multiple times within each test result, the difference is that the test runner completes all the tests.

That hints to a problem with the remote API you are using. What's the Kiwi TCMS backend that you use, which version, how does your tcms.conf look like ?

The actual reason for the 431 status code is explained here:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/431

In xmlrpc.client there is only 1 place where this error is raised so you could also debug that.

@brymut
Copy link
Contributor Author

brymut commented Jan 12, 2021

  • what's your remote URL ? Try backend.rpc.server.uri

For backend.rpc.server.uri I get <xmlrpc.client._Method object at 0x105b13410> and just backend.rpc I get <ServerProxy for 127.0.0.1:8000/xml-rpc/>

  • Try calling some of the RPC methods before doing anything useful in the plugin, e.g. backend.rpc.TestExecutionStatus.filter() or backend.rpc.Product.filter()

When I run:

execution_statuses = backend.rpc.TestExecutionStatus.filter(
            {"weight": -10}
        )
        print(execution_statuses)

I get back this which seems fine.
[{'id': 6, 'name': 'BLOCKED', 'weight': -10, 'icon': 'fa fa-stop-circle-o', 'color': '#cc0000'}]

And as for the Kiwitcms version, I switched to the v8.9 tag which I assume is the latest stable version because of the issue I ran into that I had asked help for on Slack. My ~/.tcms.conf authenticated using the superuser ->

[tcms]
url = http://127.0.0.1:8000/xml-rpc/
username = bryanmutai
password = testpassword!

@brymut brymut force-pushed the new-plugin branch 2 times, most recently from 5cab447 to 7c4a67c Compare January 14, 2021 10:44
@brymut
Copy link
Contributor Author

brymut commented Jan 15, 2021

Hi, @atodorov I can't seem to be able to get past this error. I have tried running the Kiwitcms instance in docker container as well but haven't been able to get any progress and still getting the same error as running it on my host machine. And I can't find any reference to there being a limit to the length of a request body.

Is it possible for me to use the public tenant to run the tests at the moment to see if the error happens there as well?

@brymut
Copy link
Contributor Author

brymut commented Jan 18, 2021

Hi, @atodorov I can't seem to be able to get past this error. I have tried running the Kiwitcms instance in docker container as well but haven't been able to get any progress and still getting the same error as running it on my host machine. And I can't find any reference to there being a limit to the length of a request body.

Is it possible for me to use the public tenant to run the tests at the moment to see if the error happens there as well?

Hi @atodorov, just wanted to check in on this. Is it possible to use the public tenant?

@atodorov
Copy link
Member

All of the previous debug info looks good. You are using a local instance and seemingly you can query the backend and receive a result. So the issue must be on the py.test integration code.

FTR There is already v9.0.1 which works with tcms-api 9.0.

@atodorov
Copy link
Member

Can we start breaking up this PR and get some of the pieces merged. It will be easier when there are less moving parts.

Commits 1 and 3 generally look good, I see only a few issues there. Should I comment here or you want to make another PR for them and adjust ?

@atodorov
Copy link
Member

Hi @atodorov, just wanted to check in on this. Is it possible to use the public tenant?

Yes, I don't see why not. Mind the versions though! See above for info.

@atodorov
Copy link
Member

Rebase to latest and let's start solving this one piece by piece.

@atodorov atodorov mentioned this pull request Dec 6, 2021
@atodorov
Copy link
Member

atodorov commented Jul 5, 2022

Merged with changes as part of #40.

@atodorov atodorov closed this Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants