codemie-test-harness 0.1.144__py3-none-any.whl → 0.1.146__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of codemie-test-harness might be problematic. Click here for more details.

@@ -33,6 +33,7 @@ from codemie_test_harness.tests.utils.aws_parameters_store import CredentialsUti
33
33
  from codemie_test_harness.tests.utils.base_utils import get_random_name, wait_for_entity
34
34
  from codemie_test_harness.tests.utils.client_factory import get_client
35
35
  from codemie_test_harness.tests.utils.constants import TESTS_PATH
36
+ from codemie_test_harness.tests.utils.conversation_utils import ConversationUtils
36
37
  from codemie_test_harness.tests.utils.datasource_utils import DataSourceUtils
37
38
  from codemie_test_harness.tests.utils.gitbud_utils import GitBudUtils
38
39
  from codemie_test_harness.tests.utils.integration_utils import IntegrationUtils
@@ -232,6 +233,11 @@ def llm_utils(client):
232
233
  return LLMUtils(client)
233
234
 
234
235
 
236
+ @pytest.fixture(scope="session")
237
+ def conversation_utils(client):
238
+ return ConversationUtils(client)
239
+
240
+
235
241
  @pytest.fixture(scope="function")
236
242
  def git_integration(integration_utils):
237
243
  integration = integration_utils.create_integration(
@@ -465,7 +471,7 @@ def kb_context():
465
471
 
466
472
 
467
473
  @pytest.fixture(scope="function")
468
- def assistant(default_llm, assistant_utils):
474
+ def assistant(default_llm, assistant_utils, conversation_utils):
469
475
  """Create assistant"""
470
476
  created_assistant = None
471
477
 
@@ -511,6 +517,11 @@ def assistant(default_llm, assistant_utils):
511
517
  yield _create_assistant
512
518
  if created_assistant:
513
519
  assistant_utils.delete_assistant(created_assistant)
520
+ conversations = conversation_utils.get_conversation_by_assistant_id(
521
+ created_assistant["id"]
522
+ )
523
+ for conversation in conversations:
524
+ conversation_utils.delete_conversation(conversation.id)
514
525
 
515
526
 
516
527
  @pytest.fixture(scope="function")
@@ -860,6 +871,10 @@ def pytest_sessionfinish(session):
860
871
  if prefix in assistant.name:
861
872
  client.assistants.delete(assistant_id=assistant.id)
862
873
  sleep(clean_up_timeout)
874
+ conversations = client.conversations.list_by_assistant_id(assistant.id)
875
+ for conversation in conversations:
876
+ client.conversations.delete(conversation.id)
877
+ sleep(clean_up_timeout)
863
878
  workflows = client.workflows.list(
864
879
  filters={"name": autotest_entity_prefix}, per_page=200
865
880
  )
File without changes
@@ -0,0 +1,123 @@
1
+ import pytest
2
+ from codemie_sdk.models.conversation import Conversation, ConversationDetails
3
+ from hamcrest import (
4
+ assert_that,
5
+ has_length,
6
+ instance_of,
7
+ all_of,
8
+ has_property,
9
+ greater_than_or_equal_to,
10
+ has_item,
11
+ equal_to,
12
+ has_entry,
13
+ )
14
+
15
+ from codemie_test_harness.tests.utils.base_utils import get_random_name
16
+
17
+
18
+ @pytest.mark.regression
19
+ def test_list_conversations(assistant, assistant_utils, conversation_utils):
20
+ assistant = assistant()
21
+ assistant_utils.ask_assistant(assistant, f"prompt {get_random_name()}")
22
+
23
+ conversations = conversation_utils.list_conversations()
24
+
25
+ assert_that(conversations, instance_of(list))
26
+ assert_that(conversations, has_length(greater_than_or_equal_to(1)))
27
+
28
+ conversation = conversations[0]
29
+ assert_that(
30
+ conversation,
31
+ all_of(
32
+ instance_of(Conversation),
33
+ has_property("id"),
34
+ has_property("name"),
35
+ has_property("folder"),
36
+ has_property("pinned"),
37
+ has_property("date"),
38
+ has_property("assistant_ids", instance_of(list)),
39
+ has_property("initial_assistant_id"),
40
+ ),
41
+ )
42
+
43
+
44
+ @pytest.mark.regression
45
+ def test_get_specific_conversation(assistant, assistant_utils, conversation_utils):
46
+ prompt = f"prompt {get_random_name()}"
47
+ assistant = assistant()
48
+
49
+ assistant_utils.ask_assistant(assistant, prompt)
50
+
51
+ conversations = conversation_utils.list_conversations()
52
+
53
+ first_conversation = conversations[0]
54
+ conversation = conversation_utils.get_conversation_by_id(first_conversation.id)
55
+ assert_that(
56
+ conversation,
57
+ all_of(
58
+ instance_of(ConversationDetails),
59
+ has_property("id", first_conversation.id),
60
+ has_property("conversation_name", prompt),
61
+ has_property("initial_assistant_id", assistant.id),
62
+ ),
63
+ )
64
+
65
+
66
+ @pytest.mark.regression
67
+ def test_get_conversation_by_assistant_id(
68
+ assistant, assistant_utils, conversation_utils
69
+ ):
70
+ prompt = f"prompt {get_random_name()}"
71
+ assistant = assistant()
72
+
73
+ assistant_utils.ask_assistant(assistant, prompt)
74
+ conversation = conversation_utils.get_conversation_by_assistant_id(assistant.id)
75
+ assert_that(
76
+ conversation[0],
77
+ all_of(
78
+ instance_of(Conversation),
79
+ has_property("id", conversation[0].id),
80
+ has_property("name", prompt),
81
+ has_property("assistant_ids", has_item(assistant.id)),
82
+ has_property("initial_assistant_id", assistant.id),
83
+ ),
84
+ )
85
+
86
+
87
+ @pytest.mark.regression
88
+ def test_delete_conversation(assistant, assistant_utils, conversation_utils):
89
+ prompt = f"prompt {get_random_name()}"
90
+ assistant = assistant()
91
+
92
+ assistant_utils.ask_assistant(assistant, prompt)
93
+ conversation = conversation_utils.get_conversation_by_assistant_id(assistant.id)
94
+
95
+ delete_response = conversation_utils.delete_conversation(conversation[0].id)
96
+ assert_that(
97
+ delete_response["message"],
98
+ equal_to("Specified conversation removed"),
99
+ "Conversation delete response is not as expected.",
100
+ )
101
+
102
+
103
+ @pytest.mark.regression
104
+ def test_get_non_existent_conversation(assistant, assistant_utils, conversation_utils):
105
+ invalid_id = get_random_name()
106
+ with pytest.raises(Exception) as exc_info:
107
+ conversation_utils.get_conversation_by_id(invalid_id)
108
+
109
+ error_response = exc_info.value.response.json()
110
+ assert_that(
111
+ error_response["error"],
112
+ all_of(
113
+ has_entry("message", "Conversation not found"),
114
+ has_entry(
115
+ "details",
116
+ f"The conversation with ID [{invalid_id}] could not be found in the system.",
117
+ ),
118
+ has_entry(
119
+ "help",
120
+ "Please verify the conversation ID and try again. If you believe this is an error, contact support.",
121
+ ),
122
+ ),
123
+ )
@@ -159,31 +159,28 @@ time_expected_response = """
159
159
  cli_mcp_server_with_plugin_test_data = [
160
160
  (
161
161
  "ls",
162
- """
163
- The files and directories in the current directory are as follows:
164
-
165
- - `assistant`
166
- - `conftest.py`
167
- - `llm`
168
- - `similarity_check.py`
169
- - `test_workflow_service.py`
170
- - `test_assistant_service.py`
171
- - `test_data`
172
- - `enums`
173
- - `test_user_service.py`
174
- - `__init__.py`
175
- - `utils`
176
- - `__pycache__`
177
- - `test_task_service.py`
178
- - `test_integration_service.py`
179
- - `.env`
180
- - `workflow`
181
- - `test_workflow_execution_service.py`
182
- - `test_datasource_service.py`
183
- - `test_llm_service.py`
184
- - `test_e2e.py`
185
-
186
- Let me know if you need any further assistance!
162
+ f"""
163
+ Here is a list of files and directories in `{TESTS_PATH}`:
164
+
165
+ - Files:
166
+ - `.DS_Store`
167
+ - `__init__.py`
168
+ - `conftest.py`
169
+
170
+ - Directories:
171
+ - `__pycache__`
172
+ - `assistant`
173
+ - `e2e`
174
+ - `enums`
175
+ - `integrations`
176
+ - `llm`
177
+ - `providers`
178
+ - `search`
179
+ - `service`
180
+ - `test_data`
181
+ - `ui`
182
+ - `utils`
183
+ - `workflow`
187
184
  """,
188
185
  ),
