swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7fd39d14c940>
listed_origins_by_type = {'git': [ListedOrigin(lister_id=UUID('0e4ddc85-4480-42cc-a6e6-9f44a2e5a6db'), url='https://git.example.com/0000', visi...etime(2020, 6, 15, 16, 0, 0, 1005, tzinfo=datetime.timezone.utc), enabled=True, first_seen=None, last_seen=None), ...]}
def test_schedule_next(swh_scheduler, listed_origins_by_type):
for task_type in TASK_TYPES.values():
swh_scheduler.create_task_type(task_type)
NUM_RESULTS = 10
# Strict inequality to check that grab_next_visits doesn't return more
# results than requested
visit_type = next(iter(listed_origins_by_type))
assert len(listed_origins_by_type[visit_type]) > NUM_RESULTS
for origins in listed_origins_by_type.values():
swh_scheduler.record_listed_origins(origins)
> result = invoke(swh_scheduler, args=("schedule-next", visit_type, str(NUM_RESULTS)))
.tox/py3/lib/python3.7/site-packages/swh/scheduler/tests/test_cli_origin.py:97:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/scheduler/tests/test_cli_origin.py:17: in invoke
scheduler, args=["origin", *args], catch_exceptions=catch_exceptions
.tox/py3/lib/python3.7/site-packages/swh/scheduler/tests/test_cli.py:44: in invoke
raise result.exception
.tox/py3/lib/python3.7/site-packages/click/testing.py:329: in invoke
cli.main(args=args or (), prog_name=prog_name, **extra)
.tox/py3/lib/python3.7/site-packages/click/core.py:782: in main
rv = self.invoke(ctx)
.tox/py3/lib/python3.7/site-packages/click/core.py:1259: in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
.tox/py3/lib/python3.7/site-packages/click/core.py:1259: in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
.tox/py3/lib/python3.7/site-packages/click/core.py:1066: in invoke
return ctx.invoke(self.callback, **ctx.params)
.tox/py3/lib/python3.7/site-packages/click/core.py:610: in invoke
return callback(*args, **kwargs)
.tox/py3/lib/python3.7/site-packages/click/decorators.py:21: in new_func
return f(get_current_context(), *args, **kwargs)
.tox/py3/lib/python3.7/site-packages/swh/scheduler/cli/origin.py:137: in schedule_next
for origin in origins
.tox/py3/lib/python3.7/site-packages/swh/core/db/common.py:62: in _meth
return meth(self, *args, db=db, cur=cur, **kwargs)
.tox/py3/lib/python3.7/site-packages/swh/scheduler/backend.py:506: in create_tasks
cur.execute("select swh_scheduler_mktemp_task()")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <cursor object at 0x7fd39d29fe48; closed: -1>
query = 'select swh_scheduler_mktemp_task()', vars = None
def execute(self, query, vars=None):
self.column_mapping = []
self._query_executed = True
> return super().execute(query, vars)
E psycopg2.errors.UndefinedFunction: function swh_scheduler_mktemp_task() does not exist
E LINE 1: select swh_scheduler_mktemp_task()
E ^
E HINT: No function matches the given name and argument types. You might need to add explicit type casts.
.tox/py3/lib/python3.7/site-packages/psycopg2/extras.py:236: UndefinedFunction
TEST RESULT
TEST RESULT
- Run At
- Jun 23 2021, 6:13 PM