swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f20300bc4a8>
storage = <swh.storage.in_memory.InMemoryStorage object at 0x7f20293ced68>
def test_cli_task_runner_no_task(swh_scheduler, storage):
"""Trigger runner with no parameter should run as before."""
# The runner will just iterate over the existing tasks from the scheduler and do
# noop. We are just checking the runner does not explode here.
> result = invoke(swh_scheduler, False, ["start-runner",],)
.tox/py3/lib/python3.7/site-packages/swh/scheduler/tests/test_cli.py:856:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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: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)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ctx = <click.core.Context object at 0x7f2030e21e10>, period = 0
task_type_names = None, with_priority = False
@cli.command("start-runner")
@click.option(
"--period",
"-p",
default=0,
help=(
"Period (in s) at witch pending tasks are checked and "
"executed. Set to 0 (default) for a one shot."
),
)
@click.option(
"--task-types",
"task_type_names",
default=None,
help=(
"Task types to scheduler. If not provided, this iterates over every "
"task types referenced in the scheduler backend."
),
)
@click.option(
"--with-priority",
is_flag=True,
default=False,
help=(
"Determine if those tasks should be the ones with priority or not."
"By default, this deals with tasks without any priority."
),
)
@click.pass_context
def runner(ctx, period, task_type_names, with_priority):
"""Starts a swh-scheduler runner service.
This process is responsible for checking for ready-to-run tasks and
schedule them."""
from swh.scheduler.celery_backend.config import build_app
from swh.scheduler.celery_backend.runner import run_ready_tasks
config = ctx.obj["config"]
app = build_app(config.get("celery"))
app.set_current()
logger = logging.getLogger(__name__ + ".runner")
scheduler = ctx.obj["scheduler"]
logger.debug("Scheduler %s" % scheduler)
task_types = []
if not task_type_names:
> for task_type_name in task_type_names:
E TypeError: 'NoneType' object is not iterable
.tox/py3/lib/python3.7/site-packages/swh/scheduler/cli/admin.py:63: TypeError
TEST RESULT
TEST RESULT
- Run At
- Aug 13 2021, 2:46 PM