189
186
  (
@@ -198,35 +195,28 @@ cli_mcp_server_with_plugin_test_data = [
198
195
  filesystem_mcp_server_with_plugin_test_data = [
199
196
  (
200
197
  f"ls {TESTS_PATH}",
201
- """
202
- The files and directories in the current directory are as follows:
203
-
204
- - `assistant`
205
- - `conftest.py`
206
- - `llm`
207
- - `similarity_check.py`
208
- - `test_workflow_service.py`
209
- - `test_assistant_service.py`
210
- - `test_data`
211
- - `enums`
212
- - `test_user_service.py`
213
- - `__init__.py`
214
- - `ui`
215
- - `utils`
216
- - `__pycache__`
217
- - `test_task_service.py`
218
- - `test_integration_service.py`
219
- - `.env`
220
- - `.env.local`
221
- - `.env.preview`
222
- - `.env.prod`
223
- - `workflow`
224
- - `test_workflow_execution_service.py`
225
- - `test_datasource_service.py`
226
- - `test_llm_service.py`
227
- - `test_e2e.py`
228
-
229
- Let me know if you need any further assistance!
198
+ f"""
199
+ Here is a list of files and directories in `{TESTS_PATH}`:
200
+
201
+ - Files:
202
+ - `.DS_Store`
203
+ - `__init__.py`
204
+ - `conftest.py`
205
+
206
+ - Directories:
207
+ - `__pycache__`
208
+ - `assistant`
209
+ - `e2e`
210
+ - `enums`
211
+ - `integrations`
212
+ - `llm`
213
+ - `providers`
214
+ - `search`
215
+ - `service`
216
+ - `test_data`
217
+ - `ui`
218
+ - `utils`
219
+ - `workflow`
230
220
  """,
231
221
  PluginTool.LIST_DIRECTORY,
232
222
  ),
@@ -251,7 +241,8 @@ filesystem_mcp_server_with_plugin_test_data = [
251
241
 
252
242
  class DataBaseDialect(str, Enum):
253
243
  \"""Enum for DB Dialect names.\"""
254
-
244
+
245
+ MS_SQL = "mssql"
255
246
  MY_SQL = "mysql"
256
247
  POSTGRES = "postgres"
257
248
  """,
@@ -4,61 +4,55 @@ from codemie_test_harness.tests.utils.constants import TESTS_PATH
4
4
  list_files_plugin_tools_test_data = [
5
5
  (
6
6
  f"list files in the {TESTS_PATH} directory",
7
- """
8
- The files and directories in the current directory are as follows:
7
+ f"""
8
+ Here is a list of files and directories in `{TESTS_PATH}`:
9
9
 
10
- - `assistant`
11
- - `conftest.py`
12
- - `llm`
13
- - `similarity_check.py`
14
- - `test_workflow_service.py`
15
- - `test_assistant_service.py`
16
- - `test_data`
17
- - `enums`
18
- - `test_user_service.py`
19
- - `__init__.py`
20
- - `utils`
21
- - `__pycache__`
22
- - `test_task_service.py`
23
- - `test_integration_service.py`
24
- - `.env`
25
- - `workflow`
26
- - `test_workflow_execution_service.py`
27
- - `test_datasource_service.py`
28
- - `test_llm_service.py`
29
- - `test_e2e.py`
30
-
31
- Let me know if you need any further assistance!
10
+ - Files:
11
+ - `.DS_Store`
12
+ - `__init__.py`
13
+ - `conftest.py`
14
+
15
+ - Directories:
16
+ - `__pycache__`
17
+ - `assistant`
18
+ - `e2e`
19
+ - `enums`
20
+ - `integrations`
21
+ - `llm`
22
+ - `providers`
23
+ - `search`
24
+ - `service`
25
+ - `test_data`
26
+ - `ui`
27
+ - `utils`
28
+ - `workflow`
32
29
  """,
33
30
  PluginTool.LIST_FILES_IN_DIRECTORY,
34
31
  ),
35
32
  (
36
33
  "execute 'ls' command",
37
- """
38
- The files and directories in the current directory are as follows:
34
+ f"""
35
+ Here is a list of files and directories in `{TESTS_PATH}`:
36
+
37
+ - Files:
38
+ - `.DS_Store`
39
+ - `__init__.py`
40
+ - `conftest.py`
39
41
 
40
- - `assistant`
41
- - `conftest.py`
42
- - `llm`
43
- - `similarity_check.py`
44
- - `test_workflow_service.py`
45
- - `test_assistant_service.py`
46
- - `test_data`
47
- - `enums`
48
- - `test_user_service.py`
49
- - `__init__.py`
50
- - `utils`
51
- - `__pycache__`
52
- - `test_task_service.py`
53
- - `test_integration_service.py`
54
- - `.env`
55
- - `workflow`
56
- - `test_workflow_execution_service.py`
57
- - `test_datasource_service.py`
58
- - `test_llm_service.py`
59
- - `test_e2e.py`
60
-
61
- Let me know if you need any further assistance!
42
+ - Directories:
43
+ - `__pycache__`
44
+ - `assistant`
45
+ - `e2e`
46
+ - `enums`
47
+ - `integrations`
48
+ - `llm`
49
+ - `providers`
50
+ - `search`
51
+ - `service`
52
+ - `test_data`
53
+ - `ui`
54
+ - `utils`
55
+ - `workflow`
62
56
  """,
63
57
  PluginTool.RUN_COMMAND_LINE_TOOL,
64
58
  ),
@@ -0,0 +1,17 @@
1
+ import requests
2
+
3
+ from codemie_test_harness.tests.utils.base_utils import BaseUtils
4
+
5
+
6
+ class ConversationUtils(BaseUtils):
7
+ def list_conversations(self):
8
+ return self.client.conversations.list()
9
+
10
+ def get_conversation_by_assistant_id(self, assistant_id: str):
11
+ return self.client.conversations.list_by_assistant_id(assistant_id)
12
+
13
+ def get_conversation_by_id(self, conversation_id: str) -> requests.Response:
14
+ return self.client.conversations.get_conversation(conversation_id)
15
+
16
+ def delete_conversation(self, conversation_id: str) -> requests.Response:
17
+ return self.client.conversations.delete(conversation_id)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: codemie-test-harness
3
- Version: 0.1.144
3
+ Version: 0.1.146
4
4
  Summary: Autotest for CodeMie backend and UI
5
5
  Author: Anton Yeromin
6
6
  Author-email: anton_yeromin@epam.com
@@ -13,7 +13,7 @@ Requires-Dist: aws-assume-role-lib (>=2.10.0,<3.0.0)
13
13
  Requires-Dist: boto3 (>=1.39.8,<2.0.0)
14
14
  Requires-Dist: click (>=8.1.7,<9.0.0)
15
15
  Requires-Dist: codemie-plugins (>=0.1.123,<0.2.0)
16
- Requires-Dist: codemie-sdk-python (==0.1.144)
16
+ Requires-Dist: codemie-sdk-python (==0.1.146)
17
17
  Requires-Dist: pytest (>=8.4.1,<9.0.0)
18
18
  Requires-Dist: pytest-playwright (>=0.7.0,<0.8.0)
19
19
  Requires-Dist: pytest-reportportal (>=5.5.2,<6.0.0)
@@ -55,7 +55,9 @@ codemie_test_harness/tests/assistant/tools/servicenow/__init__.py,sha256=47DEQpj
55
55
  codemie_test_harness/tests/assistant/tools/servicenow/test_servicenow_tools.py,sha256=JV_n6COaCsd0_rxQBJvvLZfPdo8BsCbG8Ti-UpzFvfQ,644
56
56
  codemie_test_harness/tests/assistant/tools/vcs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
57
  codemie_test_harness/tests/assistant/tools/vcs/test_assistant_with_vcs_tools.py,sha256=5-QybLWmYSqHG4Sqr-IN-vNcStV4skSwCJQN44Nfats,922
58
- codemie_test_harness/tests/conftest.py,sha256=qzKtJdd7j0I6jBiIOCnz1uF0-Qm0wLWkSwXK_Rg3adI,27869
58
+ codemie_test_harness/tests/conftest.py,sha256=pS_7Zh2QLUMgC2wepEFx-ut1-UzOGZy_WIn9rb7z2D4,28557
59
+ codemie_test_harness/tests/conversations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
+ codemie_test_harness/tests/conversations/test_conversations_endpoints.py,sha256=SQraRVrjjE4mYTs4EuGzMrO96DuOuKTiYQ4ZRBhHx70,3913
59
61
  codemie_test_harness/tests/e2e/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
62
  codemie_test_harness/tests/e2e/test_e2e.py,sha256=RUvSu_uNInU1OFfkNft3-Cmd0KZV7JdHqCxSK2ZWXHw,6257
61
63
  codemie_test_harness/tests/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -134,12 +136,12 @@ codemie_test_harness/tests/test_data/google_datasource_test_data.py,sha256=fhMJV
134
136
  codemie_test_harness/tests/test_data/index_test_data.py,sha256=jSJ7YSNisFADONRKSwkLUhuOLrSRe_fZisWdjflOjE4,996
135
137
  codemie_test_harness/tests/test_data/integrations_test_data.py,sha256=dPadoQCurmOtqhq5hcPe1hhuSZ6NYa4IZwdWMiMx2Tw,6599
136
138
  codemie_test_harness/tests/test_data/llm_test_data.py,sha256=SJIBGtC8Ha7T0S7G9598PvHzzQIR6gg4HnNCtgYmLYw,2200
137
- codemie_test_harness/tests/test_data/mcp_server_test_data.py,sha256=dNtuJm47-F0OV5fIHUpb1Ko6VQOECWx2XDBuLyxtDzo,7671
139
+ codemie_test_harness/tests/test_data/mcp_server_test_data.py,sha256=m6PImS_J2gPNY5ijf9MG_eOX_LxJjTZ23AXQDgaK_Oc,7151
138
140
  codemie_test_harness/tests/test_data/notification_tools_test_data.py,sha256=Rqo-5u7PULDJddidjqcJfnsus6-JbDABk9147JX0pqs,855
139
141
  codemie_test_harness/tests/test_data/open_api_tools_test_data.py,sha256=XhVzelRXgLXHF2iIvhI70SP6qHQjT7QW70S06dF6XJI,2480
140
142
  codemie_test_harness/tests/test_data/openapi.json,sha256=X4uqtfjpTUuMifefQRf8mHI1k8pspp8-L0rpJlhLOI4,10459
141
143
  codemie_test_harness/tests/test_data/output_schema_test_data.py,sha256=4l7AvXbMl9hIvoFxu1LPPSGz9hb5Uz2_is4zTm77ARY,261
142
- codemie_test_harness/tests/test_data/plugin_tools_test_data.py,sha256=OnOKcstocjHSX_kzcsi3QNjAKyMB_nDSwtw9yLzPOoY,2926
144
+ codemie_test_harness/tests/test_data/plugin_tools_test_data.py,sha256=8sb80WiFdi2WWBWw5OWCR56HW6K1y062bWFiLOKeSU0,2430
143
145
  codemie_test_harness/tests/test_data/pm_tools_test_data.py,sha256=ctPwLSJYy7xPg4B-uwAAhRwIogdxTgBn-PPY2rN0llc,3248
144
146
  codemie_test_harness/tests/test_data/project_management_test_data.py,sha256=gdWlX6xhie7JpLurGjq5S8jBNLpp80fVQy5jV7BjNJk,1207
145
147
  codemie_test_harness/tests/test_data/research_tools_test_data.py,sha256=FtOhWp7PbRdw36IUIa46OBbE2wy8yKZkpI6uwCfSoXQ,4745
@@ -213,6 +215,7 @@ codemie_test_harness/tests/utils/aws_parameters_store.py,sha256=uwhvrk4qYYWLILS0
213
215
  codemie_test_harness/tests/utils/base_utils.py,sha256=tfishCUxO3iEuasWOifoF9_fXspm4uIHS26Ryqu-NxA,5998
214
216
  codemie_test_harness/tests/utils/client_factory.py,sha256=Yyg2iXe7g7fIfIUbOH8z_8qgVo_lB-nYLOfCV5ONXFw,641
215
217
  codemie_test_harness/tests/utils/constants.py,sha256=lb6mgLjt0GM85Khs18rL1jnE9ILx8L811ykNhpF6IDA,1111
218
+ codemie_test_harness/tests/utils/conversation_utils.py,sha256=SWj6TBWOQoX5Yh6Wk63yHQFveRXgK1mpLb3PUKAa57A,648
216
219
  codemie_test_harness/tests/utils/datasource_utils.py,sha256=-_HZfW_UufSUVkSUCVq4jMlq9MCcKtMhzD6iBtadzmk,12502
217
220
  codemie_test_harness/tests/utils/file_utils.py,sha256=hY-kwnyzvtd1BQif8r5NhvRTGfpKLmQKyRsq1Tuflhg,585
218
221
  codemie_test_harness/tests/utils/gitbud_utils.py,sha256=UJ3RbhPSjHQSdos6S6zTR9iZULrBDJXoXq9cbjFH7bo,7829
@@ -323,7 +326,7 @@ codemie_test_harness/tests/workflow/virtual_assistant_tools/servicenow/__init__.
323
326
  codemie_test_harness/tests/workflow/virtual_assistant_tools/servicenow/test_workflow_with_servicenow_tools.py,sha256=Cxe5Yuy9JE_IEsnQOThpVIZQqpfLuHfDkF6JwLngDc8,890
324
327
  codemie_test_harness/tests/workflow/virtual_assistant_tools/vcs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
325
328
  codemie_test_harness/tests/workflow/virtual_assistant_tools/vcs/test_workflow_with_vcs_tools.py,sha256=tm0NvUf_UtzLPTYJWykYpsNoxoVs-Eh80guDmRwImwg,1106
326
- codemie_test_harness-0.1.144.dist-info/METADATA,sha256=16Cb9TqeLssG39l6m_K9Ut2FFz9JTT8MmCi9o3C49ZQ,8998
327
- codemie_test_harness-0.1.144.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
328
- codemie_test_harness-0.1.144.dist-info/entry_points.txt,sha256=n98t-EOM5M1mnMl_j2X4siyeO9zr0WD9a5LF7JyElIM,73
329
- codemie_test_harness-0.1.144.dist-info/RECORD,,
329
+ codemie_test_harness-0.1.146.dist-info/METADATA,sha256=C9bfCCtoQp9HHKSUzlo4GdgfZpMtU1OQPG_yf7GHQxs,8998
330
+ codemie_test_harness-0.1.146.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
331
+ codemie_test_harness-0.1.146.dist-info/entry_points.txt,sha256=n98t-EOM5M1mnMl_j2X4siyeO9zr0WD9a5LF7JyElIM,73
332
+ codemie_test_harness-0.1.146.dist-info/RECORD,,