Skip to content
Snippets Groups Projects
Commit 2303cec1 authored by Valentin Rigal's avatar Valentin Rigal Committed by Bastien Abadie
Browse files

Send process_id when updating worker activity

parent ae104d26
No related branches found
Tags 0.2.0-beta2
1 merge request!108Send process_id when updating worker activity
Pipeline #78549 passed
......@@ -189,6 +189,7 @@ class ElementsWorker(
id=self.worker_version_id,
body={
"element_id": str(element_id),
"process_id": self.process_information["id"],
"state": state.value,
},
)
......
# -*- coding: utf-8 -*-
# . -*- coding: utf-8 -*-
import json
import sys
......@@ -108,6 +108,7 @@ def test_update_call(responses, mock_elements_worker, mock_process_api):
status=200,
json={
"element_id": "1234-deadbeef",
"process_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeffff",
"state": "processed",
},
)
......@@ -117,6 +118,7 @@ def test_update_call(responses, mock_elements_worker, mock_process_api):
# Check the response received by worker
assert out == {
"element_id": "1234-deadbeef",
"process_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeffff",
"state": "processed",
}
......@@ -133,6 +135,7 @@ def test_update_call(responses, mock_elements_worker, mock_process_api):
# Check the request sent by worker
assert json.loads(responses.calls[-1].request.body) == {
"element_id": "1234-deadbeef",
"process_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeffff",
"state": "processed",
}
......@@ -184,6 +187,7 @@ def test_run(
status=200,
json={
"element_id": "1234-deadbeef",
"process_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeffff",
"state": "started",
},
)
......@@ -193,6 +197,7 @@ def test_run(
status=200,
json={
"element_id": "1234-deadbeef",
"process_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeffff",
"state": final_state,
},
)
......@@ -232,10 +237,12 @@ def test_run(
# Check the requests sent by worker
assert json.loads(responses.calls[-2].request.body) == {
"element_id": "1234-deadbeef",
"process_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeffff",
"state": "started",
}
assert json.loads(responses.calls[-1].request.body) == {
"element_id": "1234-deadbeef",
"process_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeffff",
"state": final_state,
}
......
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