Skip to content

Commit

Permalink
Fix null executor warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorjerse committed Nov 24, 2023
1 parent a01af7b commit 17df1b4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Fix
---
- Add default value for ``FLOW_PROCESSES_ALLOW_LIST`` and
``FLOW_PROCESSES_IGNORE_LIST`` in case of missing settings.
- Fix null executor warnings


===================
Expand Down
10 changes: 0 additions & 10 deletions resolwe/flow/executors/null/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,8 @@
:meth:`~resolwe.flow.executors.prepare.BaseFlowExecutorPreparer.extend_settings`
method.
"""
from resolwe.flow.models import Worker

from ..prepare import BaseFlowExecutorPreparer # noqa: F401


class FlowExecutorPreparer(BaseFlowExecutorPreparer):
"""Specialized manager assist for the null executor."""

def prepare_for_execution(self, data):
"""Prepare the data object for the execution.
Mark worker object as done.
"""
data.worker.status = Worker.STATUS_COMPLETED
data.worker.save()
4 changes: 2 additions & 2 deletions resolwe/flow/executors/null/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ class FlowExecutor(BaseFlowExecutor):
name = "null"

async def run(self):
"""Do nothing :)."""
pass
"""Notify listener run is completed."""
await self.communicator.finish({"rc": 0})
3 changes: 1 addition & 2 deletions resolwe/flow/tests/test_executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,12 +602,11 @@ def test_docker_uid_gid(self):
data = self.run_process("test-docker-uid-gid")
self.assertEqual(data.output["result"], "OK")

@unittest.skip("Null executor test currently not working.")
@with_null_executor
@tag_process("test-save-number")
def test_null_executor(self):
data = self.run_process(
"test-save-number", {"number": 19}, assert_status=Data.STATUS_WAITING
"test-save-number", {"number": 19}, assert_status=Data.STATUS_DONE
)
self.assertEqual(data.input["number"], 19)
self.assertEqual(data.output, {})
Expand Down

0 comments on commit 17df1b4

Please sign in to comment.