squad 1.78__py3-none-any.whl → 1.80__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.
@@ -107,7 +107,7 @@ class Backend(BaseBackend):
107
107
 
108
108
  """
109
109
 
110
- regex = r'^(OEBUILD|BUILD|TEST):([0-9a-z_\-]+@[0-9a-z_\-]+)#([a-zA-Z0-9]+)$'
110
+ regex = r'^(OEBUILD|BUILD|TEST):([0-9a-z_\-.]+@[0-9a-z_\-.]+)#([a-zA-Z0-9]+)$'
111
111
  matches = re.findall(regex, job_id)
112
112
  if len(matches) == 0:
113
113
  raise FetchIssue(f'Job id "{job_id}" does not match "{regex}"')
@@ -287,6 +287,17 @@ class Backend(BaseBackend):
287
287
 
288
288
  return status, completed, metadata, tests, metrics, logs
289
289
 
290
+ def update_metadata_from_file(self, results, metadata):
291
+ if "download_url" in results:
292
+ download_url = results["download_url"]
293
+ try:
294
+ test_metadata_response = self.fetch_url(download_url + '/' + 'metadata.json')
295
+ # If fetching the metadata file did not error, decode it as json
296
+ if test_metadata_response.ok:
297
+ metadata.update(test_metadata_response.json())
298
+ except TemporaryFetchIssue:
299
+ pass
300
+
290
301
  def parse_test_results(self, test_job, job_url, results, settings):
291
302
  status = 'Complete'
292
303
  completed = True
@@ -297,6 +308,10 @@ class Backend(BaseBackend):
297
308
  # Pick up some metadata from results
298
309
  metadata_keys = settings.get('TEST_METADATA_KEYS', [])
299
310
  metadata = {k: results.get(k) for k in metadata_keys}
311
+
312
+ # Add extra metadata from metadata file if it exists
313
+ self.update_metadata_from_file(results=results, metadata=metadata)
314
+
300
315
  metadata['job_url'] = job_url
301
316
  metadata['job_id'] = test_job.job_id
302
317
 
squad/ci/models.py CHANGED
@@ -143,17 +143,18 @@ class Backend(models.Model):
143
143
  except DuplicatedTestJob as exception:
144
144
  logger.error('Failed to fetch test_job(%d): "%s"' % (test_job.id, str(exception)))
145
145
 
146
- if test_job.testrun:
147
- self.__postprocess_testjob__(test_job)
148
-
149
- # Remove the 'Fetching' job_status only after eventual plugins
150
- # are finished, this garantees extra tests and metadata to
151
- # be in SQUAD before the build is considered finished
152
- test_job.job_status = status
153
- test_job.save()
146
+ if test_job.testrun and test_job.target.enabled_plugins and any(test_job.target.enabled_plugins):
147
+ # Avoids cyclic import errors
148
+ from squad.ci.tasks import postprocess_testjob
149
+ test_job.save()
150
+ postprocess_testjob.delay(test_job.id, status)
151
+ else:
152
+ # Remove the 'Fetching' job_status only after all work is done
153
+ test_job.job_status = status
154
+ test_job.save()
154
155
 
155
- if test_job.testrun:
156
- UpdateProjectStatus()(test_job.testrun)
156
+ if test_job.testrun:
157
+ UpdateProjectStatus()(test_job.testrun)
157
158
 
158
159
  def __postprocess_testjob__(self, test_job):
159
160
  project = test_job.target
squad/ci/tasks.py CHANGED
@@ -1,4 +1,5 @@
1
1
  from squad.celery import app as celery
2
+ from squad.core.tasks import UpdateProjectStatus
2
3
  from squad.ci.models import Backend, TestJob
3
4
  from squad.ci.exceptions import SubmissionIssue
4
5
  from squad.ci.utils import task_id
@@ -89,3 +90,24 @@ def send_testjob_resubmit_admin_email(job_id, resubmitted_job_id):
89
90
  if test_job.target.html_mail:
90
91
  message.attach_alternative(html_message, "text/html")
91
92
  message.send()
93
+
94
+
95
+ @celery.task
96
+ def postprocess_testjob(job_id, status):
97
+ logger.info("postprocessing %s" % job_id)
98
+ testjob = TestJob.objects.get(pk=job_id)
99
+ backend = testjob.backend
100
+ backend.__postprocess_testjob__(testjob)
101
+
102
+ # Some plugins, like tradefed, can still trigger sub-tasks creating tests,
103
+ # ending the current thread, thus triggering build-finished events
104
+ # we need a way to tell the plugins to wait for all sub-tasks to be finished
105
+
106
+ # Remove the 'Fetching' job_status only after eventual plugins
107
+ # are finished, this garantees extra tests and metadata to
108
+ # be in SQUAD before the build is considered finished
109
+ testjob.job_status = status
110
+ testjob.save()
111
+
112
+ if testjob.testrun:
113
+ UpdateProjectStatus()(testjob.testrun)
squad/settings.py CHANGED
@@ -384,6 +384,7 @@ CELERY_TASK_ROUTES = {
384
384
  'squad.core.tasks.notification.*': {'queue': 'core_notification'},
385
385
  'squad.ci.tasks.poll': {'queue': 'ci_poll'},
386
386
  'squad.ci.tasks.fetch': {'queue': 'ci_fetch'},
387
+ 'squad.ci.tasks.postprocess_testjob': {'queue': 'ci_fetch_postprocess'},
387
388
  'squad.ci.tasks.submit': {'queue': 'ci_quick'},
388
389
  'squad.ci.tasks.send_testjob_resubmit_admin_email': {'queue': 'ci_quick'},
389
390
  }
squad/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '1.78'
1
+ __version__ = '1.80'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: squad
3
- Version: 1.78
3
+ Version: 1.80
4
4
  Summary: Software Quality Dashboard
5
5
  Home-page: https://github.com/Linaro/squad
6
6
  Author: Antonio Terceiro
@@ -7,10 +7,10 @@ squad/http.py,sha256=KuIKtpf3yOvf5fwc0T2MR0ul1l4AKxq3b0CLdk6KBhM,3667
7
7
  squad/jinja2.py,sha256=OKX-lzNz6qtTZL56HWv4UBMPuBl4WQXv0qFJztGp9zs,2541
8
8
  squad/mail.py,sha256=xH5wuIpD7u1fTN9vNOcbzByojleaffsKwp-9i3BeOD0,390
9
9
  squad/manage.py,sha256=Z-LXT67p0R-IzwJ9fLIAacEZmU0VUjqDOSg7j2ZSxJ4,1437
10
- squad/settings.py,sha256=6pEhWkjPgdRS4H2u3BKkPQJGs7oFy8Nbgk3KfhMR7hk,14328
10
+ squad/settings.py,sha256=rW_2NTKQddDNYYB-gNq-0Yna_A8BO5l-0O3XkA-zj7w,14405
11
11
  squad/socialaccount.py,sha256=vySqPwQ3qVVpahuJ-Snln8K--yzRL3bw4Nx27AsB39A,789
12
12
  squad/urls.py,sha256=JiEfVW8YlzLPE52c2aHzdn5kVVKK4o22w8h5KOA6QhQ,2776
13
- squad/version.py,sha256=XeGT6kbv0aqIXwctF7oFHP0PsaWbOke6_uNfqoWH_fg,21
13
+ squad/version.py,sha256=1PniZI-fByh18EZM2pSB_ICBBYC9E5c41K4g9jnPfOg,21
14
14
  squad/wsgi.py,sha256=SF8T0cQ0OPVyuYjO5YXBIQzvSXQHV0M2BTmd4gP1rPs,387
15
15
  squad/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  squad/api/apps.py,sha256=Trk72p-iV1uGn0o5mdJn5HARUoHGbfgO49jwXvpkmdQ,141
@@ -25,14 +25,14 @@ squad/ci/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  squad/ci/admin.py,sha256=7yB-6F0cvt0NVvzGOTlZCyGPV_YHarmbKJZTTzataT4,2255
26
26
  squad/ci/apps.py,sha256=6OVnzTdJkxdqEJnKWYE9dZgUcc29_T1LrDw41cK4EQk,139
27
27
  squad/ci/exceptions.py,sha256=a1sccygniTYDSQi7FRn_6doapddFFiMf55AwGUh5Y80,227
28
- squad/ci/models.py,sha256=EPTs7MVS0yFa5CZAnLQn53ai-RDbdijJc3-BdaBhng0,13139
29
- squad/ci/tasks.py,sha256=yrtxfPuYEqqGCDYRwLz2XyIp9a7LJ-K6Zm3VS1ymdZk,2728
28
+ squad/ci/models.py,sha256=xdRfHxSLLfiZXpb4kMwsOWRQwcfunw0h6ATYrX63bqY,13257
29
+ squad/ci/tasks.py,sha256=_fY9a9Mv4tMe2cYKu0WJhpA0RGiwdtLrPeAImxxDn4Y,3544
30
30
  squad/ci/utils.py,sha256=38zHpw8xkZDSFlkG-2BwSK6AkcddK9OkN9LXuQ3SHR0,97
31
31
  squad/ci/backend/__init__.py,sha256=yhpotXT9F4IdAOXvGQ3-17eOHAFwoaqf9SnMX17ab30,534
32
32
  squad/ci/backend/fake.py,sha256=zzOXGesDCW9xiMQvXGD_jqCQF32yEd7hPM8DgfZxUok,2159
33
33
  squad/ci/backend/lava.py,sha256=5KEXFwKGjzXPPe7_rzMGF7YShYCLwmooTc8tQUpGBSM,33076
34
34
  squad/ci/backend/null.py,sha256=vP77Xj7roruehSjX8fJs7xK2aWxgaUA2id3P8nHNrEY,4949
35
- squad/ci/backend/tuxsuite.py,sha256=Kf_BqH0F9mSi-Qac_Y0_MlGkwW02AxqWr31mAbY_UfI,16640
35
+ squad/ci/backend/tuxsuite.py,sha256=XnV5ee9eSSKyxZDO-pXibpP_TU4iCBHA8opaZ_3upXk,17296
36
36
  squad/ci/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
37
  squad/ci/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  squad/ci/management/commands/create_tuxsuite_boot_tests.py,sha256=JvjNusebLX71eyz9d-kaeCyekYSpzc1eXoeIqWK9ygo,4045
@@ -430,9 +430,9 @@ squad/run/__main__.py,sha256=DOl8JOi4Yg7DdtwnUeGqtYBJ6P2k-D2psAEuYOjWr8w,66
430
430
  squad/run/listener.py,sha256=jBeOQhPGb4EdIREB1QsCzYuumsfJ-TqJPd3nR-0m59g,200
431
431
  squad/run/scheduler.py,sha256=CDJG3q5C0GuQuxwlMOfWTSSJpDdwbR6rzpbJfuA0xuw,277
432
432
  squad/run/worker.py,sha256=jtML0h5qKDuSbpJ6_rpWP4MT_rsGA7a24AhwGxBquzk,594
433
- squad-1.78.dist-info/COPYING,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
434
- squad-1.78.dist-info/METADATA,sha256=LUzP6B4KhAPL3dOfv6wAO4hDt9BMbsg8Wwp6NJjMYpY,1245
435
- squad-1.78.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
436
- squad-1.78.dist-info/entry_points.txt,sha256=apCDQydHZtvqV334ql6NhTJUAJeZRdtAm0TVcbbAi5Q,194
437
- squad-1.78.dist-info/top_level.txt,sha256=_x9uqE1XppiiytmVTl_qNgpnXus6Gsef69HqfliE7WI,6
438
- squad-1.78.dist-info/RECORD,,
433
+ squad-1.80.dist-info/COPYING,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
434
+ squad-1.80.dist-info/METADATA,sha256=Byv2yIE4P5KvgVB4JIQD9zHtLXmhV-Ynl2X4snlq0Ms,1245
435
+ squad-1.80.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
436
+ squad-1.80.dist-info/entry_points.txt,sha256=apCDQydHZtvqV334ql6NhTJUAJeZRdtAm0TVcbbAi5Q,194
437
+ squad-1.80.dist-info/top_level.txt,sha256=_x9uqE1XppiiytmVTl_qNgpnXus6Gsef69HqfliE7WI,6
438
+ squad-1.80.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.3)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
File without changes