squad 1.94.1__py3-none-any.whl → 1.96__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of squad might be problematic. Click here for more details.

@@ -394,6 +394,7 @@ class Backend(BaseBackend):
394
394
 
395
395
  # Retrieve TuxRun log
396
396
  logs = self.fetch_url(job_url + '/', 'logs?format=txt').text
397
+ log_lines = logs.splitlines()
397
398
 
398
399
  attachment_list = ["reproducer", "tux_plan.yaml"]
399
400
  attachments = {}
@@ -407,23 +408,28 @@ class Backend(BaseBackend):
407
408
 
408
409
  # Create a boot test
409
410
  boot_test_name = 'boot/' + (metadata.get('build_name') or 'boot')
410
- tests[boot_test_name] = results['results']['boot']
411
+ tests[boot_test_name] = {'result': results['results']['boot']}
411
412
 
412
413
  # Really fetch test results
413
414
  tests_results = self.fetch_url(job_url + '/', 'results').json()
414
415
  if tests_results.get('error', None) is None:
415
416
  for suite, suite_tests in tests_results.items():
416
- if suite == 'lava':
417
- continue
418
-
419
417
  suite_name = re.sub(r'^[0-9]+_', '', suite)
420
418
  for name, test_data in suite_tests.items():
421
419
  test_name = f'{suite_name}/{name}'
422
420
  result = test_data['result']
423
-
424
- # TODO: Log lines are off coming from TuxRun/LAVA
425
- # test_log = self.get_test_log(log_dict, test)
426
- tests[test_name] = result
421
+ if "starttc" in test_data:
422
+ starttc = test_data["starttc"] - 1 # LAVA data counts from 1, we count from 0
423
+ if "endtc" in test_data:
424
+ # no -1 as the second index of the slice needs to be
425
+ # greater than the first to get at least one item.
426
+ endtc = test_data["endtc"]
427
+ else:
428
+ endtc = starttc + 2
429
+ log_snippet = "\n".join(log_lines[starttc:endtc])
430
+ else:
431
+ log_snippet = None
432
+ tests[test_name] = {"result": result, "log": log_snippet}
427
433
 
428
434
  return status, completed, metadata, tests, metrics, logs, attachments
429
435
 
@@ -138,6 +138,9 @@ class Command(BaseCommand):
138
138
  backend_name = options.get("BACKEND")
139
139
  if backend_name:
140
140
  backend = Backend.objects.get(name=backend_name)
141
- Listener(backend).run()
141
+ try:
142
+ Listener(backend).run()
143
+ except NotImplementedError:
144
+ logger.info('Backend %s: does not implement a listener' % backend.name)
142
145
  else:
143
146
  ListenerManager().run()
squad/core/models.py CHANGED
@@ -1,7 +1,7 @@
1
1
  import json
2
2
  import yaml
3
3
  import logging
4
- from collections import OrderedDict, Counter
4
+ from collections import Counter, defaultdict
5
5
  from hashlib import sha1
6
6
  from itertools import groupby
7
7
  import re
@@ -676,36 +676,62 @@ class Build(models.Model):
676
676
 
677
677
  @property
678
678
  def test_suites_by_environment(self):
