Skip to content

Commit

Permalink
Added regression test for archive_fail_workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
arhall0 committed Jan 28, 2025
1 parent ef9d0ae commit 2b0a261
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions beeflow/tests/test_wf_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@


@pytest.mark.parametrize(
"final_state, expected_state", [(None, "Archived"), ("FAILED", "Archived/FAILED")]
"test_function, expected_state",
[
(wf_update.archive_workflow, "Archived"),
(wf_update.archive_fail_workflow, "Archived/Failed"),
],
)
def test_archive_workflow(tmpdir, mocker, final_state, expected_state):
def test_archive_workflow(tmpdir, mocker, test_function, expected_state):
"""Regression test archive_workflow."""
workdir = str(tmpdir / "workdir")
db = mocker.MagicMock()
Expand All @@ -35,7 +39,7 @@ def test_archive_workflow(tmpdir, mocker, final_state, expected_state):
os.makedirs("bee_archive_dir/workflows")
with open(".config/beeflow/bee.conf", "w", encoding="utf-8"):
pass
wf_update.archive_workflow(db, "wf_id_test", final_state)
test_function(db, "wf_id_test")
assert os.path.exists("bee_archive_dir/wf_id_test.tgz")
mock_export_dag.assert_called_once_with(
"wf_id_test",
Expand Down

0 comments on commit 2b0a261

Please sign in to comment.