Skip to content

Commit

Permalink
add tests for re-running tasks with status scheduled
Browse files Browse the repository at this point in the history
  • Loading branch information
jefer94 committed Jun 7, 2024
1 parent 5e76d5f commit be241c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/changelog/v1.6.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# v1.6.0

- Add support for re-running tasks with status `SCHEDULED`.
2 changes: 1 addition & 1 deletion src/task_manager/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2024-present jefer94 <[email protected]>
#
# SPDX-License-Identifier: LGPL-3.0-or-later
__version__ = "1.5.0"
__version__ = "1.6.0"
5 changes: 3 additions & 2 deletions tests/management/commands/test_task_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,16 @@ def test_rerun_pending_tasks__with_2__is_not_so_old_yet(
# When: 2 TaskManager's, all tasks is old
# Then: remove all tasks
@pytest.mark.parametrize("delta", rerun_pending_tasks["long_delta_list"])
@pytest.mark.parametrize("status", ["PENDING", "SCHEDULED"])
def test_rerun_pending_tasks__with_2__all_tasks_is_old(
database, arrange, set_datetime, delta, capsys, patch, get_json_obj
database, arrange, set_datetime, delta, capsys, patch, get_json_obj, status
):
patch(clean_older_tasks=False, rerun_pending_tasks=True, daily_report=False)

utc_now = timezone.now()
set_datetime(utc_now)

model = arrange(2, {"last_run": utc_now - delta})
model = arrange(2, {"last_run": utc_now - delta, "status": status})

command = Command()
res = command.handle()
Expand Down

0 comments on commit be241c5

Please sign in to comment.