Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
w
Browse files Browse the repository at this point in the history
  • Loading branch information
DonHaul committed Aug 27, 2024
1 parent 770f77f commit 84e2744
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions backoffice/backoffice/workflows/airflow_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ def restart_workflow_dags(workflow_id, workflow_type, params=None):
:param params: parameters of new dag execution
:returns: request response
"""
import ipdb

ipdb.set_trace()
delete_workflow_dag_runs(workflow_id, workflow_type)

return trigger_airflow_dag(
Expand All @@ -179,9 +182,6 @@ def delete_workflow_dag_runs(workflow_id, workflow_type, params=None):
if data is None:
data = dag_data["conf"].get("data")

trigger_airflow_dag(
WORKFLOW_DAGS[workflow_type].initialize, str(workflow_id), params or data
)
return JsonResponse(
data={"message": f"Dag runs for worfklow {workflow_id} have been deleted"}
)
9 changes: 6 additions & 3 deletions backoffice/backoffice/workflows/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ def test_restart_full_dagrun(self):
"api:workflows-authors-restart",
kwargs={"pk": self.workflow.id},
)
import ipdb

ipdb.set_trace()
response = self.api_client.post(url)
self.assertEqual(response.status_code, 200)
self.assertIn("test", response.json()["conf"]["data"])
Expand All @@ -429,8 +432,9 @@ def test_restart_a_task(self):
"api:workflows-authors-restart",
kwargs={"pk": self.workflow.id},
)

response = self.api_client.post(
url, json={"task_ids": ["set_workflow_status_to_running"]}
url, format="json", data={"restart_current_task": True}
)
self.assertEqual(response.status_code, 200)

Expand All @@ -441,9 +445,8 @@ def test_restart_with_params(self):
"api:workflows-authors-restart",
kwargs={"pk": self.workflow.id},
)

response = self.api_client.post(
url, json={"params": {"workflow_id": self.workflow.id}}
url, format="json", data={"params": {"workflow_id": self.workflow.id}}
)
self.assertEqual(response.status_code, 200)

Expand Down

0 comments on commit 84e2744

Please sign in to comment.