diff --git a/HISTORY.rst b/HISTORY.rst index 84122107..c63f48cf 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,13 @@ Change Log All notable changes to this project will be documented in this file. This project adheres to `Semantic Versioning `__. +[37.0.0] - 2021-02-19 +--------------------- +Changed +~~~~~~~ +- ``run_task`` now exits with the exit code from the task. +- ``reversed_statuses`` works now, with statuses of 245 and 241. + [36.0.5] - 2021-02-11 --------------------- Changed diff --git a/src/scriptworker/constants.py b/src/scriptworker/constants.py index f49e3192..10991337 100644 --- a/src/scriptworker/constants.py +++ b/src/scriptworker/constants.py @@ -49,7 +49,7 @@ "reclaim_interval": 300, "poll_interval": 10, "sign_key_timeout": 60 * 2, - "reversed_statuses": immutabledict({-11: STATUSES["intermittent-task"], -15: STATUSES["intermittent-task"]}), + "reversed_statuses": immutabledict({245: "intermittent-task", 241: "intermittent-task"}), # Report this status on max_timeout. `intermittent-task` will rerun the # task automatically. `internal-error` or other will require manual # intervention. diff --git a/src/scriptworker/task.py b/src/scriptworker/task.py index 297e1660..1ce9d8c3 100644 --- a/src/scriptworker/task.py +++ b/src/scriptworker/task.py @@ -644,7 +644,7 @@ async def run_task(context, to_cancellable_process): if stopped_due_to_worker_shutdown: raise WorkerShutdownDuringTask - return 1 if exitcode != 0 else 0 + return exitcode # reclaim_task {{{1 diff --git a/src/scriptworker/version.py b/src/scriptworker/version.py index 7df082cd..54ebeff1 100755 --- a/src/scriptworker/version.py +++ b/src/scriptworker/version.py @@ -54,7 +54,7 @@ def get_version_string(version: Union[ShortVerType, LongVerType]) -> str: # 1}}} # Semantic versioning 2.0.0 http://semver.org/ -__version__ = (36, 0, 5) +__version__ = (37, 0, 0) __version_string__ = get_version_string(__version__) diff --git a/tests/test_task.py b/tests/test_task.py index e5bd6123..08922b75 100644 --- a/tests/test_task.py +++ b/tests/test_task.py @@ -520,6 +520,14 @@ async def test_reportException(context, successful_queue): assert successful_queue.info == ["reportException", ("taskId", "runId", {"reason": "worker-shutdown"}), {}] +@pytest.mark.parametrize("exit_code", (245, 241)) +@pytest.mark.asyncio +async def test_reversed_statuses(context, successful_queue, exit_code): + context.temp_queue = successful_queue + await swtask.complete_task(context, exit_code) + assert successful_queue.info == ["reportException", ("taskId", "runId", {"reason": context.config["reversed_statuses"][exit_code]}), {}] + + # complete_task {{{1 @pytest.mark.asyncio async def test_complete_task_409(context, unsuccessful_queue): diff --git a/version.json b/version.json index ce342fc0..a88ae46d 100644 --- a/version.json +++ b/version.json @@ -1,8 +1,8 @@ { "version":[ - 36, + 37, 0, - 5 + 0 ], - "version_string":"36.0.5" + "version_string":"37.0.0" }