self = <swh.vault.tests.test_cookers.TestRevisionCooker object at 0x7f04fb7385c0>
git_loader = <function git_loader.<locals>._create_loader at 0x7f04fb822e18>
cook_extract_revision = <function cook_extract_revision_git_bare at 0x7f04fce63598>
def test_revision_simple(self, git_loader, cook_extract_revision):
(loader, swhid) = self.load_repo_simple(git_loader)
> with cook_extract_revision(loader.storage, swhid) as (ert, p):
.tox/py3/lib/python3.7/site-packages/swh/vault/tests/test_cookers.py:947:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.7/contextlib.py:112: in __enter__
return next(self.gen)
.tox/py3/lib/python3.7/site-packages/swh/vault/tests/test_cookers.py:331: in cook_extract_revision_git_bare
with cook_extract_git_bare(storage, swhid, fsck=fsck,) as res:
/usr/lib/python3.7/contextlib.py:112: in __enter__
return next(self.gen)
.tox/py3/lib/python3.7/site-packages/swh/vault/tests/test_cookers.py:310: in cook_extract_git_bare
cooker.prepare_bundle()
.tox/py3/lib/python3.7/site-packages/swh/vault/cookers/git_bare.py:135: in prepare_bundle
self.push_subgraph(self.obj_type, self.obj_id)
.tox/py3/lib/python3.7/site-packages/swh/vault/cookers/git_bare.py:298: in push_subgraph
self.push_revision_subgraph(obj_id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.vault.cookers.git_bare.GitBareCooker object at 0x7f04fb80cb38>
obj_id = b'e9\x1b\xd5B\xa2\xd6\xe7\x0b\x16X\xd1a\xc8\xf850A\xea\xcb'
def push_revision_subgraph(self, obj_id: Sha1Git) -> None:
"""Fetches a revision and all its children, and writes them to disk"""
loaded_from_graph = False
if self.graph:
from swh.graph.client import GraphArgumentException
# First, try to cook using swh-graph, as it is more efficient than
# swh-storage for querying the history
obj_swhid = CoreSWHID(object_type=ObjectType.REVISION, object_id=obj_id,)
try:
revision_ids = (
swhid.object_id
for swhid in map(
CoreSWHID.from_string,
self.graph.visit_nodes(str(obj_swhid), edges="rev:rev"),
)
)
self._push(self._rev_stack, revision_ids)
except GraphArgumentException as e:
logger.info(
"Revision %s not found in swh-graph, falling back to fetching "
"history using swh-storage. %s",
hash_to_hex(obj_id),
e.args[0],
)
else:
loaded_from_graph = True
if not loaded_from_graph:
# If swh-graph is not available, or the revision is not yet in
# swh-graph, fall back to self.storage.revision_log.
# self.storage.revision_log also gives us the full revisions,
# so we load them right now instead of just pushing them on the stack.
walker = DFSRevisionsWalker(self.storage, obj_id, state=self._walker_state)
for revision in walker:
self.write_revision_node(revision)
> self.nb_loaded += 1
E AttributeError: 'GitBareCooker' object has no attribute 'nb_loaded'
.tox/py3/lib/python3.7/site-packages/swh/vault/cookers/git_bare.py:384: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Nov 23 2021, 4:08 PM