tmpdir = PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_list_origin_contributors0')
def test_list_origin_contributors(tmpdir):
tmpdir = Path(tmpdir)
topological_order_path = tmpdir / "topo_order.csv.zst"
origin_contributors_path = tmpdir / "origin_contributors.csv.zst"
origin_urls_path = tmpdir / "origin_urls.csv.zst"
subprocess.run(
["zstdmt", "-o", topological_order_path],
input=TOPOLOGICAL_ORDER.encode(),
check=True,
)
task = ListOriginContributors(
local_graph_path=DATA_DIR / "compressed",
topological_order_path=topological_order_path,
origin_contributors_path=origin_contributors_path,
origin_urls_path=origin_urls_path,
> graph_name="example",
)
.tox/py3/lib/python3.7/site-packages/swh/graph/tests/test_origin_contributors.py:97:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/luigi/task_register.py:87: in __call__
param_values = cls.get_param_values(params, args, kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'swh.graph.luigi.origin_contributors.ListOriginContributors'>
params = [('local_graph_path', <luigi.parameter.PathParameter object at 0x7ffaf47f45c0>), ('topological_order_path', <luigi.par...rameter.PathParameter object at 0x7ffaf47f40f0>), ('graph_name', <luigi.parameter.Parameter object at 0x7ffaf47fa390>)]
args = ()
kwargs = {'graph_name': 'example', 'local_graph_path': PosixPath('/var/lib/jenkins/workspace/DGRPH/tests-on-diff/.tox/py3/lib/p...rigin_urls_path': PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_list_origin_contributors0/origin_urls.csv.zst'), ...}
@classmethod
def get_param_values(cls, params, args, kwargs):
"""
Get the values of the parameters from the args and kwargs.
:param params: list of (param_name, Parameter).
:param args: positional arguments
:param kwargs: keyword arguments.
:returns: list of `(name, value)` tuples, one for each parameter.
"""
result = {}
params_dict = dict(params)
task_family = cls.get_task_family()
# In case any exceptions are thrown, create a helpful description of how the Task was invoked
# TODO: should we detect non-reprable arguments? These will lead to mysterious errors
exc_desc = '%s[args=%s, kwargs=%s]' % (task_family, args, kwargs)
# Fill in the positional arguments
positional_params = [(n, p) for n, p in params if p.positional]
for i, arg in enumerate(args):
if i >= len(positional_params):
raise parameter.UnknownParameterException('%s: takes at most %d parameters (%d given)' % (exc_desc, len(positional_params), len(args)))
param_name, param_obj = positional_params[i]
result[param_name] = param_obj.normalize(arg)
# Then the keyword arguments
for param_name, arg in kwargs.items():
if param_name in result:
raise parameter.DuplicateParameterException('%s: parameter %s was already set as a positional parameter' % (exc_desc, param_name))
if param_name not in params_dict:
> raise parameter.UnknownParameterException('%s: unknown parameter %s' % (exc_desc, param_name))
E luigi.parameter.UnknownParameterException: ListOriginContributors[args=(), kwargs={'local_graph_path': PosixPath('/var/lib/jenkins/workspace/DGRPH/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/graph/tests/dataset/compressed'), 'topological_order_path': PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_list_origin_contributors0/topo_order.csv.zst'), 'origin_contributors_path': PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_list_origin_contributors0/origin_contributors.csv.zst'), 'origin_urls_path': PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_list_origin_contributors0/origin_urls.csv.zst'), 'graph_name': 'example'}]: unknown parameter origin_urls_path
.tox/py3/lib/python3.7/site-packages/luigi/task.py:414: UnknownParameterException
TEST RESULT
TEST RESULT
- Run At
- Dec 19 2022, 6:00 PM