Skip to content

Commit 76064aa

Browse files
authored
Merge pull request #155 from conductor-sdk/update-task-api
Added workerid parameter when updating a task from API
2 parents c382516 + 88452d6 commit 76064aa

6 files changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ jobs:
3535
--build-arg KEY=${{ secrets.KEY }}
3636
--build-arg SECRET=${{ secrets.SECRET }}
3737
--build-arg CONDUCTOR_SERVER_URL=${{ secrets.CONDUCTOR_SERVER_URL }}
38-
--target=integration_test
38+
--target=test
3939
.

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ jobs:
4242
--build-arg CONDUCTOR_SERVER_URL=${{ secrets.CONDUCTOR_SERVER_URL }}
4343
--build-arg CONDUCTOR_PYTHON_VERSION=${{ github.ref_name }}
4444
--build-arg SDK_ORIGIN=remote_sdk
45-
--target=integration_test
45+
--target=test
4646
.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ COPY /tests /package/tests
2626
FROM python_test_base as unit_test
2727
RUN python3 -m unittest discover --verbose --start-directory=./tests/unit
2828

29-
FROM python_test_base as integration_test
29+
FROM python_test_base as test
3030
ARG KEY
3131
ARG SECRET
3232
ARG CONDUCTOR_SERVER_URL

src/conductor/client/automator/task_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def __poll_task(self) -> Task:
9393
self.metrics_collector.increment_task_poll_error(
9494
task_definition_name, type(e)
9595
)
96-
logger.info(
96+
logger.debug(
9797
f'Failed to poll task for: {task_definition_name}, reason: {traceback.format_exc()}'
9898
)
9999
return None

src/conductor/client/http/api/task_resource_api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
# python 2 and python 3 compatibility library
66
import six
7+
import socket
78

89
from conductor.client.http.api_client import ApiClient
910

@@ -1481,6 +1482,7 @@ def update_task1(self, body, workflow_id, task_ref_name, status, **kwargs): # n
14811482
:param str workflow_id: (required)
14821483
:param str task_ref_name: (required)
14831484
:param str status: (required)
1485+
:param str workerid:
14841486
:return: str
14851487
If the method is called asynchronously,
14861488
returns the request thread.
@@ -1505,6 +1507,7 @@ def update_task1_with_http_info(self, body, workflow_id, task_ref_name, status,
15051507
:param str workflow_id: (required)
15061508
:param str task_ref_name: (required)
15071509
:param str status: (required)
1510+
:param str workerid:
15081511
:return: str
15091512
If the method is called asynchronously,
15101513
returns the request thread.
@@ -1553,6 +1556,10 @@ def update_task1_with_http_info(self, body, workflow_id, task_ref_name, status,
15531556
path_params['status'] = params['status'] # noqa: E501
15541557

15551558
query_params = []
1559+
1560+
if 'workerid' not in params:
1561+
params['workerid'] = socket.gethostname()
1562+
query_params.append(('workerid', params['workerid'])) # noqa: E501
15561563

15571564
header_params = {}
15581565

tests/integration/workflow/test_workflow_execution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def run_workflow_execution_tests(configuration: Configuration, workflow_executor
5252
workflow_quantity=10,
5353
workflow_name=WORKFLOW_NAME,
5454
workflow_executor=workflow_executor,
55-
workflow_completion_timeout=5
55+
workflow_completion_timeout=7
5656
)
5757
logger.debug('finished workflow execution tests')
5858
test_workflow_methods(

0 commit comments

Comments
 (0)