Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.loader.git.tests.test_loader.TestGitLoader2::test_load_incremental
Failed

TEST RESULT

Run At
May 3 2022, 6:48 PM
Details
self = <swh.loader.git.tests.test_loader.TestGitLoader2 object at 0x7f303c484390> mocker = <pytest_mock.plugin.MockerFixture object at 0x7f303a9b3cf8> def test_load_incremental(self, mocker): statsd_report = mocker.patch("swh.core.statsd.statsd._report") snapshot_id = b"\x01" * 20 now = datetime.datetime.now(tz=datetime.timezone.utc) def ovgl(origin_url, allowed_statuses, require_snapshot, type): if origin_url == f"base://{self.repo_url}": return OriginVisit(origin=origin_url, visit=42, date=now, type="git") else: return None self.loader.storage.origin_visit_get_latest.side_effect = ovgl self.loader.storage.origin_visit_status_get_latest.return_value = ( OriginVisitStatus( origin=f"base://{self.repo_url}", visit=42, snapshot=snapshot_id, date=now, status="full", ) ) self.loader.storage.snapshot_get_branches.return_value = { "id": snapshot_id, "branches": { b"refs/heads/master": SNAPSHOT1.branches[b"refs/heads/master"] }, "next_branch": None, } res = self.loader.load() assert res == {"status": "eventful"} self.fetcher_cls.assert_called_once_with( credentials={}, lister_name="fake-lister", lister_instance_name="", origin=Origin(url=self.repo_url), ) self.fetcher.get_parent_origins.assert_called_once_with() # First tries the same origin assert self.loader.storage.origin_visit_get_latest.mock_calls == [ call( self.repo_url, allowed_statuses=None, require_snapshot=True, type=None, ), # As it does not already have a snapshot, fall back to the parent origin call( f"base://{self.repo_url}", allowed_statuses=None, require_snapshot=True, type=None, ), ] p = "swh.loader.git" > assert [c for c in statsd_report.mock_calls if c.args[0].startswith(p)] == [ call(f"{p}.loader.incremental.from_parent_origin", "c", 1, None, 1), call( f"{p}.loader.ratio_ignored_refs", "h", 0.0, {"incremental": "from_parent_origin"}, 1, ), call( f"{p}.loader.ratio_known_refs", "h", 0.25, {"incremental": "from_parent_origin"}, 1, ), ] E AssertionError: assert [] == [call('swh.lo..._origin'}, 1)] E Right contains 3 more items, first extra item: call('swh.loader.git.loader.incremental.from_parent_origin', 'c', 1, None, 1) E Full diff: E [ E + , E - call('swh.loader.git.loader.incremental.from_parent_origin', 'c', 1, None, 1), E - call('swh.loader.git.loader.ratio_ignored_refs', 'h', 0.0, {'incremental': 'from_parent_origin'}, 1), E - call('swh.loader.git.loader.ratio_known_refs', 'h', 0.25, {'incremental': 'from_parent_origin'}, 1),... E E ...Full output truncated (2 lines hidden), use '-vv' to show .tox/py3/lib/python3.7/site-packages/swh/loader/git/tests/test_loader.py:263: AssertionError