squad 1.83__py3-none-any.whl → 1.85__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.
- squad/api/ci.py +10 -0
- squad/api/rest.py +4 -3
- squad/ci/backend/fake.py +9 -0
- squad/ci/backend/lava.py +17 -0
- squad/ci/backend/null.py +23 -3
- squad/ci/backend/tuxsuite.py +5 -0
- squad/ci/models.py +4 -1
- squad/frontend/templates/squad/testjobs.jinja2 +8 -6
- squad/version.py +1 -1
- {squad-1.83.dist-info → squad-1.85.dist-info}/METADATA +1 -1
- {squad-1.83.dist-info → squad-1.85.dist-info}/RECORD +15 -15
- {squad-1.83.dist-info → squad-1.85.dist-info}/WHEEL +1 -1
- {squad-1.83.dist-info → squad-1.85.dist-info}/COPYING +0 -0
- {squad-1.83.dist-info → squad-1.85.dist-info}/entry_points.txt +0 -0
- {squad-1.83.dist-info → squad-1.85.dist-info}/top_level.txt +0 -0
squad/api/ci.py
CHANGED
@@ -106,6 +106,16 @@ def watch_job(request, group_slug, project_slug, version, environment_slug):
|
|
106
106
|
job_id=testjob_id
|
107
107
|
)
|
108
108
|
|
109
|
+
# check if backend is able to fetch job definition
|
110
|
+
try:
|
111
|
+
definition = backend.get_job_definition(testjob_id)
|
112
|
+
if not definition:
|
113
|
+
return HttpResponseBadRequest(f"No job definition found for job {testjob_id}: {definition}")
|
114
|
+
test_job.definition = definition
|
115
|
+
except NotImplementedError:
|
116
|
+
# backend does not work with job definitions
|
117
|
+
pass
|
118
|
+
|
109
119
|
# sanitize job_url
|
110
120
|
try:
|
111
121
|
backend.get_implementation().job_url(test_job)
|
squad/api/rest.py
CHANGED
@@ -227,7 +227,7 @@ class TestFilter(filters.FilterSet):
|
|
227
227
|
|
228
228
|
class Meta:
|
229
229
|
model = Test
|
230
|
-
fields = {'result': ['exact', 'in'],
|
230
|
+
fields = {'result': ['exact', 'in', 'isnull'],
|
231
231
|
'suite_id': ['exact', 'in'],
|
232
232
|
'environment_id': ['exact', 'in'],
|
233
233
|
'metadata_id': ['exact', 'in'],
|
@@ -1880,13 +1880,14 @@ router.register(r'projects', ProjectViewSet).register(
|
|
1880
1880
|
parents_query_lookups=['project_id'],
|
1881
1881
|
**drf_basename('project-builds')
|
1882
1882
|
)
|
1883
|
-
router.register(r'builds', BuildViewSet)
|
1883
|
+
builds = router.register(r'builds', BuildViewSet)
|
1884
|
+
builds.register(
|
1884
1885
|
r'tests',
|
1885
1886
|
TestViewSet,
|
1886
1887
|
parents_query_lookups=['build_id'],
|
1887
1888
|
**drf_basename('build-tests')
|
1888
1889
|
)
|
1889
|
-
|
1890
|
+
builds.register(
|
1890
1891
|
r'metrics',
|
1891
1892
|
MetricViewSet,
|
1892
1893
|
parents_query_lookups=['build_id'],
|
squad/ci/backend/fake.py
CHANGED
@@ -60,11 +60,20 @@ class Backend(object):
|
|
60
60
|
def job_url(self, test_job):
|
61
61
|
return 'https://example.com/job/%s' % test_job.job_id
|
62
62
|
|
63
|
+
def has_resubmit(self):
|
64
|
+
return False
|
65
|
+
|
66
|
+
def has_cancel(self):
|
67
|
+
return True
|
68
|
+
|
63
69
|
def cancel(self, test_job):
|
64
70
|
return True
|
65
71
|
|
66
72
|
def check_job_definition(self, definition):
|
67
73
|
return True
|
68
74
|
|
75
|
+
def get_job_definition(self, test_job):
|
76
|
+
return "sample job definition"
|
77
|
+
|
69
78
|
def supports_callbacks(self):
|
70
79
|
return False
|
squad/ci/backend/lava.py
CHANGED
@@ -106,6 +106,9 @@ class Backend(BaseBackend):
|
|
106
106
|
return job_id
|
107
107
|
return [job_id]
|
108
108
|
|
109
|
+
def has_cancel(self):
|
110
|
+
return True
|
111
|
+
|
109
112
|
def cancel(self, test_job):
|
110
113
|
if test_job.submitted and test_job.job_id is not None:
|
111
114
|
return self.__cancel_job__(test_job.job_id)
|
@@ -329,6 +332,9 @@ class Backend(BaseBackend):
|
|
329
332
|
scheme = socket_url.scheme
|
330
333
|
return '%s://%s:%s' % (scheme, hostname, port)
|
331
334
|
|
335
|
+
def has_resubmit(self):
|
336
|
+
return True
|
337
|
+
|
332
338
|
def resubmit(self, test_job):
|
333
339
|
with self.handle_job_submission():
|
334
340
|
new_job_id_list = self.__resubmit__(test_job.job_id)
|
@@ -775,3 +781,14 @@ class Backend(BaseBackend):
|
|
775
781
|
return True
|
776
782
|
except yaml.YAMLError as e:
|
777
783
|
return str(e)
|
784
|
+
|
785
|
+
def get_job_definition(self, job_id):
|
786
|
+
if self.use_xml_rpc:
|
787
|
+
return self.proxy.scheduler.jobs.definition(job_id)
|
788
|
+
job_resp = requests.get(
|
789
|
+
f'{self.api_url_base}/jobs/{job_id}/definition/',
|
790
|
+
headers=self.authentication,
|
791
|
+
timeout=self.settings.get(timeout_variable_name, DEFAULT_TIMEOUT)
|
792
|
+
)
|
793
|
+
if job_resp.status_code == 200:
|
794
|
+
return job_resp.json()
|
squad/ci/backend/null.py
CHANGED
@@ -8,7 +8,7 @@ logger = logging.getLogger('squad.ci.backend')
|
|
8
8
|
description = "None"
|
9
9
|
|
10
10
|
|
11
|
-
class Backend
|
11
|
+
class Backend:
|
12
12
|
|
13
13
|
"""
|
14
14
|
This is the interface that all backends must implement. Depending on the
|
@@ -39,6 +39,13 @@ class Backend(object):
|
|
39
39
|
"""
|
40
40
|
raise NotImplementedError
|
41
41
|
|
42
|
+
def has_resubmit(self):
|
43
|
+
"""
|
44
|
+
If the backend has a resubmit method implemented, override this to
|
45
|
+
return True.
|
46
|
+
"""
|
47
|
+
return False
|
48
|
+
|
42
49
|
def resubmit(self, test_job):
|
43
50
|
"""
|
44
51
|
Re-submits given test job to the backend service
|
@@ -84,6 +91,13 @@ class Backend(object):
|
|
84
91
|
"""
|
85
92
|
raise NotImplementedError
|
86
93
|
|
94
|
+
def has_cancel(self):
|
95
|
+
"""
|
96
|
+
If the backend has a cancel method implemented, override this to
|
97
|
+
return True.
|
98
|
+
"""
|
99
|
+
return False
|
100
|
+
|
87
101
|
def cancel(self, test_job):
|
88
102
|
"""
|
89
103
|
Cancels the job if the backend allows it. It will not raise any
|
@@ -92,18 +106,24 @@ class Backend(object):
|
|
92
106
|
"""
|
93
107
|
raise NotImplementedError
|
94
108
|
|
95
|
-
def job_url(
|
109
|
+
def job_url(self, test_job):
|
96
110
|
"""
|
97
111
|
Returns the URL of the test job in the backend
|
98
112
|
"""
|
99
113
|
raise NotImplementedError
|
100
114
|
|
101
|
-
def check_job_definition(
|
115
|
+
def check_job_definition(self, definition):
|
102
116
|
"""
|
103
117
|
Returns True if job definition checks out or an error message
|
104
118
|
"""
|
105
119
|
raise NotImplementedError
|
106
120
|
|
121
|
+
def get_job_definition(self, job_id):
|
122
|
+
"""
|
123
|
+
Returns the job definition for a given test job
|
124
|
+
"""
|
125
|
+
raise NotImplementedError
|
126
|
+
|
107
127
|
def supports_callbacks(self):
|
108
128
|
"""
|
109
129
|
Returns True if this backend supports callbacks, False otherwise
|
squad/ci/backend/tuxsuite.py
CHANGED
squad/ci/models.py
CHANGED
@@ -216,6 +216,9 @@ class Backend(models.Model):
|
|
216
216
|
def check_job_definition(self, definition):
|
217
217
|
return self.get_implementation().check_job_definition(definition)
|
218
218
|
|
219
|
+
def get_job_definition(self, job_id):
|
220
|
+
return self.get_implementation().get_job_definition(job_id)
|
221
|
+
|
219
222
|
def supports_callbacks(self):
|
220
223
|
return self.get_implementation().supports_callbacks()
|
221
224
|
|
@@ -379,7 +382,7 @@ class TestJob(models.Model):
|
|
379
382
|
if self.job_status == "Canceled":
|
380
383
|
return False
|
381
384
|
|
382
|
-
if self.job_id is not None:
|
385
|
+
if self.job_id is not None and self.backend.get_implementation().has_cancel():
|
383
386
|
return self.backend.get_implementation().cancel(self)
|
384
387
|
|
385
388
|
self.fetched = True
|
@@ -56,7 +56,7 @@
|
|
56
56
|
<div class='pull-right clearfix' ng-controller='CancelController' title="{{ _('Cancel all jobs') }}">
|
57
57
|
<a class="btn" ng-click="cancel_all({{ build.id }})" ng-class="{'btn-info': !done, 'btn-success': done, 'btn-danger': error}" ng-disabled="done" >
|
58
58
|
<span ng-class="{'fa':true, 'fa-recycle':!done, 'fa-check': done && !error, 'fa-spin': loading, 'fa-close': error}" ng-disabled="done"></span>
|
59
|
-
{{ _('
|
59
|
+
{{ _('Cancel all jobs') }}
|
60
60
|
</a>
|
61
61
|
</div>
|
62
62
|
<br />
|
@@ -107,7 +107,7 @@
|
|
107
107
|
ng-class="{'fa':true, 'fa-recycle':!done, 'fa-check': done && !error, 'fa-spin': loading, 'fa-close': error}"
|
108
108
|
ng-disabled="done">
|
109
109
|
</span>
|
110
|
-
{{ _('
|
110
|
+
{{ _('manual fetch') }}
|
111
111
|
</a>
|
112
112
|
</div>
|
113
113
|
{% endif %}
|
@@ -122,11 +122,12 @@
|
|
122
122
|
ng-class="{'fa':true, 'fa-recycle':!done, 'fa-check': done && !error, 'fa-spin': loading, 'fa-close': error}"
|
123
123
|
ng-disabled="done">
|
124
124
|
</span>
|
125
|
-
{{ _('%s
|
125
|
+
{{ _('cancel %s') % testjob.backend.get_implementation().has_cancel() }}
|
126
126
|
</a>
|
127
127
|
</div>
|
128
128
|
{% endif %}
|
129
129
|
<div class='pull-right' ng-controller='ResubmitController'>
|
130
|
+
{% if testjob.backend.get_implementation().has_resubmit() %}
|
130
131
|
<a
|
131
132
|
class="btn"
|
132
133
|
ng-click="resubmit({{testjob.id}}, true)"
|
@@ -138,9 +139,10 @@
|
|
138
139
|
ng-disabled="done"
|
139
140
|
title="{{ _('Resubmit job no matter the status') }}">
|
140
141
|
</span>
|
141
|
-
{{ _('
|
142
|
+
{{ _('force resubmit') }}
|
142
143
|
</a>
|
143
|
-
{%
|
144
|
+
{% endif %}
|
145
|
+
{% if testjob.can_resubmit and testjob.backend.get_implementation().has_resubmit() %}
|
144
146
|
<a
|
145
147
|
class="btn"
|
146
148
|
ng-click="resubmit({{testjob.id}}, false)"
|
@@ -152,7 +154,7 @@
|
|
152
154
|
ng-disabled="done"
|
153
155
|
title="{{ _('Resubmit job') }}">
|
154
156
|
</span>
|
155
|
-
{{ _('
|
157
|
+
{{ _('resubmit') }}
|
156
158
|
</a>
|
157
159
|
{% endif %}
|
158
160
|
</div>
|
squad/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '1.
|
1
|
+
__version__ = '1.85'
|
@@ -10,14 +10,14 @@ squad/manage.py,sha256=Z-LXT67p0R-IzwJ9fLIAacEZmU0VUjqDOSg7j2ZSxJ4,1437
|
|
10
10
|
squad/settings.py,sha256=Wzg1nS96OKZ38qEXtIat9XaZc1HigUJr3ktMuwVhf98,14546
|
11
11
|
squad/socialaccount.py,sha256=vySqPwQ3qVVpahuJ-Snln8K--yzRL3bw4Nx27AsB39A,789
|
12
12
|
squad/urls.py,sha256=JiEfVW8YlzLPE52c2aHzdn5kVVKK4o22w8h5KOA6QhQ,2776
|
13
|
-
squad/version.py,sha256=
|
13
|
+
squad/version.py,sha256=XHedXngbS7mTJ6PRZZiqQufUZV1aZtCSDF-zEyvtXKg,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
|
17
|
-
squad/api/ci.py,sha256=
|
17
|
+
squad/api/ci.py,sha256=ymG-eMKXpJgrVUiZcqJW-dYZQKvm1LkdR3TUMe4OSoM,6943
|
18
18
|
squad/api/data.py,sha256=obKDV0-neEvj5lPF9VED2gy_hpfhGtLJABYvSY38ing,2379
|
19
19
|
squad/api/filters.py,sha256=Zvp8DCJmiNquFWqvfVseEAAMYYPiT95RUjqKdzcqSnw,6917
|
20
|
-
squad/api/rest.py,sha256=
|
20
|
+
squad/api/rest.py,sha256=mbQQsOB-bdNGfQ76sbGxBgNRi9CMd99SNMQpda5DknY,77097
|
21
21
|
squad/api/urls.py,sha256=rmsdaL1uOCVSZ5x1redup9RliICmijaBjRK5ObsTkG8,1343
|
22
22
|
squad/api/utils.py,sha256=Sa8QFId3_oSqD2UOoY3Kuh54LLDLPNMq2sub5ktd6Fs,1160
|
23
23
|
squad/api/views.py,sha256=kuFlbiyZiD0i9jwwmkL3Y22LwJ3bx2oJs28d1g2DPA0,3898
|
@@ -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=
|
28
|
+
squad/ci/models.py,sha256=Fm-4b3SDgMh9HXzqjOd4iZDRMJ1D9AnZ2cg7i2OR248,16018
|
29
29
|
squad/ci/tasks.py,sha256=xoiOyh0HKLiKsAnQbolMRq4E9RcvP4xFgR0S9d_bgm4,3782
|
30
30
|
squad/ci/utils.py,sha256=38zHpw8xkZDSFlkG-2BwSK6AkcddK9OkN9LXuQ3SHR0,97
|
31
31
|
squad/ci/backend/__init__.py,sha256=yhpotXT9F4IdAOXvGQ3-17eOHAFwoaqf9SnMX17ab30,534
|
32
|
-
squad/ci/backend/fake.py,sha256=
|
33
|
-
squad/ci/backend/lava.py,sha256=
|
34
|
-
squad/ci/backend/null.py,sha256=
|
35
|
-
squad/ci/backend/tuxsuite.py,sha256=
|
32
|
+
squad/ci/backend/fake.py,sha256=9sPKndsGd5GDNPp35v-zfJWXZCbge-yXH3RBQGgTlPk,2340
|
33
|
+
squad/ci/backend/lava.py,sha256=EXwEksjdOi_ZrUoMkBTyxVjqVOnJvEFNg_LWqUKaIgA,33607
|
34
|
+
squad/ci/backend/null.py,sha256=0CVylWELIZw3JyzCROB4XXAjgQUi15YjQz5caRfTNBo,5434
|
35
|
+
squad/ci/backend/tuxsuite.py,sha256=Qz-zHyElU7K-oRT_DOlORaD_lR1HJC2JoHnLPZKfl60,17392
|
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
|
@@ -394,7 +394,7 @@ squad/frontend/templates/squad/test_run_suite_metrics.jinja2,sha256=WGjlObw7ZTGo
|
|
394
394
|
squad/frontend/templates/squad/test_run_suite_test_details.jinja2,sha256=HGGnxDoFpyPgiH34aIVRrQysLn7KLYtDITUeQikYOoY,5657
|
395
395
|
squad/frontend/templates/squad/test_run_suite_tests.jinja2,sha256=S5VJMIoc18W46iHtSSLYC_3C3Wj1saXU83wR-JvF8GI,935
|
396
396
|
squad/frontend/templates/squad/testjob.jinja2,sha256=hQLavgkYJ3qAKJMG7cHnmJGC1jdwCnox2w9oQvLzn7U,324
|
397
|
-
squad/frontend/templates/squad/testjobs.jinja2,sha256=
|
397
|
+
squad/frontend/templates/squad/testjobs.jinja2,sha256=a90ltfoIWORB4i1mubA3cfQzX1IoSMqhYpAUc38RZSk,9632
|
398
398
|
squad/frontend/templates/squad/testjobs_progress.jinja2,sha256=4_o53GOdcClRdiNQxPHwvXPI9Ia07gTJRu5SGrCJ7s4,2638
|
399
399
|
squad/frontend/templates/squad/tests-details-nav.jinja2,sha256=WDi4vf0ctRK1dK1Z3IirBuyn5Dq9_qg_9A1P3GrB31U,664
|
400
400
|
squad/frontend/templates/squad/tests.jinja2,sha256=2AaEoCHJiCzXu_36XOq0ihiGqxh_2U2w88dheBlIwy8,4970
|
@@ -431,9 +431,9 @@ squad/run/__main__.py,sha256=DOl8JOi4Yg7DdtwnUeGqtYBJ6P2k-D2psAEuYOjWr8w,66
|
|
431
431
|
squad/run/listener.py,sha256=jBeOQhPGb4EdIREB1QsCzYuumsfJ-TqJPd3nR-0m59g,200
|
432
432
|
squad/run/scheduler.py,sha256=CDJG3q5C0GuQuxwlMOfWTSSJpDdwbR6rzpbJfuA0xuw,277
|
433
433
|
squad/run/worker.py,sha256=jtML0h5qKDuSbpJ6_rpWP4MT_rsGA7a24AhwGxBquzk,594
|
434
|
-
squad-1.
|
435
|
-
squad-1.
|
436
|
-
squad-1.
|
437
|
-
squad-1.
|
438
|
-
squad-1.
|
439
|
-
squad-1.
|
434
|
+
squad-1.85.dist-info/COPYING,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
|
435
|
+
squad-1.85.dist-info/METADATA,sha256=1m8I9voN8Y6StBv8TUFvk2-eFN-EZegBK9YTNy7jXTI,1234
|
436
|
+
squad-1.85.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
437
|
+
squad-1.85.dist-info/entry_points.txt,sha256=apCDQydHZtvqV334ql6NhTJUAJeZRdtAm0TVcbbAi5Q,194
|
438
|
+
squad-1.85.dist-info/top_level.txt,sha256=_x9uqE1XppiiytmVTl_qNgpnXus6Gsef69HqfliE7WI,6
|
439
|
+
squad-1.85.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|