Allow gitlab lister's name to be overriden by task arguments
This will allow to dedicate the heptapod instances into its their own stats. Related to T3581
This commit is contained in:
parent
fdb420238c
commit
c803fc2b59
2 changed files with 10 additions and 4 deletions
|
@ -97,16 +97,17 @@ class GitLabLister(Lister[GitLabListerState, PageResult]):
|
|||
|
||||
"""
|
||||
|
||||
LISTER_NAME = "gitlab"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
scheduler,
|
||||
url: str,
|
||||
name: Optional[str] = "gitlab",
|
||||
instance: Optional[str] = None,
|
||||
credentials: Optional[CredentialsType] = None,
|
||||
incremental: bool = False,
|
||||
):
|
||||
if name is not None:
|
||||
self.LISTER_NAME = name
|
||||
super().__init__(
|
||||
scheduler=scheduler,
|
||||
url=url.rstrip("/"),
|
||||
|
|
|
@ -57,11 +57,16 @@ def test_lister_gitlab(datadir, swh_scheduler, requests_mock):
|
|||
|
||||
|
||||
def test_lister_gitlab_heptapod(datadir, swh_scheduler, requests_mock):
|
||||
"""Gitlab lister ignores some vcs_type
|
||||
"""Heptapod lister happily lists hg, hg_git as hg and git origins
|
||||
|
||||
"""
|
||||
name = "heptapod"
|
||||
instance = "foss.heptapod.net"
|
||||
lister = GitLabLister(swh_scheduler, url=api_url(instance), instance=instance)
|
||||
lister = GitLabLister(
|
||||
swh_scheduler, url=api_url(instance), name=name, instance=instance
|
||||
)
|
||||
assert lister.LISTER_NAME == name
|
||||
|
||||
response = gitlab_page_response(datadir, instance, 1)
|
||||
|
||||
requests_mock.get(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue