Project

General

Profile

Bug #9027

Fix Bridge unit tests

Added by Evgeny Novikov 7 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Urgent
Category:
Bridge
Target version:
Start date:
06/28/2018
Due date:
% Done:

100%

Estimated time:
Detected in build:
svn
Platform:
Published in build:

Description

Bridge unit tests are precious, but recent huge changes break them partially. Moreover, removing caches will influence tests as well. After it we need to fix tests ASAP.


Related issues

Related to Klever - Feature #8729: Bridge does not work with Django 2.*Closed2018-02-19

Blocked by Klever - Feature #9013: Get rid of redundant cachesClosed2018-06-27

History

#1 Updated by Evgeny Novikov 7 months ago

  • Related to Feature #8729: Bridge does not work with Django 2.* added

#2 Updated by Evgeny Novikov 7 months ago

#4 Updated by Evgeny Novikov 7 months ago

  • Target version changed from 2.0 to 1.1

This issue is not strictly bound with purposes of 2.0 that targets verification of C software.

#5 Updated by Evgeny Novikov 6 months ago

  • Target version changed from 1.1 to 2.0

Let's Vladimir will do this after his vacation.

#6 Updated by Vladimir Gratinskiy 4 months ago

  • % Done changed from 0 to 100
  • Status changed from New to Resolved

Tests were updated in branch "bridge-2.0".

#7 Updated by Evgeny Novikov 4 months ago

  • Status changed from Resolved to Closed

Tests passed, so, I merged the branch to master in b8bda00ac.

#8 Updated by Evgeny Novikov 3 months ago

  • Status changed from Closed to Open

When I ran Bridge unit tests several times "manually", they always passed. But all invocations of these tests by CI reveal the following only issue:

..............E...............
======================================================================
ERROR: test_reports (reports.test.TestReports)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/www/klever-bridge/reports/test.py", line 260, in test_reports
    self.__decide_job(SJC_1)
  File "/var/www/klever-bridge/reports/test.py", line 793, in __decide_job
    core_coverage.update(self.__upload_subjob(subjob))
  File "/var/www/klever-bridge/reports/test.py", line 827, in __upload_subjob
    self.__upload_finish_report(lkbce)
  File "/var/www/klever-bridge/reports/test.py", line 578, in __upload_finish_report
    self.assertIsNotNone(ReportComponent.objects.get(identifier=self.job.identifier + r_id).finish_date)
  File "/usr/local/lib/python3.5/dist-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py", line 403, in get
    self.model._meta.object_name
reports.models.DoesNotExist: ReportComponent matching query does not exist.

----------------------------------------------------------------------

Can this be fixed or workarounded somehow?

#9 Updated by Vladimir Gratinskiy 3 months ago

  • Status changed from Open to Resolved

Evgeny Novikov wrote:

When I ran Bridge unit tests several times "manually", they always passed. But all invocations of these tests by CI reveal the following only issue:

[...]

Can this be fixed or workarounded somehow?

The reason is I used "fast run decision" for all jobs in tests. For development mode (used in your manual tests) the job is "full-weight", for production (in CI) it is lightweight, where reports without children are deleted on "finish report" upload. Fixed in "klever-2.0".

#10 Updated by Evgeny Novikov 3 months ago

  • Status changed from Resolved to Closed

It works now. It did depend on settings.py that was development for local invocations of tests and production for CI. I cherry picked the commit from klever-2.0 to master.

Also available in: Atom PDF