Skip to content

Commit 13cb00e

Browse files
committed
Fix for passing Integration tests
1 parent 204d5dc commit 13cb00e

4 files changed

Lines changed: 58 additions & 6 deletions

File tree

src/conductor/client/http/api_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@ def __deserialize(self, data, klass):
272272
return [self.__deserialize(sub_data, sub_kls)
273273
for sub_data in data]
274274

275+
if klass.startswith('set['):
276+
sub_kls = re.match(r'set\[(.*)\]', klass).group(1)
277+
return set(self.__deserialize(sub_data, sub_kls)
278+
for sub_data in data)
279+
275280
if klass.startswith('dict('):
276281
sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
277282
return {k: self.__deserialize(v, sub_kls)

src/conductor/client/http/models/schema_def.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ class SchemaDef(Auditable):
5353

5454
discriminator: Any = field(default=None, init=False)
5555

56-
def __init__(self, name: str = None, version: int = 1, type: SchemaType = None, data: Dict[str, object] = None,
57-
external_ref: str = None): # noqa: E501
56+
def __init__(self, name: str = None, version: int = 1, type: SchemaType = None,
57+
data: Dict[str, object] = None, external_ref: str = None,
58+
owner_app: str = None, create_time: int = None, update_time: int = None,
59+
created_by: str = None, updated_by: str = None): # noqa: E501
60+
super().__init__()
5861
self._name = None
5962
self._version = None
6063
self._type = None
@@ -72,6 +75,18 @@ def __init__(self, name: str = None, version: int = 1, type: SchemaType = None,
7275
if external_ref is not None:
7376
self.external_ref = external_ref
7477

78+
# Set Auditable fields
79+
if owner_app is not None:
80+
self.owner_app = owner_app
81+
if create_time is not None:
82+
self.create_time = create_time
83+
if update_time is not None:
84+
self.update_time = update_time
85+
if created_by is not None:
86+
self.created_by = created_by
87+
if updated_by is not None:
88+
self.updated_by = updated_by
89+
7590
def __post_init__(self, name_init: Optional[str], version_init: Optional[int],
7691
type_init: Optional[SchemaType], data_init: Optional[Dict[str, object]],
7792
external_ref_init: Optional[str]):

src/conductor/client/workflow/executor/workflow_executor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import uuid
2-
from typing import Any, Dict, List
2+
from typing import Any, Dict, List, Optional
33

4-
from typing_extensions import Self, Optional
4+
from typing_extensions import Self
55

66
from conductor.client.configuration.configuration import Configuration
77
from conductor.client.http.api.metadata_resource_api import MetadataResourceApi

tests/integration/client/orkes/test_orkes_clients.py

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,12 +602,44 @@ def __test_task_execution_lifecycle(self):
602602
assert queue_size == 0
603603

604604
def __get_workflow_definition(self, path):
605-
f = open(path, "r")
605+
# Import os if not already imported
606+
import os
607+
608+
# Get directory of current script
609+
current_dir = os.path.dirname(os.path.abspath(__file__))
610+
611+
# Path to project root (need to go up several directories)
612+
# From /tests/integration/client/orkes/ to project root
613+
project_root = os.path.abspath(os.path.join(current_dir, '..', '..', '..', '..'))
614+
615+
# Construct path from project root
616+
actual_path = os.path.join(project_root, path)
617+
618+
# For debugging
619+
print(f"Attempting to open file at: {actual_path}")
620+
621+
f = open(actual_path, "r")
606622
workflowJSON = json.loads(f.read())
607623
workflowDef = self.api_client.deserialize_class(workflowJSON, "WorkflowDef")
608624
return workflowDef
609625

610626
def __get_test_inputs(self, path):
611-
f = open(path, "r")
627+
# Import os if not already imported
628+
import os
629+
630+
# Get directory of current script
631+
current_dir = os.path.dirname(os.path.abspath(__file__))
632+
633+
# Path to project root (need to go up several directories)
634+
# From /tests/integration/client/orkes/ to project root
635+
project_root = os.path.abspath(os.path.join(current_dir, '..', '..', '..', '..'))
636+
637+
# Construct path from project root
638+
actual_path = os.path.join(project_root, path)
639+
640+
# For debugging
641+
print(f"Attempting to open file at: {actual_path}")
642+
643+
f = open(actual_path, "r")
612644
inputJSON = json.loads(f.read())
613645
return inputJSON

0 commit comments

Comments
 (0)