Skip to content

Commit

Permalink
fix(tracker): remove invalid planned state (reanahub#268)
Browse files Browse the repository at this point in the history
The `planned` status is not defined or used anywhere in REANA and it was
simply ignored.

Closes reanahub#255
  • Loading branch information
mdonadoni committed May 29, 2024
1 parent 95341c8 commit 8f7cd07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
4 changes: 0 additions & 4 deletions reana_workflow_engine_yadage/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def publish_workflow_final_status(self) -> None:
@staticmethod
def _build_init_progress_state() -> Dict:
return {
"planned": {"total": 0, "job_ids": []},
"failed": {"total": 0, "job_ids": []},
"total": {"total": 0, "job_ids": []},
"running": {"total": 0, "job_ids": []},
Expand Down Expand Up @@ -176,9 +175,6 @@ def _get_nodes_state(adageobj) -> Generator[Dict, None, None]:
elif dagstate.node_ran_and_failed(nodeobj):
state = "failed"
job_id = nodeobj.resultproxy.jobproxy["job_id"]
elif dagstate.upstream_failure(dag, nodeobj):
state = "planned"
job_id = None
else:
state = "total"
job_id = None
Expand Down
21 changes: 9 additions & 12 deletions tests/test_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
import pytest


def _build_progress_state(
planned: int, total: int, failed: int, running: int, finished: int
):
def _build_progress_state(total: int, failed: int, running: int, finished: int):
return {
"planned": {"total": planned},
"total": {"total": total},
"failed": {"total": failed},
"running": {"total": running},
Expand All @@ -32,18 +29,18 @@ class TestReanaTracker:
"prev_progress,next_progress,is_progressed",
[
(
_build_progress_state(0, 0, 0, 0, 0),
_build_progress_state(0, 0, 0, 0, 0),
_build_progress_state(0, 0, 0, 0),
_build_progress_state(0, 0, 0, 0),
False,
),
(
_build_progress_state(0, 0, 0, 0, 0),
_build_progress_state(0, 2, 0, 0, 0),
_build_progress_state(0, 0, 0, 0),
_build_progress_state(2, 0, 0, 0),
True,
),
(
_build_progress_state(0, 0, 2, 0, 0),
_build_progress_state(0, 0, 2, 1, 0),
_build_progress_state(0, 2, 0, 0),
_build_progress_state(0, 2, 1, 0),
True,
),
],
Expand All @@ -62,11 +59,11 @@ def test_workflow_progressed(self, prev_progress, next_progress, is_progressed):
"progress,is_failed",
[
(
_build_progress_state(0, 2, 0, 0, 2),
_build_progress_state(2, 0, 0, 2),
False,
),
(
_build_progress_state(0, 2, 1, 1, 0),
_build_progress_state(2, 1, 1, 0),
True,
),
({"failed": {"wrong_key": 0}}, True),
Expand Down

0 comments on commit 8f7cd07

Please sign in to comment.