diff options
author | Elliot Smith <elliot.smith@intel.com> | 2016-01-15 13:01:03 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-15 16:30:01 +0000 |
commit | 059a274aa96ced872156806936f887969980dda6 (patch) | |
tree | 8494b689ce4ad1226fbf79b67b2e9189bf8640d5 /bitbake/lib/toaster/contrib/django-aggregate-if-master/runtests.py | |
parent | 4103e0cb748888d83a5a892b5a022d633846bce8 (diff) | |
download | poky-059a274aa96ced872156806936f887969980dda6.tar.gz |
bitbake: toastergui: fix error and warning counts for builds
The error and warning counts displayed for builds were counts of
the errors and warnings objects associated with a build. Because these
values were being derived on the fly, it was not possible to sort by
them.
Previously, the 3rd party django-aggregate-if library was used to
add aggregate fields to Build objects and should then have been
used to populate the "all builds" and "project builds" tables. However,
at some point the templates had changed so that the error and warning
counts were coming from the properties on the Build model and not from
these aggregates. This meant that it was not possible to sort by these
fields.
Django 1.8 supports conditional aggregates in annotation fields on
querysets. This means we can remove django-aggregate-if, use the new Django
1.8 feature to derive errors_no and warnings_no fields as annotations,
then use those annotation fields in the templates. This makes the "builds"
tables sortable again.
[YOCTO #8738]
(Bitbake rev: 9be7c5c18b325f6ed40bc431ac408db242007eb1)
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/contrib/django-aggregate-if-master/runtests.py')
-rwxr-xr-x | bitbake/lib/toaster/contrib/django-aggregate-if-master/runtests.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/bitbake/lib/toaster/contrib/django-aggregate-if-master/runtests.py b/bitbake/lib/toaster/contrib/django-aggregate-if-master/runtests.py deleted file mode 100755 index 2e55864e3a..0000000000 --- a/bitbake/lib/toaster/contrib/django-aggregate-if-master/runtests.py +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | #!/usr/bin/env python | ||
2 | |||
3 | import os | ||
4 | import sys | ||
5 | from optparse import OptionParser | ||
6 | |||
7 | |||
8 | def parse_args(): | ||
9 | parser = OptionParser() | ||
10 | parser.add_option('-s', '--settings', help='Define settings.') | ||
11 | parser.add_option('-t', '--unittest', help='Define which test to run. Default all.') | ||
12 | options, args = parser.parse_args() | ||
13 | |||
14 | if not options.settings: | ||
15 | parser.print_help() | ||
16 | sys.exit(1) | ||
17 | |||
18 | if not options.unittest: | ||
19 | options.unittest = ['aggregation'] | ||
20 | |||
21 | return options | ||
22 | |||
23 | |||
24 | def get_runner(settings_module): | ||
25 | ''' | ||
26 | Asks Django for the TestRunner defined in settings or the default one. | ||
27 | ''' | ||
28 | os.environ['DJANGO_SETTINGS_MODULE'] = settings_module | ||
29 | |||
30 | import django | ||
31 | from django.test.utils import get_runner | ||
32 | from django.conf import settings | ||
33 | |||
34 | if hasattr(django, 'setup'): | ||
35 | django.setup() | ||
36 | |||
37 | return get_runner(settings) | ||
38 | |||
39 | |||
40 | def runtests(): | ||
41 | options = parse_args() | ||
42 | TestRunner = get_runner(options.settings) | ||
43 | runner = TestRunner(verbosity=1, interactive=True, failfast=False) | ||
44 | sys.exit(runner.run_tests([])) | ||
45 | |||
46 | |||
47 | if __name__ == '__main__': | ||
48 | runtests() | ||