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 null executor warnings #1076

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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
Loading