Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-lister
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine R. Dumont
swh-lister
Commits
8785fc1a
Commit
8785fc1a
authored
5 years ago
by
David Douard
Browse files
Options
Downloads
Patches
Plain Diff
cgit: fix cgit's task module and tests
forgot some `url_prefix` there.
parent
87cec2f5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
swh/lister/cgit/tasks.py
+1
-9
1 addition, 9 deletions
swh/lister/cgit/tasks.py
swh/lister/cgit/tests/test_tasks.py
+1
-24
1 addition, 24 deletions
swh/lister/cgit/tests/test_tasks.py
with
2 additions
and
33 deletions
swh/lister/cgit/tasks.py
+
1
−
9
View file @
8785fc1a
...
...
@@ -7,17 +7,9 @@ from swh.scheduler.celery_backend.config import app
from
.lister
import
CGitLister
def
new_lister
(
url
=
'
https://git.kernel.org/
'
,
url_prefix
=
None
,
instance
=
'
kernal
'
,
**
kw
):
return
CGitLister
(
url
=
url
,
instance
=
instance
,
url_prefix
=
url_prefix
,
**
kw
)
@app.task
(
name
=
__name__
+
'
.CGitListerTask
'
)
def
cgit_lister
(
**
lister_args
):
lister
=
new_lister
(
**
lister_args
)
lister
.
run
()
CGitLister
(
**
lister_args
).
run
()
@app.task
(
name
=
__name__
+
'
.ping
'
)
...
...
This diff is collapsed.
Click to expand it.
swh/lister/cgit/tests/test_tasks.py
+
1
−
24
View file @
8785fc1a
...
...
@@ -11,7 +11,7 @@ def test_ping(swh_app, celery_session_worker):
@patch
(
'
swh.lister.cgit.tasks.CGitLister
'
)
def
test_lister
_no_url_prefix
(
lister
,
swh_app
,
celery_session_worker
):
def
test_lister
(
lister
,
swh_app
,
celery_session_worker
):
# setup the mocked CGitLister
lister
.
return_value
=
lister
lister
.
run
.
return_value
=
None
...
...
@@ -25,29 +25,6 @@ def test_lister_no_url_prefix(lister, swh_app, celery_session_worker):
lister
.
assert_called_once_with
(
url
=
'
https://git.kernel.org/
'
,
url_prefix
=
None
,
instance
=
'
kernel
'
)
lister
.
db_last_index
.
assert_not_called
()
lister
.
run
.
assert_called_once_with
()
@patch
(
'
swh.lister.cgit.tasks.CGitLister
'
)
def
test_lister_with_url_prefix
(
lister
,
swh_app
,
celery_session_worker
):
# setup the mocked CGitLister
lister
.
return_value
=
lister
lister
.
run
.
return_value
=
None
res
=
swh_app
.
send_task
(
'
swh.lister.cgit.tasks.CGitListerTask
'
,
kwargs
=
dict
(
url
=
'
https://cgit.kde.org/
'
,
url_prefix
=
'
https://anongit.kde.org/
'
,
instance
=
'
kde
'
))
assert
res
res
.
wait
()
assert
res
.
successful
()
lister
.
assert_called_once_with
(
url
=
'
https://cgit.kde.org/
'
,
url_prefix
=
'
https://anongit.kde.org/
'
,
instance
=
'
kde
'
)
lister
.
db_last_index
.
assert_not_called
()
lister
.
run
.
assert_called_once_with
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment