Job registry #197
Annotations
5 errors
tests/resources/test_resources.py#L132
test_simple_flow
AssertionError: assert {'args': {'ty...1b9e2eb', ...} == {'args': {'ar...1b9e2eb', ...}
Omitting 14 identical items, use -vv to show
Differing items:
{'args': {'type': 'custom'}} != {'args': {'args': {}, 'type': 'custom'}}
Full diff:
{
- 'args': {'args': {}, 'type': 'custom'},
? ------------
+ 'args': {'type': 'custom'},
'created': '2024-08-28T13:16:52.515973+00:00',
'finished_at': None,
'id': '1fed3a3d-e279-438f-8394-24ea11b9e2eb',
'job_id': '3fdce505-314f-4f08-9c7f-4e1b9357c368',
'links': {'logs': 'https://127.0.0.1:5000/api/jobs/3fdce505-314f-4f08-9c7f-4e1b9357c368/runs/1fed3a3d-e279-438f-8394-24ea11b9e2eb/logs',
'self': 'https://127.0.0.1:5000/api/jobs/3fdce505-314f-4f08-9c7f-4e1b9357c368/runs/1fed3a3d-e279-438f-8394-24ea11b9e2eb',
'stop': 'https://127.0.0.1:5000/api/jobs/3fdce505-314f-4f08-9c7f-4e1b9357c368/runs/1fed3a3d-e279-438f-8394-24ea11b9e2eb/actions/stop'},
'message': None,
'queue': 'celery',
'started_at': None,
'started_by': {'id': '1',
'identities': {},
'is_current_user': True,
'links': {},
'profile': {'affiliations': 'CERN', 'full_name': 'User'},
'type': 'user',
'username': 'user'},
'started_by_id': 1,
'status': 'QUEUED',
'task_id': 'bab7f914-12f3-454a-84fe-9f56100056cd',
'title': 'Manually triggered run',
'updated': '2024-08-28T13:16:52.515977+00:00',
}
|
invenio_jobs/models.py#L1
Black format check
--- /home/runner/work/invenio-jobs/invenio-jobs/invenio_jobs/models.py 2024-08-28 13:15:08.446285+00:00
+++ /home/runner/work/invenio-jobs/invenio-jobs/invenio_jobs/models.py 2024-08-28 13:16:54.956244+00:00
@@ -160,11 +160,13 @@
that the Jinja template context only includes "safe" values, i.e. no DB model
classes or Python objects or functions. Otherwise, we risk that users could
execute arbitrary code, or perform harmful DB operations (e.g. delete rows).
"""
if task_arguments:
- args = Task.get(job.task).build_task_arguments(job_obj=job, **task_arguments)
+ args = Task.get(job.task).build_task_arguments(
+ job_obj=job, **task_arguments
+ )
else:
args = deepcopy(job.default_args)
args = json.dumps(args, indent=4, sort_keys=True, default=str)
args = json.loads(args)
return args
@@ -210,6 +212,5 @@
@classmethod
def get(cls, id_):
"""Get registered task by id."""
return cls(current_jobs.registry.get(id_))
-
|
invenio_jobs/services/schema.py#L1
isort-check
from invenio_i18n import lazy_gettext as _
from invenio_users_resources.services import schemas as user_schemas
-from marshmallow import EXCLUDE, Schema, fields, post_load, pre_dump, types, validate, \
- pre_load
+from marshmallow import (
+ EXCLUDE,
+ Schema,
+ fields,
+ post_load,
+ pre_dump,
+ pre_load,
+ types,
+ validate,
+)
from marshmallow_oneofschema import OneOfSchema
from marshmallow_utils.fields import SanitizedUnicode, TZDateTime
from marshmallow_utils.permissions import FieldPermissionsMixin
|
invenio_jobs/services/schema.py#L1
Black format check
--- /home/runner/work/invenio-jobs/invenio-jobs/invenio_jobs/services/schema.py 2024-08-28 13:15:08.446285+00:00
+++ /home/runner/work/invenio-jobs/invenio-jobs/invenio_jobs/services/schema.py 2024-08-28 13:17:01.006593+00:00
@@ -12,12 +12,20 @@
from copy import deepcopy
from datetime import timezone
from invenio_i18n import lazy_gettext as _
from invenio_users_resources.services import schemas as user_schemas
-from marshmallow import EXCLUDE, Schema, fields, post_load, pre_dump, types, validate, \
- pre_load
+from marshmallow import (
+ EXCLUDE,
+ Schema,
+ fields,
+ post_load,
+ pre_dump,
+ types,
+ validate,
+ pre_load,
+)
from marshmallow_oneofschema import OneOfSchema
from marshmallow_utils.fields import SanitizedUnicode, TZDateTime
from marshmallow_utils.permissions import FieldPermissionsMixin
from marshmallow_utils.validators import LazyOneOf
|
|
This job failed
Loading