self = <swh.search.tests.test_elasticsearch.TestElasticsearchSearch testMethod=test_origin_with_visit_added>
def test_origin_with_visit_added(self):
origin_foobar_baz = {"url": "http://foobar.baz"}
> self.search.origin_update([origin_foobar_baz])
.tox/py3/lib/python3.7/site-packages/swh/search/tests/test_search.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.search.elasticsearch.ElasticSearch object at 0x7f4d54c1cb00>
args = ([{'url': 'http://foobar.baz'}],), kwargs = {}, script_error = True
error_detail = '\nPainless update script failed (compile error).\nerror type: illegal_argument_exception\nerror reason: invalid decla...nscript stack:\n\n... it_types field value\nLit visit_types = ctx._source ...\n ^---- HERE'
error = {'caused_by': {'reason': 'invalid declaration: cannot resolve type [Lit]', 'type': 'illegal_argument_exception'}, 'lang': 'painless', 'position': {'end': 72, 'offset': 47, 'start': 22}, 'reason': 'compile error', ...}
@py_assert2 = False, @py_assert1 = False, @py_format4 = 'True is False'
@py_format6 = 'Painless update script failed (compile error).\n~error type: illegal_argument_exception\n~error reason: invalid decla...types field value\n~Lit visit_types = ctx._source ...\n~ ^---- HERE\n>assert True is False'
def _origin_update(self, *args, **kwargs):
script_error = False
error_detail = ""
try:
origin_update(*args, **kwargs)
except BulkIndexError as e:
error = e.errors[0].get("update", {}).get("error", {}).get("caused_by")
if error and "script_stack" in error:
script_error = True
error_detail = dedent(
f"""
Painless update script failed ({error.get('reason')}).
error type: {error.get('caused_by', {}).get('type')}
error reason: {error.get('caused_by', {}).get('reason')}
script stack:
"""
)
error_detail += "\n".join(error["script_stack"])
else:
raise e
> assert script_error is False, error_detail[1:]
E AssertionError: Painless update script failed (compile error).
E error type: illegal_argument_exception
E error reason: invalid declaration: cannot resolve type [Lit]
E script stack:
E
E ... it_types field value
E Lit visit_types = ctx._source ...
E ^---- HERE
E assert True is False
.tox/py3/lib/python3.7/site-packages/swh/search/tests/test_elasticsearch.py:50: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jun 11 2021, 12:30 PM