679
- test_runs = self.test_runs.prefetch_related(
680
- 'tests',
681
- 'tests__suite',
682
- 'environment',
679
+ """
680
+ Return a sorted dictionary like
681
+ {
682
+ "env1": [
683
+ ("suite1", {"fail": 0, "pass": 0, "skip": 0, "xfail": 0}),
684
+ ("suite2", {"fail": 0, "pass": 0, "skip": 0, "xfail": 0}),
685
+ ...
686
+ ],
687
+ "env2": [
688
+ ("suite1", {"fail": 0, "pass": 0, "skip": 0, "xfail": 0}),
689
+ ("suite2", {"fail": 0, "pass": 0, "skip": 0, "xfail": 0}),
690
+ ...
691
+ ],
692
+ ...
693
+ }
694
+
695
+ Sorted by env slug, and then by suite slug
696
+ """
697
+
698
+ tmp_results = defaultdict(
699
+ lambda: defaultdict(
700
+ lambda: {
701
+ "fail": 0,
702
+ "pass": 0,
703
+ "skip": 0,
704
+ "xfail": 0,
705
+ }
706
+ )
683
707
  )
684
- template = OrderedDict((
685
- ('fail', 0),
686
- ('pass', 0),
687
- ('skip', 0),
688
- ('xfail', 0),
689
- ))
690
- result = OrderedDict()
691
- envlist = set([t.environment for t in test_runs])
692
- for env in sorted(envlist, key=lambda env: env.slug):
693
- result[env] = dict()
694
- for tr in test_runs:
695
- for t in tr.tests.all():
696
- if t.suite in result[tr.environment].keys():
697
- result[tr.environment][t.suite][t.status] += 1
698
- else:
699
- if t.suite not in result[tr.environment]:
700
- result[tr.environment][t.suite] = template.copy()
701
- result[tr.environment][t.suite][t.status] += 1
702
- for env in result.keys():
703
- # there should only be one key in the most nested dict
704
- result[env] = sorted(
705
- result[env].items(),
706
- key=lambda suite_dict: suite_dict[0].slug)
707
-
708
- return result
708
+
709
+ statuses = Status.objects.filter(
710
+ test_run__build=self,
711
+ suite__isnull=False
712
+ ).prefetch_related(
713
+ 'test_run__environment',
714
+ 'suite',
715
+ ).order_by(
716
+ 'test_run__environment__slug',
717
+ 'suite__slug',
718
+ )
719
+
720
+ for status in statuses:
721
+ env = status.test_run.environment
722
+ suite = status.suite
723
+
724
+ tmp_results[env][suite]['fail'] += status.tests_fail
725
+ tmp_results[env][suite]['pass'] += status.tests_pass
726
+ tmp_results[env][suite]['skip'] += status.tests_skip
727
+ tmp_results[env][suite]['xfail'] += status.tests_xfail
728
+
729
+ results = defaultdict(list)
730
+ for env, suites in tmp_results.items():
731
+ for suite, status in suites.items():
732
+ results[env].append((suite, status))
733
+
734
+ return results
709
735
 
710
736
  def test_jobs_summary(self, per_environment=False):
711
737
  testjobs = self.test_jobs.only('environment', 'job_status', 'target_build').order_by('environment')
squad/jinja2.py CHANGED
@@ -69,7 +69,7 @@ def _register(attr, fn=None, name=None, takes_context=None):
69
69
 
70
70
 
71
71
  def _update_local_env(attr, func, name=None, takes_context=None):
72
- global _local_env
72
+ global _local_env # noqa
73
73
 
74
74
  if takes_context:
75
75
  func.contextfunction = True
squad/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '1.94.1'
1
+ __version__ = '1.96'
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: squad
3
- Version: 1.94.1
3
+ Version: 1.96
4
4
  Summary: Software Quality Dashboard
5
5
  Home-page: https://gitlab.com/Linaro/squad/squad
6
6
  Author: Antonio Terceiro
@@ -11,7 +11,6 @@ License-File: COPYING
11
11
  Requires-Dist: aiohttp
12
12
  Requires-Dist: celery
13
13
  Requires-Dist: cryptography
14
- Requires-Dist: coreapi
15
14
  Requires-Dist: django_crispy_forms==1.14.0
16
15
  Requires-Dist: Django<5,>=3
17
16
  Requires-Dist: django-allauth
@@ -48,6 +47,7 @@ Dynamic: author-email
48
47
  Dynamic: description
49
48
  Dynamic: home-page
50
49
  Dynamic: license
50
+ Dynamic: license-file
51
51
  Dynamic: platform
52
52
  Dynamic: provides-extra
53
53
  Dynamic: requires-dist
@@ -4,13 +4,13 @@ squad/celery.py,sha256=JyflXsOPFcQ0ltX9f4DtPi-zcBV9Hmi74SdPur3dkdY,1919
4
4
  squad/compat.py,sha256=VhgZ8fwMu-FT7vZMOqEuLussVTTzPm68uIL37UHmSmk,1409
5
5
  squad/container_settings.py,sha256=bac_j_ibZY5hEaasRhNyliq9sfsP6ks4RzGIyHskXW4,1209
6
6
  squad/http.py,sha256=KuIKtpf3yOvf5fwc0T2MR0ul1l4AKxq3b0CLdk6KBhM,3667
7
- squad/jinja2.py,sha256=OKX-lzNz6qtTZL56HWv4UBMPuBl4WQXv0qFJztGp9zs,2541
7
+ squad/jinja2.py,sha256=Uv33jwWKhru5Z3vGVl5hxjyRZNHSdy9kMb8tyjFqzTU,2549
8
8
  squad/mail.py,sha256=xH5wuIpD7u1fTN9vNOcbzByojleaffsKwp-9i3BeOD0,390
9
9
  squad/manage.py,sha256=Z-LXT67p0R-IzwJ9fLIAacEZmU0VUjqDOSg7j2ZSxJ4,1437
10
10
  squad/settings.py,sha256=sLSts3qmUgXmpLmzhOBrTmFcSuBRMugo0hDY0uw4z3A,14792
11
11
  squad/socialaccount.py,sha256=vySqPwQ3qVVpahuJ-Snln8K--yzRL3bw4Nx27AsB39A,789
12
12
  squad/urls.py,sha256=JiEfVW8YlzLPE52c2aHzdn5kVVKK4o22w8h5KOA6QhQ,2776
13
- squad/version.py,sha256=G2AdNYN80TTBiHZPHRJd0afSyPf3yadck7G34lqhCjw,23
13
+ squad/version.py,sha256=RtXo-Lku2ipg-tPkVM1mzfGxoMi1VE4O6Qh-PRiKdWs,21
14
14
  squad/wsgi.py,sha256=SF8T0cQ0OPVyuYjO5YXBIQzvSXQHV0M2BTmd4gP1rPs,387
15
15
  squad/api/__init__.py,sha256=CJiVakfAlHVN5mIFRVQYZQfuNUhUgWVbsdYTME4tq7U,1349
16
16
  squad/api/apps.py,sha256=Trk72p-iV1uGn0o5mdJn5HARUoHGbfgO49jwXvpkmdQ,141
@@ -33,11 +33,11 @@ squad/ci/backend/__init__.py,sha256=yhpotXT9F4IdAOXvGQ3-17eOHAFwoaqf9SnMX17ab30,
33
33
  squad/ci/backend/fake.py,sha256=MTsxGZuihJOd39X8ysJhiYp4A0R46lyhdkjoTgFm6a8,2435
34
34
  squad/ci/backend/lava.py,sha256=Atb2AgV5OSejtN1LyE7xONTFvJCdDoh9vK9RO_P7L2g,34077
35
35
  squad/ci/backend/null.py,sha256=oZx3OofUKSuLOYS_GZkteGaD6JOEEkdknVmi4_cxDOQ,5645
36
- squad/ci/backend/tuxsuite.py,sha256=UP-XZnoC_QNQpPwh9uS827Xg_8Uqef_7zFSZjIq2OJM,19431
36
+ squad/ci/backend/tuxsuite.py,sha256=7X7Ym4rWi6nUV01hio2wW-TYAOj5LHPFSZdor-lUivg,19944
37
37
  squad/ci/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  squad/ci/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  squad/ci/management/commands/create_tuxsuite_boot_tests.py,sha256=JvjNusebLX71eyz9d-kaeCyekYSpzc1eXoeIqWK9ygo,4045
40
- squad/ci/management/commands/listen.py,sha256=9feZ3yjEKiTCOGM4A7m-parNn3PB-TOiDudpE8HySdU,4534
40
+ squad/ci/management/commands/listen.py,sha256=3o0IZPeUz3D3Pd-yL-yJdYkRmSgm6mhzB8qUCt6oejU,4683
41
41
  squad/ci/management/commands/testfetch.py,sha256=28vOmmpgZFhJZRmXOCZxSN0y64fpLDCrmM7oi5rewk4,1663
42
42
  squad/ci/migrations/0001_initial.py,sha256=oIcEE32zdiuQkCyyily6VKnRVH8e03cYmvcxlo0iELg,2098
43
43
  squad/ci/migrations/0002_auto_20170406_1252.py,sha256=rLGNiNaV737vCVKtEOWTzdH4vkVlBdwfhYkkRdD7xps,633
@@ -82,7 +82,7 @@ squad/core/comparison.py,sha256=LR3-Unv0CTmakFCDzF_h8fm2peTJzkv79mQWNau1iwI,2442
82
82
  squad/core/data.py,sha256=2zw56v7iYRTUc7wlhuUNgwIIMmK2w84hi-amR9J7EPU,2236
83
83
  squad/core/failures.py,sha256=X6lJVghM2fOrd-RfuHeLlezW2pt7owDZ8eX-Kn_Qrt0,918
84
84
  squad/core/history.py,sha256=QRSIoDOw6R6vUWMtsPMknsHGM7FaCAeuCYqASCayHTk,3541
85
- squad/core/models.py,sha256=qSLlxjBwzsZKGoCkPX6T-g48jXg81B1JH3wMXSLLvHQ,61401
85
+ squad/core/models.py,sha256=I0j8jWte1WZDoAbAwLQKVNpssfhcN4AJuWDN2409kVo,61969
86
86
  squad/core/notification.py,sha256=rOpO6F63w7_5l9gQgWBBEk-MFBjp7x_hVzoVIVyDze0,10030
87
87
  squad/core/plugins.py,sha256=FLgyoXXKnPBYEf2MgHup9M017rHuADHivLhgzmx_cJE,6354
88
88
  squad/core/queries.py,sha256=78fhIJZWXIlDryewYAt96beK1VJad66Ufu8cg3dHh4w,7698
@@ -436,9 +436,9 @@ squad/run/__main__.py,sha256=DOl8JOi4Yg7DdtwnUeGqtYBJ6P2k-D2psAEuYOjWr8w,66
436
436
  squad/run/listener.py,sha256=jBeOQhPGb4EdIREB1QsCzYuumsfJ-TqJPd3nR-0m59g,200
437
437
  squad/run/scheduler.py,sha256=CDJG3q5C0GuQuxwlMOfWTSSJpDdwbR6rzpbJfuA0xuw,277
438
438
  squad/run/worker.py,sha256=jtML0h5qKDuSbpJ6_rpWP4MT_rsGA7a24AhwGxBquzk,594
439
- squad-1.94.1.dist-info/COPYING,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
440
- squad-1.94.1.dist-info/METADATA,sha256=MAONzjmu4o6Ds5Mw8FslU8bMELzWpxa30kBgwrDKiAA,1516
441
- squad-1.94.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
442
- squad-1.94.1.dist-info/entry_points.txt,sha256=apCDQydHZtvqV334ql6NhTJUAJeZRdtAm0TVcbbAi5Q,194
443
- squad-1.94.1.dist-info/top_level.txt,sha256=_x9uqE1XppiiytmVTl_qNgpnXus6Gsef69HqfliE7WI,6
444
- squad-1.94.1.dist-info/RECORD,,
439
+ squad-1.96.dist-info/licenses/COPYING,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
440
+ squad-1.96.dist-info/METADATA,sha256=SJVyM4OtL1m3jknZA9hIfO77bYhEEhBqj5xg3VHaXyw,1513
441
+ squad-1.96.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
442
+ squad-1.96.dist-info/entry_points.txt,sha256=apCDQydHZtvqV334ql6NhTJUAJeZRdtAm0TVcbbAi5Q,194
443
+ squad-1.96.dist-info/top_level.txt,sha256=_x9uqE1XppiiytmVTl_qNgpnXus6Gsef69HqfliE7WI,6
444
+ squad-1.96.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5