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

Test Plan - Test cases cannot be added to existing test run / New test run cannot be created from test cases #346

Closed
Prome88 opened this Issue May 16, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@Prome88

Prome88 commented May 16, 2018

Description of problem

  • Test cases cannot be added to existing test run
  • New test run cannot be created from test cases

Component (web, API, etc)

Web

Version or commit hash (if applicable)

4.1.4

How often reproducible

Always.

Steps to Reproduce

  1. Open test plan
  2. Select cases
  3. Click on Create new test run / Add to existing test run

Actual results

Internal server error 500.

New test run:
ERROR:django.request:Internal Server Error: /run/new/ Traceback (most recent call last): File "/venv/lib64/python3.5/site-packages/django/core/handlers/exception.py", line 35, in inner response = get_response(request) File "/venv/lib64/python3.5/site-packages/django/core/handlers/base.py", line 128, in _get_response response = self.process_exception_by_middleware(e, request) File "/venv/lib64/python3.5/site-packages/django/core/handlers/base.py", line 126, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/venv/lib64/python3.5/site-packages/django/views/decorators/http.py", line 40, in inner return func(request, *args, **kwargs) File "/venv/lib64/python3.5/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view return view_func(request, *args, **kwargs) File "/venv/lib64/python3.5/site-packages/tcms/testruns/views.py", line 189, in new (tc.estimated_time for tc in tcs_values)) File "/venv/lib64/python3.5/site-packages/django/db/models/query.py", line 272, in __iter__ self._fetch_all() File "/venv/lib64/python3.5/site-packages/django/db/models/query.py", line 1179, in _fetch_all self._result_cache = list(self._iterable_class(self)) File "/venv/lib64/python3.5/site-packages/django/db/models/query.py", line 53, in __iter__ results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) File "/venv/lib64/python3.5/site-packages/django/db/models/sql/compiler.py", line 1054, in execute_sql sql, params = self.as_sql() File "/venv/lib64/python3.5/site-packages/django/db/models/sql/compiler.py", line 447, in as_sql extra_select, order_by, group_by = self.pre_sql_setup() File "/venv/lib64/python3.5/site-packages/django/db/models/sql/compiler.py", line 50, in pre_sql_setup self.setup_query() File "/venv/lib64/python3.5/site-packages/django/db/models/sql/compiler.py", line 41, in setup_query self.select, self.klass_info, self.annotation_col_map = self.get_select() File "/venv/lib64/python3.5/site-packages/django/db/models/sql/compiler.py", line 231, in get_select related_klass_infos = self.get_related_selections(select) File "/venv/lib64/python3.5/site-packages/django/db/models/sql/compiler.py", line 795, in get_related_selections only_load.get(field_model)): File "/venv/lib64/python3.5/site-packages/django/db/models/query_utils.py", line 254, in select_related_descend (field.model._meta.object_name, field.name)) django.db.models.query_utils.InvalidQuery: Field TestCase.default_tester cannot be both deferred and traversed using select_related at the same time.

Add to existing test run:
ERROR:django.request:Internal Server Error: /plan/1/chooseruns/ Traceback (most recent call last): File "/venv/lib64/python3.5/site-packages/django/core/handlers/exception.py", line 35, in inner response = get_response(request) File "/venv/lib64/python3.5/site-packages/django/core/handlers/base.py", line 128, in _get_response response = self.process_exception_by_middleware(e, request) File "/venv/lib64/python3.5/site-packages/django/core/handlers/base.py", line 126, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/venv/lib64/python3.5/site-packages/django/views/decorators/http.py", line 40, in inner return func(request, *args, **kwargs) File "/venv/lib64/python3.5/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view return view_func(request, *args, **kwargs) File "/venv/lib64/python3.5/site-packages/tcms/testplans/views.py", line 366, in choose_run test_plan = TestPlan.objects.get(pk=int(plan_id)).defer('product_version') AttributeError: 'TestPlan' object has no attribute 'defer'

Expected results

Test cases added to test run.

@aferre

This comment has been minimized.

aferre commented May 16, 2018

I also have issues creating a new test run with 4.1.4.

The Debug flag is set to Ture (default value when i cloned the github repo), but I do not have a stack trace displayed on the resulting web page.

There is nothing useful displayed in the httpd logs on the hosts.

Where can I get the error logs provided here?

@Prome88

This comment has been minimized.

Prome88 commented May 17, 2018

Mine are from httpd logs in /home/$user/Kiwi/log/httpd.

@atodorov

This comment has been minimized.

Member

atodorov commented Aug 31, 2018

Note: this is probably fixed in 5.2 b/c I don't see the last line of the traceback. However I see a few more places where .defer is used and I want to check them out before closing this issue.

@atodorov atodorov closed this Oct 25, 2018

atodorov added a commit that referenced this issue Nov 12, 2018

Fix InvalidQuery, refs #346
Field TestCase.default_tester cannot be both deferred and traversed
using select_related at the same time

atodorov added a commit that referenced this issue Nov 12, 2018

Fix InvalidQuery, refs #346
Field TestCase.default_tester cannot be both deferred and traversed
using select_related at the same time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment