Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.storage.tests.test_storage.TestStorage::test_revision_log
Failed

TEST RESULT

Run At
May 20 2020, 9:28 AM
Details
self = <swh.storage.tests.test_storage.TestStorage object at 0x7f45c3a77cc0> swh_storage = <swh.storage.validate.ValidatingProxyStorage object at 0x7f466c09b4e0> def test_revision_log(self, swh_storage): # given # data.revision4 -is-child-of-> data.revision3 > swh_storage.revision_add([data.revision3, data.revision4]) .tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_storage.py:1027: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/swh/storage/validate.py:80: in revision_add return self.storage.revision_add(revisions) .tox/py3/lib/python3.7/site-packages/swh/storage/metrics.py:24: in d return f(*a, **kw) .tox/py3/lib/python3.7/site-packages/swh/storage/metrics.py:77: in d r = f(*a, **kw) .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/storage/storage.py:549: in revision_add set(revision.id for revision in revisions), db=db, cur=cur .tox/py3/lib/python3.7/site-packages/swh/core/db/common.py:90: in _meth yield from meth(self, *args, **kwargs) .tox/py3/lib/python3.7/site-packages/swh/storage/storage.py:594: in revision_missing for obj in db.revision_missing_from_list(revisions, cur): .tox/py3/lib/python3.7/site-packages/swh/storage/db.py:400: in revision_missing_from_list ((id,) for id in revisions), _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cur = <cursor object at 0x7f478e6b1ed0; closed: -1> sql = b'\n SELECT id FROM (VALUES %s) as t(id)\n WHERE NOT EXISTS (\n SELECT 1 FROM revision r WHERE r.id = t.id\n )\n ' argslist = <generator object Db.revision_missing_from_list.<locals>.<genexpr> at 0x7f45c0025660> template = b'(%s)', page_size = 100 def execute_values_generator(cur, sql, argslist, template=None, page_size=100): """Execute a statement using SQL ``VALUES`` with a sequence of parameters. Rows returned by the query are returned through a generator. You need to consume the generator for the queries to be executed! :param cur: the cursor to use to execute the query. :param sql: the query to execute. It must contain a single ``%s`` placeholder, which will be replaced by a `VALUES list`__. Example: ``"INSERT INTO mytable (id, f1, f2) VALUES %s"``. :param argslist: sequence of sequences or dictionaries with the arguments to send to the query. The type and content must be consistent with *template*. :param template: the snippet to merge to every item in *argslist* to compose the query. - If the *argslist* items are sequences it should contain positional placeholders (e.g. ``"(%s, %s, %s)"``, or ``"(%s, %s, 42)``" if there are constants value...). - If the *argslist* items are mappings it should contain named placeholders (e.g. ``"(%(id)s, %(f1)s, 42)"``). If not specified, assume the arguments are sequence and use a simple positional template (i.e. ``(%s, %s, ...)``), with the number of placeholders sniffed by the first element in *argslist*. :param page_size: maximum number of *argslist* items to include in every statement. If there are more items the function will execute more than one statement. :param yield_from_cur: Whether to yield results from the cursor in this function directly. .. __: https://www.postgresql.org/docs/current/static/queries-values.html After the execution of the function the `cursor.rowcount` property will **not** contain a total result. """ # we can't just use sql % vals because vals is bytes: if sql is bytes # there will be some decoding error because of stupid codec used, and Py3 # doesn't implement % on bytes. if not isinstance(sql, bytes): sql = sql.encode(psycopg2.extensions.encodings[cur.connection.encoding]) pre, post = _split_sql(sql) for page in _paginate(argslist, page_size=page_size): if template is None: template = b"(" + b",".join([b"%s"] * len(page[0])) + b")" parts = pre[:] for args in page: parts.append(cur.mogrify(template, args)) parts.append(b",") parts[-1:] = post > cur.execute(b"".join(parts)) E psycopg2.errors.UndefinedTable: relation "revision" does not exist E LINE 4: SELECT 1 FROM revision r WHERE r.id = t.id E ^ .tox/py3/lib/python3.7/site-packages/swh/core/db/db_utils.py:150: UndefinedTable