Skip to content
Snippets Groups Projects
Commit 60bc3d83 authored by Janet Goldstein's avatar Janet Goldstein
Browse files

WS-651: lose unneeded methods; fix variable names; clarify pydoc comments

parent b26aaaac
No related branches found
No related tags found
1 merge request!505WS-651: catches and saves RH CARTA event
This commit is part of merge request !505. Comments created here will be created in the context of that merge request.
......@@ -17,7 +17,7 @@ pytest_plugins = ["testing.utils.conftest"]
class TestCapabilityService:
"""Tests for CapabilityService methods"""
@pytest.mark.skip("Broken due to queue/messenger rework")
@pytest.mark.skip("Broken due to queue/messenger rework. Does work in local `make test`")
def test_on_ingestion_complete(
self,
mock_capability_service: CapabilityService,
......@@ -42,7 +42,7 @@ class TestCapabilityService:
(request,) = mock_capability_info.save_entity.call_args.args
assert request.ingested is True
@pytest.mark.skip("As above, broken due to queue/messenger rework?")
@pytest.mark.skip("As above, broken due to queue/messenger rework? Succeeds locally; fails on CI")
def test_on_carta_ready(
self,
mock_capability_service: CapabilityService,
......
......@@ -162,7 +162,7 @@ class CapabilityService(CapabilityServiceIF):
self.capability_info.save_entity(request)
@on_message(type="carta-ready")
def on_carta_ready(self, wf_request_id: int, **message: Dict[str, str]):
def on_carta_ready(self, cp_request_id: int, **message: Dict[str, str]):
"""
Catch the RH-flavored event and save it to the capability request version metadata
......@@ -171,9 +171,8 @@ class CapabilityService(CapabilityServiceIF):
"""
logger.info(f"RECEIVED CARTA READY MESSAGE: {message}")
execution = self.capability_info.lookup_execution_by_workflow_request_id(wf_request_id)
request = execution.capability_request
request_version = request.current_version
execution = self.capability_info.lookup_execution_by_workflow_request_id(cp_request_id)
request_version = execution.version
request_version.workflow_metadata = {"carta_url": message["carta_url"]}
self.capability_info.save_entity(request_version)
......
......@@ -174,12 +174,6 @@ class CapabilityInfoIF(QueueReporterIF, metaclass=ABCMeta):
def lookup_execution(self, execution_id: int) -> CapabilityExecutionIF:
raise NotImplementedError
@abstractmethod
def lookup_execution_by_workflow_request_id(
self, workflow_request_id: int
) -> CapabilityExecutionIF:
raise NotImplementedError
@abstractmethod
def save_execution(self, execution: CapabilityExecutionIF):
pass
......@@ -213,5 +207,5 @@ class CapabilityQueueIF(ABC):
class CapabilityServiceIF(ABC):
"""
The capability service: clients access this to request capability runs. Just a phantom.
The capability service: clients access this to request capability runs.
"""
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment