Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tracker): remove invalid planned state (#268) #268

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading