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

Reports with bugs are failing when tracker type is specified, but the other data is not #100

Closed
okainov opened this Issue Nov 2, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@okainov
Copy link
Contributor

okainov commented Nov 2, 2017

Description of problem

Having "Type" set for Issue tracker it's becoming impossible to generate and view bug reports until other API data is set correctly (probably?)

Component (web, API, etc)

web

Version or commit hash (if applicable)

demo, local

How often reproducible

always

Steps to Reproduce

(considering one has clean default installation with default Jira and Bugzilla instances)

  1. Go to admin - Issue tracker
  2. Click Jira
  3. Select Type - Jira
  4. Do not fill any other fields
  5. Go to some test run with some Jira bugs
  6. Click "Bugs" link https://demo.kiwitcms.org/run/3/report/#buglist

Also make sure that it's impossible to change "Type" back to NULL, so one has to fix database manually.

Actual results

  1. Make sure exception occurs "Gateway Timeout" w\o debug and detailed error with debug "JiraError HTTP 404 url: http://localhost:2990/jira/rest/api/2/serverInfo"

Expected results

Report should appear

Additional info

From stacktrace:
File "/venv/lib64/python3.5/site-packages/tcms/testruns/views.py" in get_context_data
789. tracker = tracker_class(bug_system)

When "Type" is set then tracker_class is actual Issue Tracker class (JIRA in this case). In constructor 163: tcms/issuetracker/types.py no any check is being performed before creating jira.JIRA instance and this leads to an error because default url is "localhost:2990" for some reason and it's obviously not accessible.
Looks like method is_adding_testcase_to_issue_disabled contains exactly needed check, so probably it should be renamed and then it should be called before creating actual instance calling issue tracker API.

atodorov added a commit that referenced this issue Nov 3, 2017

If JIRA isn't fully configured then don't connect. Fixes #100
turns out the underlying jira library tries to connect
automatically when a jira.JIRA object is created. When the
Issue Tracker is not fully configured (i.e. missing base_url,
api_url, api_username, api_password) then the library will default
to localhost and fail to connect to the JIRA server.

This causes the TestRun report view to timeout and fail.

This commit adds tests for all supported issue trackers and also
fixes the JIRA implementation to not connect if not configured.

@atodorov atodorov closed this in c392c88 Nov 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment