reportportal / agent-python-pytest

Framework integration with PyTest
Apache License 2.0
95 stars 102 forks source link

TLS CA certificate bundle, invalid path: True #304

Closed kr87nikhil closed 2 years ago

kr87nikhil commented 2 years ago

name: Bug report about: Create a report to help us improve title: 'rp_verify_ssl config value is parsed as string type' labels: bug assignees: ''


Describe the bug As per README file, rp_verify_ssl can have value True or False. But as it is parsed as str instead of bool.

Error is raised from pytest_reportportal/plugin.py file in check_connection method. 153> resp = requests.get(url, headers=headers, 154> verify=agent_config.rp_verify_ssl)

It happens because rp_verify_ssl is defined with no type, defaults to str in pytest_addoption method: 393> parser.addini( 394> 'rp_verify_ssl', 395> default='True', 396> help='True/False - verify HTTPS calls, or path to a CA_BUNDLE or ' 397> 'directory with certificates of trusted CAs.')

Steps to Reproduce Steps to reproduce the behavior:

  1. https://github.com/reportportal/examples-python/tree/master/pytest
  2. Execute test cases with report portal flag

Expected behavior Launch should be created on successful validation of token in Report Portal.

Actual behavior Upon executing tests with reportportal, it raises below error: INTERNALERROR> raise IOError("Could not find a suitable TLS CA certificate bundle, " INTERNALERROR> OSError: Could not find a suitable TLS CA certificate bundle, invalid path: True

Package versions requests==2.27.1 reportportal-client==5.2.0, pytest-reportportal==5.1.0

Additional context Conditional type conversion would be good, as verify attribute of post method takes any string value as path to TLS CA certificate bundle.

HardNorth commented 2 years ago

Yes, probably missed that.

HardNorth commented 2 years ago

Fixed in: https://github.com/reportportal/agent-python-pytest/releases/tag/5.1.1

kr87nikhil commented 2 years ago

Verified, working as expected.