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

SSL verification and plugin disabling #35

Merged
merged 1 commit into from
Jun 7, 2016

Conversation

vkondula
Copy link
Contributor

@vkondula vkondula commented Jun 6, 2016

  1. if connection to Jira wasn't established, plugin won't be loaded
  2. it's possible to disable ssl verification to jira

@@ -29,7 +29,7 @@ submitting feature requests or issues to [issues][githubissues].

## Requires
* pytest >= 2.2.3
* jira >= 0.13
* jira >= 0.43
Copy link
Member

Choose a reason for hiding this comment

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

update requirements.txt

if jira_plugin.is_connected():
# if connection to jira fails, plugin won't be loaded
ok = config.pluginmanager.register(jira_plugin)
assert ok
Copy link
Member

Choose a reason for hiding this comment

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

else:
    some_warning(...)

you can use terminal reporter for example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The inner condition (is_connected) has logger output on line n. 45.
And do we want warning for the outer condition? (missing "--jira" parameter)

@lukas-bednar lukas-bednar added this to the 0.2.1 milestone Jun 6, 2016
@@ -12,16 +12,19 @@
import re
import six
import pytest
import logging
Copy link
Member

Choose a reason for hiding this comment

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

pytest doesn't use logger, use terminalreporter instead https://github.com/pytest-dev/pytest/blob/master/_pytest/terminal.py#L144

@vkondula vkondula force-pushed the verification branch 2 times, most recently from dca448e to 59c4762 Compare June 6, 2016 12:55
@codecov-io
Copy link

codecov-io commented Jun 6, 2016

Current coverage is 66.66%

Merging #35 into master will decrease coverage by 5.70%

@@             master        #35   diff @@
==========================================
  Files             1          1          
  Lines            76         96    +20   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits             55         64     +9   
- Misses           21         32    +11   
  Partials          0          0          

Powered by Codecov. Last updated by b7408b4...59c4762

except six.moves.configparser.NoOptionError:
verify = True
except ValueError:
console_write('Wrong argument for ssl_verification!')
Copy link
Member

Choose a reason for hiding this comment

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

this branch can be easily covered by

    testdir.makefile(
        '.cfg',
        jira="\n".join([
            '[DEFAULT]',
            'ssl_verification = something',
        ])
    )

and it will cover console_write function as side-effect ...

@vkondula vkondula force-pushed the verification branch 2 times, most recently from 2de08f8 to ce9f4e4 Compare June 7, 2016 07:01
@@ -15,13 +15,20 @@
from jira.client import JIRA


def console_write(message, *args, **kwargs):
tr = pytest.config.pluginmanager.getplugin('terminalreporter')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

AttributeError: 'module' object has no attribute 'config'
We can not access pytest.config from here.

1) if connection to Jira wasn't established, plugin won't be loaded
2) it's possible to disable ssl verification to jira
@lukas-bednar lukas-bednar merged commit 097f140 into rhevm-qe-automation:master Jun 7, 2016
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

3 participants