lister.tests: Add missing task_type for package listers
The scheduler module no longer initializes itself those task_type.
This commit is contained in:
parent
5191d291da
commit
1cf7c8e86b
10 changed files with 104 additions and 22 deletions
|
@ -49,6 +49,7 @@ class GNULister(SimpleLister):
|
|||
|
||||
"""
|
||||
artifacts = self.gnu_tree.artifacts[origin_url]
|
||||
assert origin_type == 'tar'
|
||||
return utils.create_task_dict(
|
||||
'load-%s' % origin_type,
|
||||
kwargs.get('policy', 'oneshot'),
|
||||
|
|
|
@ -1 +1,23 @@
|
|||
# Copyright (C) 2019 The Software Heritage developers
|
||||
# See the AUTHORS file at the top-level directory of this distribution
|
||||
# License: GNU General Public License version 3, or any later version
|
||||
# See top-level LICENSE file for more information
|
||||
|
||||
import pytest
|
||||
|
||||
from swh.lister.core.tests.conftest import * # noqa
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def lister_gnu(swh_listers):
|
||||
lister = swh_listers['gnu']
|
||||
|
||||
# Add the load-deb-package in the scheduler backend
|
||||
lister.scheduler.create_task_type({
|
||||
'type': 'load-tar',
|
||||
'description': 'Load archive files',
|
||||
'backend_name': 'swh.loader.package.tasks.LoadArchive',
|
||||
'default_interval': '1 day',
|
||||
})
|
||||
|
||||
return lister
|
||||
|
|
|
@ -9,12 +9,10 @@ import logging
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def test_gnu_lister(swh_listers, requests_mock_datadir):
|
||||
lister = swh_listers['gnu']
|
||||
def test_gnu_lister(lister_gnu, requests_mock_datadir):
|
||||
lister_gnu.run()
|
||||
|
||||
lister.run()
|
||||
|
||||
r = lister.scheduler.search_tasks(task_type='load-tar')
|
||||
r = lister_gnu.scheduler.search_tasks(task_type='load-tar')
|
||||
assert len(r) == 383
|
||||
|
||||
for row in r:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue