swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7fd39d18dcc0>
storage = <swh.storage.in_memory.InMemoryStorage object at 0x7fd39d18d0b8>
def test_task_schedule_origins_with_page_token(swh_scheduler, storage):
"""Tests support of extra keyword-arguments."""
nb_total_origins = 50
origins = _fill_storage_with_origins(storage, nb_total_origins)
# prepare page_token and origins result expectancy
page_result = storage.origin_list(limit=10)
assert len(page_result.results) == 10
page_token = page_result.next_page_token
assert page_token is not None
# remove the first 10 origins listed as we won't see those in tasks
expected_origins = [o for o in origins if o not in page_result.results]
nb_origins = len(expected_origins)
assert nb_origins == nb_total_origins - len(page_result.results)
max_task_size = 10
nb_tasks, remainder = divmod(nb_origins, max_task_size)
assert remainder == 0
result = invoke(
swh_scheduler,
False,
[
"task",
"schedule_origins",
"swh-test-ping",
"--batch-size",
max_task_size,
"--page-token",
> page_token,
],
)
.tox/py3/lib/python3.7/site-packages/swh/scheduler/tests/test_cli.py:782:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/task.py:381: in schedule_origin_metadata_index
schedule_origin_batches(scheduler, type, origin_urls, origin_batch_size, kw)
.tox/py3/lib/python3.7/site-packages/swh/scheduler/cli/utils.py:43: in schedule_origin_batches
scheduler.create_tasks(task_batch)
.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