rhevm-qe-automation / pytest_jira

py.test plugin to integrate with JIRA
GNU General Public License v2.0
29 stars 25 forks source link

Enable plugin to fail gracefully on jira connection error #84

Closed liiight closed 6 years ago

liiight commented 7 years ago

Currently pytest crashes on jira connection error since it doesn't catch request exceptions. This has an undesirable effect of making builds that run pytest fail which cause false positives.

I propose passing a flag that will enable either gracefully not load the plugin, or alternatively skip the test with a successful exit code.

Thoughts?

lukas-bednar commented 7 years ago

In my opinion I think the best would skip loading plugin in that case.

but on other hand what if jira server go down during test execution?

I am not really confident with suggestions here, because since you expect some plugin to do some job for you and if it can not it should give you some feedback that something goes differently than expected ...

liiight commented 6 years ago

The way I see it there are several flows on connection error:

  1. Crash (the current behaviour)
  2. Skip the session
  3. Skip tests that are marked or use the jira_issue fixture.
  4. Run the tests without loading the plugin.

We can have a flag/config option that will let the user select which one they prefer. Personnaly I'd go for no. 3.

WDYT?

lukas-bednar commented 6 years ago

I would go with backward compatibility, so by default no 1 as a default, and I also think that no 3 & 4 find use case too.

liiight commented 6 years ago

Cool, I'll put up a PR

lukas-bednar commented 6 years ago

I think we are covered here, I am closing that. If you miss something there feel free reopen it!