Skip to content

Commit 28ac5ea

Browse files
IgorChvyrov-smigor chvyrov
andauthored
Added sync and async integration tests to fail condition (#337)
Co-authored-by: igor chvyrov <igorchvyrov@igors-MacBook-Pro.local>
1 parent 64e7763 commit 28ac5ea

29 files changed

+360
-59
lines changed

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,5 @@ jobs:
123123
file: ${{ env.COVERAGE_FILE }}
124124

125125
- name: Check test results
126-
if: steps.unit_tests.outcome == 'failure' || steps.bc_tests.outcome == 'failure' || steps.serdeser_tests.outcome == 'failure'
126+
if: steps.unit_tests.outcome == 'failure' || steps.bc_tests.outcome == 'failure' || steps.serdeser_tests.outcome == 'failure' || steps.integration_tests.outcome == 'failure' || steps.asyncio_integration_tests.outcome == 'failure'
127127
run: exit 1

poetry.lock

Lines changed: 42 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ python-dateutil = "^2.8.2"
3737
pydantic = "2.11.7"
3838
aiohttp = "3.12.15"
3939
aiohttp-retry = "2.9.1"
40-
httpx = "^0.28.1"
40+
httpx = {extras = ["http2"], version = "^0.28.1"}
4141

4242
[tool.poetry.group.dev.dependencies]
4343
pylint = ">=2.17.5"

src/conductor/asyncio_client/adapters/models/integration_adapter.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from typing import Any, Dict, List, Optional
44

5+
from pydantic import field_validator
56
from typing_extensions import Self
67

78
from conductor.asyncio_client.http.models import Integration
@@ -12,6 +13,30 @@ class IntegrationAdapter(Integration):
1213
configuration: Optional[Dict[str, Any]] = None
1314
tags: Optional[List["TagAdapter"]] = None
1415

16+
@field_validator("category")
17+
def category_validate_enum(cls, value):
18+
"""Validates the enum"""
19+
if value is None:
20+
return value
21+
22+
if value not in set(
23+
[
24+
"API",
25+
"AI_MODEL",
26+
"VECTOR_DB",
27+
"RELATIONAL_DB",
28+
"MESSAGE_BROKER",
29+
"GIT",
30+
"EMAIL",
31+
"MCP",
32+
"CLOUD",
33+
]
34+
):
35+
raise ValueError(
36+
"must be one of enum values ('API', 'AI_MODEL', 'VECTOR_DB', 'RELATIONAL_DB', 'MESSAGE_BROKER', 'GIT', 'EMAIL', 'MCP', 'CLOUD')"
37+
)
38+
return value
39+
1540
@classmethod
1641
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
1742
"""Create an instance of Integration from a dict"""
@@ -53,6 +78,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
5378
from conductor.asyncio_client.adapters.models.integration_api_adapter import ( # noqa: E402
5479
IntegrationApiAdapter,
5580
)
56-
from conductor.asyncio_client.adapters.models.tag_adapter import TagAdapter # noqa: E402
81+
from conductor.asyncio_client.adapters.models.tag_adapter import (
82+
TagAdapter,
83+
) # noqa: E402
5784

5885
IntegrationAdapter.model_rebuild(raise_errors=False)

src/conductor/asyncio_client/adapters/models/integration_def_adapter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ def category_validate_enum(cls, value):
2626
"GIT",
2727
"EMAIL",
2828
"MCP",
29+
"CLOUD",
2930
]
3031
):
3132
raise ValueError(
32-
"must be one of enum values ('API', 'AI_MODEL', 'VECTOR_DB', 'RELATIONAL_DB', 'MESSAGE_BROKER', 'GIT', 'EMAIL', 'MCP')"
33+
"must be one of enum values ('API', 'AI_MODEL', 'VECTOR_DB', 'RELATIONAL_DB', 'MESSAGE_BROKER', 'GIT', 'EMAIL', 'MCP', 'CLOUD')"
3334
)
3435
return value
3536

src/conductor/asyncio_client/adapters/models/integration_def_form_field_adapter.py

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing import Any, ClassVar, Dict, List, Optional
44

5-
from pydantic import Field
5+
from pydantic import Field, field_validator
66
from typing_extensions import Self
77

88
from conductor.asyncio_client.http.models import IntegrationDefFormField
@@ -27,6 +27,96 @@ class IntegrationDefFormFieldAdapter(IntegrationDefFormField):
2727
"dependsOn",
2828
]
2929

