self = <swh.search.tests.test_elasticsearch.TestElasticsearchSearch testMethod=test_origin_intrinsic_metadata_date>
def test_origin_intrinsic_metadata_date(self):
"""Checks inserting a date-like in a field does not update the mapping to
require every document uses a date in that field; or that search queries
use a date either.
Likewise for numeric fields."""
origin1 = {"url": "http://origin1"}
origin2 = {"url": "http://origin2"}
self.search.origin_update(
[
{
**origin1,
"intrinsic_metadata": {
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"dateCreated": "2021-02-18T10:16:52",
> "version": "1.0",
},
}
]
)
.tox/py3/lib/python3.7/site-packages/swh/search/tests/test_search.py:436:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.search.elasticsearch.ElasticSearch object at 0x7f4d54c1cbe0>
args = ([{'intrinsic_metadata': {'@context': 'https://doi.org/10.5063/schema/codemeta-2.0', 'dateCreated': '2021-02-18T10:16:52', 'version': '1.0'}, 'url': 'http://origin1'}],)
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