codemie-test-harness 0.1.179__py3-none-any.whl → 0.1.181__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.
- codemie_test_harness/cli/cli.py +2 -0
- codemie_test_harness/cli/commands/marks_cmd.py +39 -0
- codemie_test_harness/cli/marks_utils.py +338 -0
- codemie_test_harness/cli/runner.py +40 -0
- codemie_test_harness/tests/assistant/datasource/test_code_datasource.py +20 -7
- codemie_test_harness/tests/assistant/datasource/test_confluence_datasource.py +20 -7
- codemie_test_harness/tests/assistant/datasource/test_file_indexing.py +20 -9
- codemie_test_harness/tests/assistant/datasource/test_google_datasource.py +21 -7
- codemie_test_harness/tests/assistant/datasource/test_jira_datasource.py +22 -9
- codemie_test_harness/tests/assistant/default_integrations/test_default_integrations_for_tool.py +29 -13
- codemie_test_harness/tests/assistant/default_integrations/test_default_integrations_for_tool_kit.py +29 -13
- codemie_test_harness/tests/assistant/default_integrations/test_default_integrations_for_tool_with_datasource.py +29 -13
- codemie_test_harness/tests/assistant/test_assistants.py +53 -35
- codemie_test_harness/tests/assistant/tools/access_management/test_keycloak_tool.py +7 -2
- codemie_test_harness/tests/assistant/tools/ado/test_assistant_for_ado_test_plan_tools.py +39 -11
- codemie_test_harness/tests/assistant/tools/ado/test_assistant_for_ado_wiki_tools.py +27 -8
- codemie_test_harness/tests/assistant/tools/ado/test_assistant_for_ado_work_item_tools.py +27 -7
- codemie_test_harness/tests/assistant/tools/cloud/test_cloud_tools.py +9 -3
- codemie_test_harness/tests/assistant/tools/codebase/test_codebase_tools.py +13 -4
- codemie_test_harness/tests/assistant/tools/datamanagement/test_assistant_with_data_management_tools.py +32 -11
- codemie_test_harness/tests/assistant/tools/filemanagement/test_assistant_with_file_management_tools.py +37 -12
- codemie_test_harness/tests/assistant/tools/git/test_assistant_with_git_tools.py +48 -17
- codemie_test_harness/tests/assistant/tools/mcp/test_cli_mcp_server.py +16 -9
- codemie_test_harness/tests/assistant/tools/mcp/test_mcp_servers.py +14 -8
- codemie_test_harness/tests/assistant/tools/notification/test_assistant_notification_tools.py +11 -4
- codemie_test_harness/tests/assistant/tools/openapi/test_assistant_with_open_api_tools.py +6 -2
- codemie_test_harness/tests/assistant/tools/plugin/test_assistant_with_development_plugin.py +27 -8
- codemie_test_harness/tests/assistant/tools/plugin/test_assistant_with_plugin_and_mcp_servers.py +17 -5
- codemie_test_harness/tests/assistant/tools/plugin/test_single_assistant_dual_time_plugins.py +12 -3
- codemie_test_harness/tests/assistant/tools/project_management/test_assistant_pm_tools.py +36 -17
- codemie_test_harness/tests/assistant/tools/report_portal/test_assistant_report_portal_tools.py +7 -2
- codemie_test_harness/tests/assistant/tools/research/test_assistant_research_tools.py +17 -5
- codemie_test_harness/tests/assistant/tools/servicenow/test_servicenow_tools.py +6 -2
- codemie_test_harness/tests/assistant/tools/vcs/test_assistant_with_vcs_tools.py +7 -2
- codemie_test_harness/tests/conversations/test_conversations_endpoints.py +5 -5
- codemie_test_harness/tests/e2e/test_e2e.py +6 -6
- codemie_test_harness/tests/enums/tools.py +32 -0
- codemie_test_harness/tests/integrations/project/test_default_integrations.py +14 -14
- codemie_test_harness/tests/integrations/project/test_project_integrations.py +9 -9
- codemie_test_harness/tests/integrations/user/test_default_integrations.py +14 -14
- codemie_test_harness/tests/integrations/user/test_user_integrations.py +12 -12
- codemie_test_harness/tests/llm/assistants/test_lite_llm.py +2 -2
- codemie_test_harness/tests/llm/assistants/test_llm.py +3 -3
- codemie_test_harness/tests/providers/test_providers_endpoints.py +11 -11
- codemie_test_harness/tests/search/test_search_assistant.py +1 -1
- codemie_test_harness/tests/search/test_search_datasource.py +5 -5
- codemie_test_harness/tests/search/test_search_integration.py +2 -2
- codemie_test_harness/tests/search/test_search_workflow.py +1 -1
- codemie_test_harness/tests/service/test_assistant_service.py +1 -1
- codemie_test_harness/tests/test_data/codebase_tools_test_data.py +11 -5
- codemie_test_harness/tests/test_data/file_test_data.py +17 -0
- codemie_test_harness/tests/ui/assistants/test_create_assistant.py +11 -11
- codemie_test_harness/tests/ui/datasource/test_create_datasource.py +7 -7
- codemie_test_harness/tests/ui/datasource/test_datasource_page.py +3 -3
- codemie_test_harness/tests/ui/datasource/test_edit_datasource.py +5 -5
- codemie_test_harness/tests/ui/datasource/test_view_datasource.py +5 -5
- codemie_test_harness/tests/ui/integrations/test_create_integration.py +9 -9
- codemie_test_harness/tests/ui/workflows/test_create_workflow.py +12 -12
- codemie_test_harness/tests/ui/workflows/test_edit_workflow.py +15 -15
- codemie_test_harness/tests/ui/workflows/test_workflow_details.py +19 -19
- codemie_test_harness/tests/ui/workflows/test_workflow_executions_page.py +36 -36
- codemie_test_harness/tests/ui/workflows/test_workflow_templates.py +8 -8
- codemie_test_harness/tests/ui/workflows/test_workflows.py +8 -8
- codemie_test_harness/tests/utils/assistant_utils.py +34 -1
- codemie_test_harness/tests/utils/base_utils.py +61 -0
- codemie_test_harness/tests/workflow/assistant_tools/access_management/test_workflow_with_assistant_with_keycloak_tool.py +1 -1
- codemie_test_harness/tests/workflow/assistant_tools/ado/test_workflow_with_assistant_with_ado_test_plan_tools.py +2 -2
- codemie_test_harness/tests/workflow/assistant_tools/ado/test_workflow_with_assistant_with_ado_wiki_tools.py +2 -2
- codemie_test_harness/tests/workflow/assistant_tools/ado/test_workflow_with_assistant_with_ado_work_item_tools.py +2 -2
- codemie_test_harness/tests/workflow/assistant_tools/cloud/test_workflow_with_assistant_cloud_tools.py +1 -1
- codemie_test_harness/tests/workflow/assistant_tools/codebase/test_worfklow_with_assistant_codebase_tools.py +2 -2
- codemie_test_harness/tests/workflow/assistant_tools/data_management/test_workflow_with_assistant_with_data_management_tools.py +2 -2
- codemie_test_harness/tests/workflow/assistant_tools/default_integrations/test_default_integrations_for_tool.py +8 -8
- codemie_test_harness/tests/workflow/assistant_tools/default_integrations/test_default_integrations_for_tool_kit.py +8 -8
- codemie_test_harness/tests/workflow/assistant_tools/default_integrations/test_default_integrations_for_tool_with_datasource.py +8 -8
- codemie_test_harness/tests/workflow/assistant_tools/file_management/test_workflow_with_assistant_with_file_management_tools.py +5 -5
- codemie_test_harness/tests/workflow/assistant_tools/git/test_workflow_with_assistant_git_tools.py +7 -7
- codemie_test_harness/tests/workflow/assistant_tools/mcp/test_workflow_with_assistant_with_mcp_server.py +3 -3
- codemie_test_harness/tests/workflow/assistant_tools/notification/test_workflow_with_assistant_notification_tools.py +2 -2
- codemie_test_harness/tests/workflow/assistant_tools/open_api/test_workflow_with_assistant_with_open_api_tools.py +1 -1
- codemie_test_harness/tests/workflow/assistant_tools/plugin/test_workflow_with_assistant_with_development_plugin.py +2 -2
- codemie_test_harness/tests/workflow/assistant_tools/plugin/test_workflow_with_assistant_with_plugin_and_mcp_servers.py +2 -2
- codemie_test_harness/tests/workflow/assistant_tools/project_management/test_workflow_with_assistant_pm_tools.py +1 -1
- codemie_test_harness/tests/workflow/assistant_tools/report_portal/test_workflow_with_assistant_with_report_portal_tools.py +1 -1
- codemie_test_harness/tests/workflow/assistant_tools/research/test_workflow_with_assistant_research_tools.py +2 -2
- codemie_test_harness/tests/workflow/assistant_tools/servicenow/test_workflow_with_servicenow_tools.py +1 -1
- codemie_test_harness/tests/workflow/assistant_tools/vcs/workflow_with_assistant_vcs_tools.py +1 -1
- codemie_test_harness/tests/workflow/config_validation/test_config_validation.py +1 -1
- codemie_test_harness/tests/workflow/direct_tools_calling/default_integrations/test_default_integrations_for_tool.py +8 -8
- codemie_test_harness/tests/workflow/direct_tools_calling/default_integrations/test_default_integrations_for_tool_kit.py +8 -8
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_access_management_tool.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_ado_test_plan_tools.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_ado_wiki_tools.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_ado_work_item_tools.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_cloud_tools.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_codebase_tools.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_data_management_tools_elastic.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_data_management_tools_sql.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_file_management_tools.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_notification_tools.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_open_api_tools.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_plugin_tools.py +4 -4
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_project_management_tools.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_report_portal_tools.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_research_tools.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_servicenow_tools.py +3 -3
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_vcs_tools.py +3 -3
- codemie_test_harness/tests/workflow/test_workflows.py +1 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/access_management/test_workflow_with_keycloak_tool.py +1 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/ado/test_workflow_with_ado_test_plan_tools.py +2 -2
- codemie_test_harness/tests/workflow/virtual_assistant_tools/ado/test_workflow_with_ado_wiki_tools.py +2 -2
- codemie_test_harness/tests/workflow/virtual_assistant_tools/ado/test_workflow_with_ado_work_item_tools.py +2 -2
- codemie_test_harness/tests/workflow/virtual_assistant_tools/cloud/test_workflow_with_cloud_tools.py +4 -4
- codemie_test_harness/tests/workflow/virtual_assistant_tools/codebase/test_workflow_with_codebase_tools.py +2 -2
- codemie_test_harness/tests/workflow/virtual_assistant_tools/data_management/test_workflow_with_data_management_tools.py +2 -2
- codemie_test_harness/tests/workflow/virtual_assistant_tools/default_integrations/test_default_integrations_for_tool.py +8 -8
- codemie_test_harness/tests/workflow/virtual_assistant_tools/default_integrations/test_default_integrations_for_tool_kit.py +8 -8
- codemie_test_harness/tests/workflow/virtual_assistant_tools/default_integrations/test_default_integrations_for_tool_with_datasource.py +8 -8
- codemie_test_harness/tests/workflow/virtual_assistant_tools/file_management/test_workflow_with_file_management_tools.py +5 -5
- codemie_test_harness/tests/workflow/virtual_assistant_tools/git/test_workflow_with_git_tools.py +7 -7
- codemie_test_harness/tests/workflow/virtual_assistant_tools/mcp/test_workflow_with_mcp_server.py +3 -3
- codemie_test_harness/tests/workflow/virtual_assistant_tools/notification/test_workflow_with_notification_tools.py +4 -4
- codemie_test_harness/tests/workflow/virtual_assistant_tools/open_api/test_workflow_with_open_api_tools.py +2 -2
- codemie_test_harness/tests/workflow/virtual_assistant_tools/plugin/test_workflow_with_development_plugin.py +2 -2
- codemie_test_harness/tests/workflow/virtual_assistant_tools/plugin/test_workflow_with_plugin_and_mcp_servers.py +2 -2
- codemie_test_harness/tests/workflow/virtual_assistant_tools/project_management/test_workflow_with_project_management_tools.py +2 -2
- codemie_test_harness/tests/workflow/virtual_assistant_tools/report_portal/test_workflow_with_report_portal_tool.py +1 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/research/test_workflow_with_research_tools.py +2 -2
- codemie_test_harness/tests/workflow/virtual_assistant_tools/servicenow/test_workflow_with_servicenow_tools.py +1 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/vcs/test_workflow_with_vcs_tools.py +1 -1
- {codemie_test_harness-0.1.179.dist-info → codemie_test_harness-0.1.181.dist-info}/METADATA +8 -8
- {codemie_test_harness-0.1.179.dist-info → codemie_test_harness-0.1.181.dist-info}/RECORD +134 -132
- {codemie_test_harness-0.1.179.dist-info → codemie_test_harness-0.1.181.dist-info}/WHEEL +0 -0
- {codemie_test_harness-0.1.179.dist-info → codemie_test_harness-0.1.181.dist-info}/entry_points.txt +0 -0
|
@@ -24,7 +24,11 @@ from codemie_test_harness.tests.test_data.file_test_data import (
|
|
|
24
24
|
RESPONSE_FOR_TWO_FILES_UPLOADED,
|
|
25
25
|
)
|
|
26
26
|
from codemie_test_harness.tests.test_data.output_schema_test_data import output_schema
|
|
27
|
-
from codemie_test_harness.tests.utils.base_utils import
|
|
27
|
+
from codemie_test_harness.tests.utils.base_utils import (
|
|
28
|
+
get_random_name,
|
|
29
|
+
assert_tool_triggered,
|
|
30
|
+
)
|
|
31
|
+
from codemie_test_harness.tests.enums.tools import Default
|
|
28
32
|
from codemie_test_harness.tests.utils.constants import FILES_PATH
|
|
29
33
|
from codemie_test_harness.tests.utils.file_utils import save_file
|
|
30
34
|
|
|
@@ -36,7 +40,7 @@ system_prompt_for_chatting_with_files = """Your task is to show the content of t
|
|
|
36
40
|
|
|
37
41
|
|
|
38
42
|
@pytest.mark.assistant
|
|
39
|
-
@pytest.mark.
|
|
43
|
+
@pytest.mark.api
|
|
40
44
|
@pytest.mark.smoke
|
|
41
45
|
def test_create_assistant(assistant_utils, default_llm):
|
|
42
46
|
response = assistant_utils.send_create_assistant_request()
|
|
@@ -47,7 +51,7 @@ def test_create_assistant(assistant_utils, default_llm):
|
|
|
47
51
|
|
|
48
52
|
|
|
49
53
|
@pytest.mark.assistant
|
|
50
|
-
@pytest.mark.
|
|
54
|
+
@pytest.mark.api
|
|
51
55
|
@pytest.mark.smoke
|
|
52
56
|
def test_get_all_assistants(search_utils):
|
|
53
57
|
response = search_utils.list_assistants(filters=None)
|
|
@@ -57,7 +61,7 @@ def test_get_all_assistants(search_utils):
|
|
|
57
61
|
|
|
58
62
|
|
|
59
63
|
@pytest.mark.assistant
|
|
60
|
-
@pytest.mark.
|
|
64
|
+
@pytest.mark.api
|
|
61
65
|
@pytest.mark.smoke
|
|
62
66
|
def test_get_prebuilt_assistants(assistant_utils):
|
|
63
67
|
response = assistant_utils.get_prebuilt_assistant()
|
|
@@ -67,7 +71,7 @@ def test_get_prebuilt_assistants(assistant_utils):
|
|
|
67
71
|
|
|
68
72
|
|
|
69
73
|
@pytest.mark.assistant
|
|
70
|
-
@pytest.mark.
|
|
74
|
+
@pytest.mark.api
|
|
71
75
|
@pytest.mark.smoke
|
|
72
76
|
def test_get_users_assistants(assistant_utils, search_utils):
|
|
73
77
|
assistant_utils.send_create_assistant_request()
|
|
@@ -78,7 +82,7 @@ def test_get_users_assistants(assistant_utils, search_utils):
|
|
|
78
82
|
|
|
79
83
|
|
|
80
84
|
@pytest.mark.assistant
|
|
81
|
-
@pytest.mark.
|
|
85
|
+
@pytest.mark.api
|
|
82
86
|
@pytest.mark.smoke
|
|
83
87
|
def test_get_assistant_context(assistant_utils):
|
|
84
88
|
response = assistant_utils.get_assistant_context(PROJECT)
|
|
@@ -87,7 +91,7 @@ def test_get_assistant_context(assistant_utils):
|
|
|
87
91
|
|
|
88
92
|
|
|
89
93
|
@pytest.mark.assistant
|
|
90
|
-
@pytest.mark.
|
|
94
|
+
@pytest.mark.api
|
|
91
95
|
@pytest.mark.smoke
|
|
92
96
|
def test_get_available_tools(assistant_utils):
|
|
93
97
|
response = assistant_utils.get_assistant_tools()
|
|
@@ -96,7 +100,7 @@ def test_get_available_tools(assistant_utils):
|
|
|
96
100
|
|
|
97
101
|
|
|
98
102
|
@pytest.mark.assistant
|
|
99
|
-
@pytest.mark.
|
|
103
|
+
@pytest.mark.api
|
|
100
104
|
@pytest.mark.smoke
|
|
101
105
|
def test_get_assistant_by_id(assistant_utils):
|
|
102
106
|
assistant_name = get_random_name()
|
|
@@ -112,7 +116,7 @@ def test_get_assistant_by_id(assistant_utils):
|
|
|
112
116
|
|
|
113
117
|
|
|
114
118
|
@pytest.mark.assistant
|
|
115
|
-
@pytest.mark.
|
|
119
|
+
@pytest.mark.api
|
|
116
120
|
@pytest.mark.smoke
|
|
117
121
|
def test_get_assistant_by_slug(assistant_utils):
|
|
118
122
|
assistant_name = get_random_name()
|
|
@@ -128,7 +132,7 @@ def test_get_assistant_by_slug(assistant_utils):
|
|
|
128
132
|
|
|
129
133
|
|
|
130
134
|
@pytest.mark.assistant
|
|
131
|
-
@pytest.mark.
|
|
135
|
+
@pytest.mark.api
|
|
132
136
|
@pytest.mark.smoke
|
|
133
137
|
def test_update_assistant(assistant_utils, default_llm):
|
|
134
138
|
assistant_name = get_random_name()
|
|
@@ -166,7 +170,7 @@ def test_update_assistant(assistant_utils, default_llm):
|
|
|
166
170
|
|
|
167
171
|
|
|
168
172
|
@pytest.mark.assistant
|
|
169
|
-
@pytest.mark.
|
|
173
|
+
@pytest.mark.api
|
|
170
174
|
@pytest.mark.smoke
|
|
171
175
|
def test_delete_assistant(assistant_utils, search_utils):
|
|
172
176
|
assistant_name = get_random_name()
|
|
@@ -184,7 +188,7 @@ def test_delete_assistant(assistant_utils, search_utils):
|
|
|
184
188
|
|
|
185
189
|
|
|
186
190
|
@pytest.mark.assistant
|
|
187
|
-
@pytest.mark.
|
|
191
|
+
@pytest.mark.api
|
|
188
192
|
@pytest.mark.smoke
|
|
189
193
|
def test_ask_assistant(assistant_utils):
|
|
190
194
|
test_assistant = assistant_utils.create_assistant()
|
|
@@ -203,7 +207,7 @@ def test_ask_assistant(assistant_utils):
|
|
|
203
207
|
|
|
204
208
|
|
|
205
209
|
@pytest.mark.assistant
|
|
206
|
-
@pytest.mark.
|
|
210
|
+
@pytest.mark.api
|
|
207
211
|
@pytest.mark.skip(reason="Not implemented yet")
|
|
208
212
|
def test_export_assistant(assistant_utils):
|
|
209
213
|
assistant_name = get_random_name()
|
|
@@ -220,11 +224,11 @@ def test_export_assistant(assistant_utils):
|
|
|
220
224
|
|
|
221
225
|
@pytest.mark.assistant
|
|
222
226
|
@pytest.mark.file
|
|
223
|
-
@pytest.mark.
|
|
227
|
+
@pytest.mark.api
|
|
224
228
|
@pytest.mark.smoke
|
|
225
|
-
@pytest.mark.
|
|
229
|
+
@pytest.mark.testcase("EPMCDME-4001, EPMCDME-4002, EPMCDME-2527")
|
|
226
230
|
@pytest.mark.parametrize(
|
|
227
|
-
"file_name,expected_response",
|
|
231
|
+
"file_name,expected_response,expected_tool",
|
|
228
232
|
file_test_data,
|
|
229
233
|
ids=[f"{row[0]}" for row in file_test_data],
|
|
230
234
|
)
|
|
@@ -234,6 +238,7 @@ def test_create_assistant_and_prompt_with_file(
|
|
|
234
238
|
similarity_check,
|
|
235
239
|
file_name,
|
|
236
240
|
expected_response,
|
|
241
|
+
expected_tool,
|
|
237
242
|
):
|
|
238
243
|
prompt = (
|
|
239
244
|
f"What is the content/text of the {file_name}. Show information from ALL pages. "
|
|
@@ -249,19 +254,25 @@ def test_create_assistant_and_prompt_with_file(
|
|
|
249
254
|
|
|
250
255
|
conversation_id = str(uuid.uuid4())
|
|
251
256
|
|
|
252
|
-
response = assistant_utils.ask_assistant(
|
|
253
|
-
assistant,
|
|
257
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
258
|
+
assistant,
|
|
259
|
+
prompt,
|
|
260
|
+
file_urls=[file_url],
|
|
261
|
+
conversation_id=conversation_id,
|
|
262
|
+
minimal_response=False,
|
|
254
263
|
)
|
|
264
|
+
assert_tool_triggered(expected_tool, triggered_tools)
|
|
255
265
|
similarity_check.check_similarity(response, expected_response)
|
|
256
266
|
|
|
257
|
-
response = assistant_utils.ask_assistant(
|
|
258
|
-
assistant, prompt, conversation_id=conversation_id
|
|
267
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
268
|
+
assistant, prompt, conversation_id=conversation_id, minimal_response=False
|
|
259
269
|
)
|
|
270
|
+
assert_tool_triggered(expected_tool, triggered_tools)
|
|
260
271
|
similarity_check.check_similarity(response, expected_response)
|
|
261
272
|
|
|
262
273
|
|
|
263
274
|
@pytest.mark.assistant
|
|
264
|
-
@pytest.mark.
|
|
275
|
+
@pytest.mark.api
|
|
265
276
|
@pytest.mark.smoke
|
|
266
277
|
def test_assistant_has_an_access_to_the_history(
|
|
267
278
|
assistant_utils,
|
|
@@ -288,7 +299,7 @@ def test_assistant_has_an_access_to_the_history(
|
|
|
288
299
|
|
|
289
300
|
|
|
290
301
|
@pytest.mark.assistant
|
|
291
|
-
@pytest.mark.
|
|
302
|
+
@pytest.mark.api
|
|
292
303
|
@pytest.mark.smoke
|
|
293
304
|
def test_passing_history_to_chat(
|
|
294
305
|
assistant_utils,
|
|
@@ -315,7 +326,7 @@ def test_passing_history_to_chat(
|
|
|
315
326
|
|
|
316
327
|
@pytest.mark.assistant
|
|
317
328
|
@pytest.mark.file
|
|
318
|
-
@pytest.mark.
|
|
329
|
+
@pytest.mark.api
|
|
319
330
|
@pytest.mark.smoke
|
|
320
331
|
@pytest.mark.parametrize(
|
|
321
332
|
"file_name",
|
|
@@ -333,7 +344,7 @@ def test_upload_file_to_chat(
|
|
|
333
344
|
|
|
334
345
|
|
|
335
346
|
@pytest.mark.assistant
|
|
336
|
-
@pytest.mark.
|
|
347
|
+
@pytest.mark.api
|
|
337
348
|
@pytest.mark.smoke
|
|
338
349
|
def test_chat_with_pydantic_output_schema(assistant_utils, assistant):
|
|
339
350
|
class OutputSchema(BaseModel):
|
|
@@ -347,7 +358,7 @@ def test_chat_with_pydantic_output_schema(assistant_utils, assistant):
|
|
|
347
358
|
|
|
348
359
|
|
|
349
360
|
@pytest.mark.assistant
|
|
350
|
-
@pytest.mark.
|
|
361
|
+
@pytest.mark.api
|
|
351
362
|
@pytest.mark.smoke
|
|
352
363
|
def test_chat_with_json_output_schema(assistant_utils, assistant):
|
|
353
364
|
response = assistant_utils.ask_assistant(
|
|
@@ -359,7 +370,7 @@ def test_chat_with_json_output_schema(assistant_utils, assistant):
|
|
|
359
370
|
|
|
360
371
|
@pytest.mark.assistant
|
|
361
372
|
@pytest.mark.file
|
|
362
|
-
@pytest.mark.
|
|
373
|
+
@pytest.mark.api
|
|
363
374
|
@pytest.mark.smoke
|
|
364
375
|
def test_create_assistant_and_prompt_with_multiple_files(
|
|
365
376
|
assistant_utils,
|
|
@@ -382,23 +393,28 @@ def test_create_assistant_and_prompt_with_multiple_files(
|
|
|
382
393
|
|
|
383
394
|
conversation_id = str(uuid.uuid4())
|
|
384
395
|
|
|
385
|
-
response = assistant_utils.ask_assistant(
|
|
396
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
386
397
|
assistant,
|
|
387
398
|
prompt,
|
|
388
399
|
file_urls=[docx_file_url, ini_file_url],
|
|
389
400
|
conversation_id=conversation_id,
|
|
401
|
+
minimal_response=False,
|
|
390
402
|
)
|
|
403
|
+
|
|
404
|
+
assert_tool_triggered((Default.DOCX_TOOL, Default.FILE_ANALYSIS), triggered_tools)
|
|
391
405
|
similarity_check.check_similarity(response, RESPONSE_FOR_TWO_FILES_UPLOADED)
|
|
392
406
|
|
|
393
|
-
response = assistant_utils.ask_assistant(
|
|
394
|
-
assistant, prompt, conversation_id=conversation_id
|
|
407
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
408
|
+
assistant, prompt, conversation_id=conversation_id, minimal_response=False
|
|
395
409
|
)
|
|
410
|
+
|
|
411
|
+
assert_tool_triggered((Default.DOCX_TOOL, Default.FILE_ANALYSIS), triggered_tools)
|
|
396
412
|
similarity_check.check_similarity(response, RESPONSE_FOR_TWO_FILES_UPLOADED)
|
|
397
413
|
|
|
398
414
|
|
|
399
415
|
@pytest.mark.assistant
|
|
400
416
|
@pytest.mark.file
|
|
401
|
-
@pytest.mark.
|
|
417
|
+
@pytest.mark.api
|
|
402
418
|
@pytest.mark.smoke
|
|
403
419
|
@pytest.mark.parametrize("prompt,expected_response", EXCEL_TOOL_TEST_DATA)
|
|
404
420
|
def test_excel_tool_extended_functionality(
|
|
@@ -428,16 +444,17 @@ def test_excel_tool_extended_functionality(
|
|
|
428
444
|
file_url = uploaded_file.get("file_url")
|
|
429
445
|
|
|
430
446
|
# Send the prompt with the uploaded file
|
|
431
|
-
response = assistant_utils.ask_assistant(
|
|
432
|
-
assistant_instance, prompt, file_urls=[file_url]
|
|
447
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
448
|
+
assistant_instance, prompt, file_urls=[file_url], minimal_response=False
|
|
433
449
|
)
|
|
434
450
|
|
|
451
|
+
assert_tool_triggered(Default.EXCEL_TOOL, triggered_tools)
|
|
435
452
|
similarity_check.check_similarity(response, expected_response)
|
|
436
453
|
|
|
437
454
|
|
|
438
455
|
@pytest.mark.assistant
|
|
439
456
|
@pytest.mark.file
|
|
440
|
-
@pytest.mark.
|
|
457
|
+
@pytest.mark.api
|
|
441
458
|
@pytest.mark.smoke
|
|
442
459
|
@pytest.mark.parametrize("prompt,expected_response", DOCX_TOOL_TEST_DATA)
|
|
443
460
|
def test_docx_tool_extended_functionality(
|
|
@@ -467,8 +484,9 @@ def test_docx_tool_extended_functionality(
|
|
|
467
484
|
file_url = uploaded_file.get("file_url")
|
|
468
485
|
|
|
469
486
|
# Send the prompt with the uploaded file
|
|
470
|
-
response = assistant_utils.ask_assistant(
|
|
471
|
-
assistant_instance, prompt, file_urls=[file_url]
|
|
487
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
488
|
+
assistant_instance, prompt, file_urls=[file_url], minimal_response=False
|
|
472
489
|
)
|
|
473
490
|
|
|
491
|
+
assert_tool_triggered(Default.DOCX_TOOL, triggered_tools)
|
|
474
492
|
similarity_check.check_similarity(response, expected_response)
|
|
@@ -5,11 +5,12 @@ from codemie_test_harness.tests.test_data.keycloak_tool_test_data import (
|
|
|
5
5
|
KEYCLOAK_TOOL_PROMPT,
|
|
6
6
|
KEYCLOAK_TOOL_RESPONSE,
|
|
7
7
|
)
|
|
8
|
+
from codemie_test_harness.tests.utils.base_utils import assert_tool_triggered
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
@pytest.mark.assistant
|
|
11
12
|
@pytest.mark.keycloak
|
|
12
|
-
@pytest.mark.
|
|
13
|
+
@pytest.mark.api
|
|
13
14
|
def test_assistant_with_keycloak_tool(
|
|
14
15
|
assistant_utils,
|
|
15
16
|
assistant,
|
|
@@ -22,6 +23,10 @@ def test_assistant_with_keycloak_tool(
|
|
|
22
23
|
settings=keycloak_integration,
|
|
23
24
|
)
|
|
24
25
|
|
|
25
|
-
response = assistant_utils.ask_assistant(
|
|
26
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
27
|
+
keycloak_assistant, KEYCLOAK_TOOL_PROMPT, minimal_response=False
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
assert_tool_triggered(AccessManagementTool.KEYCLOAK, triggered_tools)
|
|
26
31
|
|
|
27
32
|
similarity_check.check_similarity(response, KEYCLOAK_TOOL_RESPONSE)
|
|
@@ -11,14 +11,17 @@ from codemie_test_harness.tests.test_data.ado_test_plan_tools_test_data import (
|
|
|
11
11
|
ADO_TEST_PLAN_DELETE_PLAN,
|
|
12
12
|
)
|
|
13
13
|
from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
|
|
14
|
-
from codemie_test_harness.tests.utils.base_utils import
|
|
14
|
+
from codemie_test_harness.tests.utils.base_utils import (
|
|
15
|
+
get_random_name,
|
|
16
|
+
assert_tool_triggered,
|
|
17
|
+
)
|
|
15
18
|
from codemie_test_harness.tests.utils.constants import ID_PATTERN
|
|
16
19
|
from codemie_test_harness.tests.utils.json_utils import extract_id_from_ado_response
|
|
17
20
|
|
|
18
21
|
|
|
19
22
|
@pytest.mark.assistant
|
|
20
23
|
@pytest.mark.ado
|
|
21
|
-
@pytest.mark.
|
|
24
|
+
@pytest.mark.api
|
|
22
25
|
@pytest.mark.parametrize(
|
|
23
26
|
"toolkit,tool_name,prompt,expected_response",
|
|
24
27
|
ado_test_plan_get_test_data,
|
|
@@ -44,13 +47,17 @@ def test_assistant_with_ado_test_plan_get_tools(
|
|
|
44
47
|
settings=settings,
|
|
45
48
|
)
|
|
46
49
|
|
|
47
|
-
response = assistant_utils.ask_assistant(
|
|
50
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
51
|
+
assistant, prompt, minimal_response=False
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
48
55
|
similarity_check.check_similarity(response, expected_response)
|
|
49
56
|
|
|
50
57
|
|
|
51
58
|
@pytest.mark.assistant
|
|
52
59
|
@pytest.mark.ado
|
|
53
|
-
@pytest.mark.
|
|
60
|
+
@pytest.mark.api
|
|
54
61
|
def test_assistant_with_ado_test_plan_tools(
|
|
55
62
|
assistant_utils,
|
|
56
63
|
assistant,
|
|
@@ -78,13 +85,18 @@ def test_assistant_with_ado_test_plan_tools(
|
|
|
78
85
|
create_prompt = ADO_TEST_PLAN_CREATE_TEST_PLAN["prompt_to_assistant"].format(
|
|
79
86
|
test_plan_title
|
|
80
87
|
)
|
|
81
|
-
create_response = assistant_utils.ask_assistant(
|
|
88
|
+
create_response, create_triggered_tools = assistant_utils.ask_assistant(
|
|
89
|
+
assistant, create_prompt, minimal_response=False
|
|
90
|
+
)
|
|
82
91
|
|
|
83
92
|
# Extract the test plan ID from the response
|
|
84
93
|
test_plan_id = extract_id_from_ado_response(create_response, ID_PATTERN)
|
|
85
94
|
create_expected = ADO_TEST_PLAN_CREATE_TEST_PLAN["expected_llm_answer"].format(
|
|
86
95
|
test_plan_title, test_plan_id
|
|
87
96
|
)
|
|
97
|
+
assert_tool_triggered(
|
|
98
|
+
AzureDevOpsTestPlanTool.CREATE_TEST_PLAN, create_triggered_tools
|
|
99
|
+
)
|
|
88
100
|
similarity_check.check_similarity(create_response, create_expected)
|
|
89
101
|
|
|
90
102
|
# Calculate root suite ID (based on the Java implementation)
|
|
@@ -94,8 +106,8 @@ def test_assistant_with_ado_test_plan_tools(
|
|
|
94
106
|
create_suite_prompt = ADO_TEST_PLAN_CREATE_SUITE["prompt_to_assistant"].format(
|
|
95
107
|
root_suite_id, test_plan_id
|
|
96
108
|
)
|
|
97
|
-
create_suite_response = assistant_utils.ask_assistant(
|
|
98
|
-
assistant, create_suite_prompt
|
|
109
|
+
create_suite_response, create_suite_triggered_tools = assistant_utils.ask_assistant(
|
|
110
|
+
assistant, create_suite_prompt, minimal_response=False
|
|
99
111
|
)
|
|
100
112
|
|
|
101
113
|
# Extract the test suite ID from the response
|
|
@@ -103,36 +115,52 @@ def test_assistant_with_ado_test_plan_tools(
|
|
|
103
115
|
create_suite_expected = ADO_TEST_PLAN_CREATE_SUITE["expected_llm_answer"].format(
|
|
104
116
|
test_suite_id
|
|
105
117
|
)
|
|
118
|
+
assert_tool_triggered(
|
|
119
|
+
AzureDevOpsTestPlanTool.CREATE_TEST_SUITE, create_suite_triggered_tools
|
|
120
|
+
)
|
|
106
121
|
similarity_check.check_similarity(create_suite_response, create_suite_expected)
|
|
107
122
|
|
|
108
123
|
# 3. Add test case to the suite
|
|
109
124
|
add_case_prompt = ADO_TEST_PLAN_ADD_TEST_CASE["prompt_to_assistant"].format(
|
|
110
125
|
test_suite_id, test_plan_id
|
|
111
126
|
)
|
|
112
|
-
add_case_response = assistant_utils.ask_assistant(
|
|
127
|
+
add_case_response, add_case_triggered_tools = assistant_utils.ask_assistant(
|
|
128
|
+
assistant, add_case_prompt, minimal_response=False
|
|
129
|
+
)
|
|
113
130
|
add_case_expected = ADO_TEST_PLAN_ADD_TEST_CASE["expected_llm_answer"].format(
|
|
114
131
|
test_suite_id, test_plan_id
|
|
115
132
|
)
|
|
133
|
+
assert_tool_triggered(
|
|
134
|
+
AzureDevOpsTestPlanTool.ADD_TEST_CASE, add_case_triggered_tools
|
|
135
|
+
)
|
|
116
136
|
similarity_check.check_similarity(add_case_response, add_case_expected)
|
|
117
137
|
|
|
118
138
|
# 4. Delete test suite
|
|
119
139
|
delete_suite_prompt = ADO_TEST_PLAN_DELETE_SUITE["prompt_to_assistant"].format(
|
|
120
140
|
test_suite_id, test_plan_id
|
|
121
141
|
)
|
|
122
|
-
delete_suite_response = assistant_utils.ask_assistant(
|
|
123
|
-
assistant, delete_suite_prompt
|
|
142
|
+
delete_suite_response, delete_suite_triggered_tools = assistant_utils.ask_assistant(
|
|
143
|
+
assistant, delete_suite_prompt, minimal_response=False
|
|
124
144
|
)
|
|
125
145
|
delete_suite_expected = ADO_TEST_PLAN_DELETE_SUITE["expected_llm_answer"].format(
|
|
126
146
|
test_suite_id, test_plan_id
|
|
127
147
|
)
|
|
148
|
+
assert_tool_triggered(
|
|
149
|
+
AzureDevOpsTestPlanTool.DELETE_TEST_SUITE, delete_suite_triggered_tools
|
|
150
|
+
)
|
|
128
151
|
similarity_check.check_similarity(delete_suite_response, delete_suite_expected)
|
|
129
152
|
|
|
130
153
|
# 5. Delete test plan
|
|
131
154
|
delete_plan_prompt = ADO_TEST_PLAN_DELETE_PLAN["prompt_to_assistant"].format(
|
|
132
155
|
test_plan_id
|
|
133
156
|
)
|
|
134
|
-
delete_plan_response = assistant_utils.ask_assistant(
|
|
157
|
+
delete_plan_response, delete_plan_triggered_tools = assistant_utils.ask_assistant(
|
|
158
|
+
assistant, delete_plan_prompt, minimal_response=False
|
|
159
|
+
)
|
|
135
160
|
delete_plan_expected = ADO_TEST_PLAN_DELETE_PLAN["expected_llm_answer"].format(
|
|
136
161
|
test_plan_id
|
|
137
162
|
)
|
|
163
|
+
assert_tool_triggered(
|
|
164
|
+
AzureDevOpsTestPlanTool.DELETE_TEST_PLAN, delete_plan_triggered_tools
|
|
165
|
+
)
|
|
138
166
|
similarity_check.check_similarity(delete_plan_response, delete_plan_expected)
|
|
@@ -10,12 +10,15 @@ from codemie_test_harness.tests.test_data.ado_wiki_tools_test_data import (
|
|
|
10
10
|
ADO_WIKI_DELETE_PAGE,
|
|
11
11
|
)
|
|
12
12
|
from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
|
|
13
|
-
from codemie_test_harness.tests.utils.base_utils import
|
|
13
|
+
from codemie_test_harness.tests.utils.base_utils import (
|
|
14
|
+
get_random_name,
|
|
15
|
+
assert_tool_triggered,
|
|
16
|
+
)
|
|
14
17
|
|
|
15
18
|
|
|
16
19
|
@pytest.mark.assistant
|
|
17
20
|
@pytest.mark.ado
|
|
18
|
-
@pytest.mark.
|
|
21
|
+
@pytest.mark.api
|
|
19
22
|
@pytest.mark.parametrize(
|
|
20
23
|
"toolkit,tool_name,prompt,expected_response",
|
|
21
24
|
ado_wiki_get_test_data,
|
|
@@ -41,13 +44,17 @@ def test_assistant_with_ado_wiki_get_tools(
|
|
|
41
44
|
settings=settings,
|
|
42
45
|
)
|
|
43
46
|
|
|
44
|
-
response = assistant_utils.ask_assistant(
|
|
47
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
48
|
+
assistant, prompt, minimal_response=False
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
45
52
|
similarity_check.check_similarity(response, expected_response)
|
|
46
53
|
|
|
47
54
|
|
|
48
55
|
@pytest.mark.assistant
|
|
49
56
|
@pytest.mark.ado
|
|
50
|
-
@pytest.mark.
|
|
57
|
+
@pytest.mark.api
|
|
51
58
|
def test_assistant_with_ado_wiki_modify_tools(
|
|
52
59
|
assistant_utils,
|
|
53
60
|
assistant,
|
|
@@ -72,7 +79,10 @@ def test_assistant_with_ado_wiki_modify_tools(
|
|
|
72
79
|
# 1. Create the page
|
|
73
80
|
create_prompt = ADO_WIKI_CREATE_PAGE["prompt_to_assistant"].format(page_title)
|
|
74
81
|
create_expected = ADO_WIKI_CREATE_PAGE["expected_llm_answer"].format(page_title)
|
|
75
|
-
response = assistant_utils.ask_assistant(
|
|
82
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
83
|
+
assistant, create_prompt, minimal_response=False
|
|
84
|
+
)
|
|
85
|
+
assert_tool_triggered(AzureDevOpsWikiTool.MODIFY_WIKI_PAGE, triggered_tools)
|
|
76
86
|
similarity_check.check_similarity(response, create_expected)
|
|
77
87
|
|
|
78
88
|
# 2. Rename the page
|
|
@@ -82,7 +92,10 @@ def test_assistant_with_ado_wiki_modify_tools(
|
|
|
82
92
|
rename_expected = ADO_WIKI_RENAME_PAGE["expected_llm_answer"].format(
|
|
83
93
|
page_title, page_title
|
|
84
94
|
)
|
|
85
|
-
response = assistant_utils.ask_assistant(
|
|
95
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
96
|
+
assistant, rename_prompt, minimal_response=False
|
|
97
|
+
)
|
|
98
|
+
assert_tool_triggered(AzureDevOpsWikiTool.RENAME_WIKI_PAGE, triggered_tools)
|
|
86
99
|
similarity_check.check_similarity(response, rename_expected)
|
|
87
100
|
|
|
88
101
|
# 3. Modify the page
|
|
@@ -92,7 +105,10 @@ def test_assistant_with_ado_wiki_modify_tools(
|
|
|
92
105
|
modify_expected = ADO_WIKI_MODIFY_PAGE["expected_llm_answer"].format(
|
|
93
106
|
page_title + "-Updated"
|
|
94
107
|
)
|
|
95
|
-
response = assistant_utils.ask_assistant(
|
|
108
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
109
|
+
assistant, modify_prompt, minimal_response=False
|
|
110
|
+
)
|
|
111
|
+
assert_tool_triggered(AzureDevOpsWikiTool.MODIFY_WIKI_PAGE, triggered_tools)
|
|
96
112
|
similarity_check.check_similarity(response, modify_expected)
|
|
97
113
|
|
|
98
114
|
# 4. Delete the page
|
|
@@ -102,5 +118,8 @@ def test_assistant_with_ado_wiki_modify_tools(
|
|
|
102
118
|
delete_expected = ADO_WIKI_DELETE_PAGE["expected_llm_answer"].format(
|
|
103
119
|
page_title + "-Updated"
|
|
104
120
|
)
|
|
105
|
-
response = assistant_utils.ask_assistant(
|
|
121
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
122
|
+
assistant, delete_prompt, minimal_response=False
|
|
123
|
+
)
|
|
124
|
+
assert_tool_triggered(AzureDevOpsWikiTool.DELETE_WIKI_PAGE_BY_PATH, triggered_tools)
|
|
106
125
|
similarity_check.check_similarity(response, delete_expected)
|
|
@@ -9,14 +9,17 @@ from codemie_test_harness.tests.test_data.ado_work_item_tools_test_data import (
|
|
|
9
9
|
ADO_WORK_ITEM_LINK,
|
|
10
10
|
)
|
|
11
11
|
from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
|
|
12
|
-
from codemie_test_harness.tests.utils.base_utils import
|
|
12
|
+
from codemie_test_harness.tests.utils.base_utils import (
|
|
13
|
+
get_random_name,
|
|
14
|
+
assert_tool_triggered,
|
|
15
|
+
)
|
|
13
16
|
from codemie_test_harness.tests.utils.constants import WORK_ITEM_ID_PATTERN
|
|
14
17
|
from codemie_test_harness.tests.utils.json_utils import extract_id_from_ado_response
|
|
15
18
|
|
|
16
19
|
|
|
17
20
|
@pytest.mark.assistant
|
|
18
21
|
@pytest.mark.ado
|
|
19
|
-
@pytest.mark.
|
|
22
|
+
@pytest.mark.api
|
|
20
23
|
@pytest.mark.parametrize(
|
|
21
24
|
"toolkit,tool_name,prompt,expected_response",
|
|
22
25
|
ado_work_item_get_test_data,
|
|
@@ -42,13 +45,17 @@ def test_assistant_with_ado_work_item_get_tools(
|
|
|
42
45
|
settings=settings,
|
|
43
46
|
)
|
|
44
47
|
|
|
45
|
-
response = assistant_utils.ask_assistant(
|
|
48
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
49
|
+
assistant, prompt, minimal_response=False
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
46
53
|
similarity_check.check_similarity(response, expected_response)
|
|
47
54
|
|
|
48
55
|
|
|
49
56
|
@pytest.mark.assistant
|
|
50
57
|
@pytest.mark.ado
|
|
51
|
-
@pytest.mark.
|
|
58
|
+
@pytest.mark.api
|
|
52
59
|
def test_assistant_with_ado_work_item_modify_tools(
|
|
53
60
|
assistant_utils,
|
|
54
61
|
assistant,
|
|
@@ -72,29 +79,42 @@ def test_assistant_with_ado_work_item_modify_tools(
|
|
|
72
79
|
work_item_title = f"Autotest Task {get_random_name()}"
|
|
73
80
|
|
|
74
81
|
create_prompt = ADO_WORK_ITEM_CREATE["prompt_to_assistant"].format(work_item_title)
|
|
75
|
-
create_response = assistant_utils.ask_assistant(
|
|
82
|
+
create_response, create_triggered_tools = assistant_utils.ask_assistant(
|
|
83
|
+
assistant, create_prompt, minimal_response=False
|
|
84
|
+
)
|
|
76
85
|
|
|
77
86
|
work_item_id = extract_id_from_ado_response(create_response, WORK_ITEM_ID_PATTERN)
|
|
78
87
|
create_expected = ADO_WORK_ITEM_CREATE["expected_llm_answer"].format(
|
|
79
88
|
work_item_title
|
|
80
89
|
)
|
|
90
|
+
assert_tool_triggered(
|
|
91
|
+
AzureDevOpsWorkItemTool.CREATE_WORK_ITEM, create_triggered_tools
|
|
92
|
+
)
|
|
81
93
|
similarity_check.check_similarity(create_response, create_expected)
|
|
82
94
|
|
|
83
95
|
new_title = f"Autotest Epic {get_random_name()}"
|
|
84
96
|
update_prompt = ADO_WORK_ITEM_UPDATE["prompt_to_assistant"].format(
|
|
85
97
|
work_item_id, new_title
|
|
86
98
|
)
|
|
87
|
-
update_response = assistant_utils.ask_assistant(
|
|
99
|
+
update_response, update_triggered_tools = assistant_utils.ask_assistant(
|
|
100
|
+
assistant, update_prompt, minimal_response=False
|
|
101
|
+
)
|
|
88
102
|
|
|
89
103
|
update_expected = ADO_WORK_ITEM_UPDATE["expected_llm_answer"].format(
|
|
90
104
|
work_item_id, new_title
|
|
91
105
|
)
|
|
106
|
+
assert_tool_triggered(
|
|
107
|
+
AzureDevOpsWorkItemTool.UPDATE_WORK_ITEM, update_triggered_tools
|
|
108
|
+
)
|
|
92
109
|
similarity_check.check_similarity(update_response, update_expected)
|
|
93
110
|
|
|
94
111
|
link_prompt = ADO_WORK_ITEM_LINK["prompt_to_assistant"].format(
|
|
95
112
|
work_item_id, work_item_id
|
|
96
113
|
)
|
|
97
|
-
link_response = assistant_utils.ask_assistant(
|
|
114
|
+
link_response, link_triggered_tools = assistant_utils.ask_assistant(
|
|
115
|
+
assistant, link_prompt, minimal_response=False
|
|
116
|
+
)
|
|
98
117
|
|
|
99
118
|
link_expected = ADO_WORK_ITEM_LINK["expected_llm_answer"].format(work_item_id)
|
|
119
|
+
assert_tool_triggered(AzureDevOpsWorkItemTool.LINK_WORK_ITEMS, link_triggered_tools)
|
|
100
120
|
similarity_check.check_similarity(link_response, link_expected)
|
|
@@ -2,10 +2,12 @@ import pytest
|
|
|
2
2
|
|
|
3
3
|
from codemie_test_harness.tests.test_data.cloud_tools_test_data import cloud_test_data
|
|
4
4
|
|
|
5
|
+
from codemie_test_harness.tests.utils.base_utils import assert_tool_triggered
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
@pytest.mark.assistant
|
|
7
9
|
@pytest.mark.cloud
|
|
8
|
-
@pytest.mark.
|
|
10
|
+
@pytest.mark.api
|
|
9
11
|
@pytest.mark.parametrize(
|
|
10
12
|
"toolkit,tool_name,credential_type,credentials,prompt,expected_response",
|
|
11
13
|
cloud_test_data,
|
|
@@ -24,8 +26,12 @@ def test_assistant_with_cloud_tools(
|
|
|
24
26
|
):
|
|
25
27
|
settings = integration_utils.create_integration(credential_type, credentials)
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
cloud_assistant = assistant(toolkit, tool_name, settings=settings)
|
|
30
|
+
|
|
31
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
32
|
+
cloud_assistant, prompt, minimal_response=False
|
|
33
|
+
)
|
|
28
34
|
|
|
29
|
-
|
|
35
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
30
36
|
|
|
31
37
|
similarity_check.check_similarity(response, expected_response)
|
|
@@ -8,11 +8,12 @@ from codemie_test_harness.tests.test_data.codebase_tools_test_data import (
|
|
|
8
8
|
code_tools_test_data,
|
|
9
9
|
sonar_tools_test_data,
|
|
10
10
|
)
|
|
11
|
+
from codemie_test_harness.tests.utils.base_utils import assert_tool_triggered
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
@pytest.mark.assistant
|
|
14
15
|
@pytest.mark.codebase
|
|
15
|
-
@pytest.mark.
|
|
16
|
+
@pytest.mark.api
|
|
16
17
|
@pytest.mark.parametrize(
|
|
17
18
|
"toolkit,tool_name,prompt,expected_response",
|
|
18
19
|
code_tools_test_data,
|
|
@@ -30,12 +31,16 @@ def test_assistant_with_codebase_tools(
|
|
|
30
31
|
expected_response,
|
|
31
32
|
):
|
|
32
33
|
assistant = assistant(toolkit, tool_name, context=code_context(code_datasource))
|
|
33
|
-
response = assistant_utils.ask_assistant(
|
|
34
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
35
|
+
assistant, prompt, minimal_response=False
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
34
39
|
similarity_check.check_similarity(response, expected_response)
|
|
35
40
|
|
|
36
41
|
|
|
37
42
|
@pytest.mark.assistant
|
|
38
|
-
@pytest.mark.
|
|
43
|
+
@pytest.mark.api
|
|
39
44
|
@pytest.mark.parametrize(
|
|
40
45
|
"toolkit, tool_name, credentials, prompt, expected",
|
|
41
46
|
sonar_tools_test_data,
|
|
@@ -60,5 +65,9 @@ def test_assistant_with_sonar_tools(
|
|
|
60
65
|
settings=settings,
|
|
61
66
|
)
|
|
62
67
|
|
|
63
|
-
response = assistant_utils.ask_assistant(
|
|
68
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
69
|
+
assistant, prompt, minimal_response=False
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
64
73
|
similarity_check.check_similarity(response, expected)
|