30+
@field_validator("field_name")
31+
def field_name_validate_enum(cls, value):
32+
"""Validates the enum"""
33+
if value is None:
34+
return value
35+
36+
if value not in set(
37+
[
38+
"api_key",
39+
"authenticationType",
40+
"authUrl",
41+
"awsAccountId",
42+
"batchPollConsumersCount",
43+
"batchSize",
44+
"batchWaitTime",
45+
"betaVersion",
46+
"channel",
47+
"cipherSuite",
48+
'completionsPath',
49+
"connectionPoolSize",
50+
"connectionType",
51+
"consumer",
52+
"consumer_type",
53+
"datasourceURL",
54+
"dimensions",
55+
"distance_metric",
56+
"endpoint",
57+
"environment",
58+
"externalId",
59+
"file",
60+
"groupId",
61+
"header",
62+
"indexing_method",
63+
"indexName",
64+
"inverted_list_count",
65+
"jdbcDriver",
66+
"keyStoreLocation",
67+
"keyStorePassword",
68+
"mechanism",
69+
"namespace",
70+
"organizationId",
71+
"password",
72+
"port",
73+
"projectName",
74+
"protocol",
75+
"pubSubMethod",
76+
"publisher",
77+
"pullBatchWaitMillis",
78+
"pullPeriod",
79+
"queueManager",
80+
"region",
81+
"roleArn",
82+
"schemaRegistryApiKey",
83+
"schemaRegistryApiSecret",
84+
"schemaRegistryAuthType",
85+
"schemaRegistryUrl",
86+
"serviceAccountCredentials",
87+
"stream",
88+
"subscription",
89+
"tls",
90+
"tlsFile",
91+
"truststoreAuthenticationType",
92+
"user",
93+
"valueSubjectNameStrategy",
94+
"version",
95+
"visibilityTimeout",
96+
]
97+
):
98+
raise ValueError(
99+
"must be one of enum values ("
100+
"'api_key', 'authenticationType', 'authUrl', 'awsAccountId', "
101+
"'batchPollConsumersCount', 'batchSize', 'batchWaitTime', "
102+
"'betaVersion', 'channel', 'cipherSuite', 'completionsPath', "
103+
"'connectionPoolSize', 'connectionType', 'consumer', 'consumer_type', "
104+
"'datasourceURL', 'dimensions', 'distance_metric', 'endpoint', "
105+
"'environment', 'externalId', 'file', 'groupId', 'header', "
106+
"'indexing_method', 'indexName', 'inverted_list_count', 'jdbcDriver', "
107+
"'keyStoreLocation', 'keyStorePassword', 'mechanism', 'namespace', "
108+
"'organizationId', 'password', 'port', 'projectName', 'protocol', "
109+
"'pubSubMethod', 'publisher', 'pullBatchWaitMillis', 'pullPeriod', "
110+
"'queueManager', 'region', 'roleArn', 'schemaRegistryApiKey', "
111+
"'schemaRegistryApiSecret', 'schemaRegistryAuthType', 'schemaRegistryUrl', "
112+
"'serviceAccountCredentials', 'stream', 'subscription', 'tls', 'tlsFile', "
113+
"'truststoreAuthenticationType', 'user', 'valueSubjectNameStrategy', "
114+
"'version', 'visibilityTimeout'"
115+
")"
116+
)
117+
118+
return value
119+
30120
@classmethod
31121
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
32122
"""Create an instance of IntegrationDefFormField from a dict"""

src/conductor/asyncio_client/event/event_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from conductor.asyncio_client.adapters.api.event_resource_api import \
2-
EventResourceApiAdapter
1+
from conductor.asyncio_client.adapters.api.event_resource_api import (
2+
EventResourceApiAdapter,
3+
)
34
from conductor.asyncio_client.adapters import ApiClient
45
from conductor.shared.event.configuration import QueueConfiguration
56

src/conductor/client/adapters/api_client_adapter.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010

1111

1212
class ApiClientAdapter(ApiClient):
13-
def __init__(
14-
self, configuration=None, header_name=None, header_value=None, cookie=None
15-
):
13+
def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None):
1614
"""Initialize the API client adapter with httpx-based REST client."""
17-
super().__init__(configuration, header_name, header_value, cookie)
18-
self.rest_client = RESTClientObjectAdapter(
19-
connection=configuration.http_connection if configuration else None
20-
)
15+
self.configuration = configuration or Configuration()
16+
17+
# Create httpx-compatible REST client directly
18+
self.rest_client = RESTClientObjectAdapter(connection=self.configuration.http_connection)
19+
20+
self.default_headers = self._ApiClient__get_default_headers(header_name, header_value)
21+
self.cookie = cookie
22+
self._ApiClient__refresh_auth_token()
2123

2224
def __call_api(
2325
self,

src/conductor/client/adapters/models/integration_adapter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def category(self, category):
142142
"GIT",
143143
"EMAIL",
144144
"MCP",
145+
"CLOUD",
145146
] # noqa: E501
146147
if category not in allowed_values:
147148
raise ValueError(

src/conductor/client/adapters/models/integration_def_adapter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def category(self, category):
102102
"GIT",
103103
"EMAIL",
104104
"MCP",
105+
"CLOUD",
105106
] # noqa: E501
106107
if category not in allowed_values:
107108
raise ValueError(

0 commit comments

Comments
 (0)