reportportal / agent-python-pytest

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

Test result is not coming in Report portal #347

Closed manvendravsingh closed 1 year ago

manvendravsingh commented 1 year ago

Describe the bug I am using Demo report portal site with pytest integration for my project. Following the steps in documentation and using the flsg "--reportportal" but my test results are not coming in report portal.

Steps to Reproduce Steps to reproduce the behavior:

Generate API Key, and put the rp_endpoint, rp_api_key, rp_project, rp_launch properties in pytest.ini created a logger fixture. use that fixture in test run pytest using command - pytest --reportportal Expected behavior I am expecting Report portal should show the test result in launch.

Actual behavior Launch and Test results are not available on reportportal

Package versions Include version info of the following packages: reportportal-client plugins: depends-1.0.1, html-1.22.0, metadata-2.0.4, reportportal-5.1.8

Additional context Cases are executing successfully. C:\Users*\PycharmProjects\MyProject> pytest --reportportal ============================= test session starts ============================= platform win32 -- Python 3.7.0, pytest-3.10.1, py-1.11.0, pluggy-1.0.0 -- C:\Users**\AppData\Local\Programs\Python\Python37\python.exe cachedir: .pytest_cache metadata: {'Python': '3.7.0', 'Platform': 'Windows-10-10.0.19041-SP0', 'Packages': {'pytest': '3.10.1', 'pluggy': '1.0.0'}, 'Plugins': {'depends': '1.0. 1', 'html': '1.22.0', 'metadata': '2.0.4', 'reportportal': '5.1.8'}} rootdir: C:\Users\masing\PycharmProjects\MyProject, inifile: pytest.ini plugins: depends-1.0.1, html-1.22.0, metadata-2.0.4, reportportal-5.1.8 collected 2 items

test_sample.py::TestSample::test_sampleTest1 ------------------------------- live log setup -------------------------------- conftest.py 18 INFO Test Started -------------------------------- live log call -------------------------------- test_sample.py 10 INFO This is Sample Test 1 PASSED [ 50%] test_sample.py::TestSample::test_sampleTest2 -------------------------------- live log call -------------------------------- PASSED [100%] ------------------------------ live log teardown ------------------------------ conftest.py 20 INFO Test End

========================== 2 passed in 0.04 seconds ===========================

HardNorth commented 1 year ago

@manvendravsingh rp_api_key parameter is for agent version 5.1.9 or later, from your log I see you are using agent version 5.1.8. See changelogs: https://github.com/reportportal/agent-python-pytest/releases/tag/5.1.9

manvendravsingh commented 1 year ago

I have update the python-reportportal to latest build. and now I am facing following issue-

PS C:\Users*****\PycharmProjects\MyProject> pytest --reportportal

---------------------------- live log sessionstart ---------------------------- rp_requests.py 83 WARNING Report Portal None request failed Traceback (most recent call last): File "C:\Users***\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\models.py", line 971, in json return complexjson.loads(self.text, kwargs) File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\json__init__.py", line 348, in loads return _default_decoder.decode(s) File "C:\Users**\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users******\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users**\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_requests.py", line 76, in make timeout=self.http_timeout) File "C:\Users**\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_responses.py", line 64, in init self._data = self._get_json(data) File "C:\Users**\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_responses.py", line 74, in _get_json return data.json() File "C:\Users*****\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0) rp_requests.py 83 WARNING Report Portal None request failed Traceback (most recent call last): File "C:\Users\\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\models.py", line 971, in json return complexjson.loads(self.text, kwargs) File "C:\Users****\AppData\Local\Programs\Python\Python37\lib\json__init__.py", line 348, in loads return _default_decoder.decode(s) File "C:\Users**\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users**\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users**\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_requests.py", line 76, in make timeout=self.http_timeout) File "C:\Users**\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_responses.py", line 64, in init self._data = self._get_json(data) File "C:\Users**\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_responses.py", line 74, in _get_json return data.json() File "C:\Users*\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0) ============================= test session starts ============================= platform win32 -- Python 3.7.0, pytest-3.10.1, py-1.11.0, pluggy-1.0.0 -- C:\Users**\AppData\Local\Programs\Python\Python37\python.exe cachedir: .pytest_cache metadata: {'Python': '3.7.0', 'Platform': 'Windows-10-10.0.19041-SP0', 'Packages': {'pytest': '3.10.1', 'pluggy': '1.0.0'}, 'Plugins': {'depends': '1.0.1', 'html': '1.22.0', 'metadata' : '2.0.4', 'reportportal': '5.2.1'}} rootdir: C:\Users**\PycharmProjects\MyProject, inifile: pytest.ini plugins: depends-1.0.1, html-1.22.0, metadata-2.0.4, reportportal-5.2.1 collected 2 items

----------------------------- live log collection ----------------------------- rp_requests.py 83 WARNING Report Portal None request failed Traceback (most recent call last): File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\models.py", line 971, in json return complexjson.loads(self.text, **kwargs) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\json__init__.py", line 348, in loads return _default_decoder.decode(s) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_requests.py", line 76, in make timeout=self.http_timeout) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_responses.py", line 64, in init self._data = self._get_json(data) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_responses.py", line 74, in _get_json return data.json() File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

test_sample.py::TestSample::test_sampleTest1 ------------------------------- live log setup -------------------------------- conftest.py 18 INFO Test Started -------------------------------- live log call -------------------------------- test_sample.py 10 INFO This is Sample Test 1 PASSED [ 50%] ------------------------------- live log finish ------------------------------- client.py 248 WARNING Attempt to finish non-existent item rp_requests.py 83 WARNING Report Portal None request failed Traceback (most recent call last): File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\models.py", line 971, in json return complexjson.loads(self.text, **kwargs) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\json__init__.py", line 348, in loads return _default_decoder.decode(s) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_requests.py", line 76, in make timeout=self.http_timeout) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_responses.py", line 64, in init self._data = self._get_json(data) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_responses.py", line 74, in _get_json return data.json() File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

test_sample.py::TestSample::test_sampleTest2 -------------------------------- live log call -------------------------------- test_sample.py 14 INFO This is sample Test 2 PASSED [100%] ------------------------------ live log teardown ------------------------------ conftest.py 20 INFO Test End ------------------------------- live log finish ------------------------------- client.py 248 WARNING Attempt to finish non-existent item --------------------------- live log sessionfinish ---------------------------- client.py 205 WARNING Attempt to finish non-existent launch rp_requests.py 83 WARNING Report Portal None request failed Traceback (most recent call last): File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\models.py", line 971, in json return complexjson.loads(self.text, **kwargs) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\json__init__.py", line 348, in loads return _default_decoder.decode(s) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_requests.py", line 76, in make timeout=self.http_timeout) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_responses.py", line 64, in init self._data = self._get_json(data) File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\reportportal_client\core\rp_responses.py", line 74, in _get_json return data.json() File "C:\Users\masing\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

========================== 2 passed in 1.38 seconds ===========================

I am using Python version 3.7.0. Please help.

manvendravsingh commented 1 year ago

@HardNorth , Thanks for your response. I have updated the python-reportportal to latest build. and now I am facing issue mentioned above. Please help.