self = <swh.storage.tests.test_storage.TestPgStorage object at 0x7f45b6c74748>
swh_storage = <swh.storage.validate.ValidatingProxyStorage object at 0x7f45b6c74a20>
def test_skipped_content_add_db(self, swh_storage):
cont = data.skipped_cont
cont2 = data.skipped_cont2
cont2["blake2s256"] = None
> actual_result = swh_storage.skipped_content_add([cont, cont, cont2])
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_storage.py:3763:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/storage/validate.py:70: in skipped_content_add
return self.storage.skipped_content_add(contents)
.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:427: in skipped_content_add
for c in content
.tox/py3/lib/python3.7/site-packages/swh/storage/storage.py:433: in <listcomp>
for missing_content in missing_contents
.tox/py3/lib/python3.7/site-packages/swh/storage/storage.py:429: in <genexpr>
all(
.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:448: in skipped_content_missing
for content in db.skipped_content_missing(contents, cur):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.db.Db object at 0x7f45ba4c4208>
contents = [{'blake2s256': b'\xad\xe1\x8b\x1a\xde\xcb3\xf8\x91\xca6fM\xa6v\xe1,w,\xc1\x93w\x8a\xac\x9a\x13{\x8d\xc5\x83K\x9b', 'c...e(2020, 5, 20, 7, 28, 1, 12728, tzinfo=datetime.timezone.utc), 'length': 314572800, 'reason': 'Content too long', ...}]
cur = <cursor object at 0x7f45b9c50808; closed: -1>
def skipped_content_missing(self, contents, cur=None):
if not contents:
return []
cur = self._cursor(cur)
query = """SELECT * FROM (VALUES %s) AS t (%s)
WHERE not exists
(SELECT 1 FROM skipped_content s WHERE
s.sha1 is not distinct from t.sha1::sha1 and
s.sha1_git is not distinct from t.sha1_git::sha1 and
s.sha256 is not distinct from t.sha256::bytea);""" % (
(", ".join("%s" for _ in contents)),
", ".join(self.content_hash_keys),
)
cur.execute(
query,
> [tuple(cont[key] for key in self.content_hash_keys) for cont in contents],
)
E psycopg2.errors.UndefinedTable: relation "skipped_content" does not exist
E LINE 3: (SELECT 1 FROM skipped_content s WHERE
E ^
.tox/py3/lib/python3.7/site-packages/swh/storage/db.py:192: UndefinedTable
TEST RESULT
TEST RESULT
- Run At
- May 20 2020, 9:28 AM