Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Merge requests
!2304
Link tasks to their restarts
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Link tasks to their restarts
fk-task-restart
into
master
Overview
11
Commits
10
Pipelines
0
Changes
2
Merged
Theo Lesage
requested to merge
fk-task-restart
into
master
11 months ago
Overview
4
Commits
10
Pipelines
0
Changes
2
Expand
Closes
#1711 (closed)
0
0
Merge request reports
Viewing commit
bd7b288c
Show latest version
2 files
+
7
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
bd7b288c
Fixed broken test from proper already restarted test
· bd7b288c
Theo Lesage
authored
10 months ago
arkindex/ponos/tests/test_api.py
+
6
−
4
Options
@@ -589,14 +589,16 @@ class TestAPI(FixtureAPITestCase):
self
.
task1
.
slug
=
self
.
task1
.
slug
+
"
_old1
"
self
.
task1
.
state
=
State
.
Completed
.
value
self
.
task1
.
save
()
with
self
.
assertNumQueries
(
7
):
self
.
task2
.
original_task_id
=
self
.
task1
.
id
self
.
task2
.
save
()
with
self
.
assertNumQueries
(
8
):
response
=
self
.
client
.
post
(
reverse
(
"
api:task-restart
"
,
kwargs
=
{
"
pk
"
:
str
(
self
.
task1
.
id
)})
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_400_BAD_REQUEST
)
self
.
assertListEqual
(
response
.
json
(),
[
"
This task has already been restarted
"
],
[
"
This task has already been restarted
.
"
],
)
@patch
(
"
arkindex.project.aws.s3
"
)
@@ -635,6+637,6 @@
old_task_2
.
state
=
State
.
Error
.
value
old_task_2
.
save
()
old_task_2
.
parents
.
add
(
self
.
task1
)
self
.
task1
.
state
=
State
.
Completed
.
value
self
.
task1
.
save
()
self
.
task2
.
state
=
State
.
Error
.
value
self
.
task2
.
save
()
self
.
client
.
force_login
(
self
.
user
)
with
self
.
assertNumQueries
(
1
3
):
with
self
.
assertNumQueries
(
1
4
):
with
patch
(
"
django.utils.timezone.now
"
)
as
mock_now
:
mock_now
.
return_value
=
datetime
.
now
(
timezone
.
utc
)
+
timedelta
(
minutes
=
2
)
response
=
self
.
client
.
post
(
@@ -708,7 +710,7 @@ class TestAPI(FixtureAPITestCase):
self
.
task2
.
save
()
self
.
client
.
force_login
(
self
.
user
)
with
self
.
assertNumQueries
(
1
3
):
with
self
.
assertNumQueries
(
1
4
):
response
=
self
.
client
.
post
(
reverse
(
"
api:task-restart
"
,
kwargs
=
{
"
pk
"
:
str
(
self
.
task2
.
id
)})
)
Loading