codemie-test-harness 0.1.184__py3-none-any.whl → 0.1.197__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 +21 -6
- codemie_test_harness/cli/commands/run_cmd.py +15 -1
- codemie_test_harness/cli/constants.py +1 -21
- codemie_test_harness/cli/runner.py +13 -3
- codemie_test_harness/cli/utils.py +12 -2
- codemie_test_harness/tests/assistant/test_assistants.py +17 -1
- codemie_test_harness/tests/assistant/tools/datamanagement/test_assistant_with_data_management_tools.py +47 -6
- codemie_test_harness/tests/assistant/tools/mcp/test_cli_mcp_server.py +0 -4
- codemie_test_harness/tests/assistant/tools/mcp/test_mcp_servers.py +0 -4
- codemie_test_harness/tests/conftest.py +2 -2
- codemie_test_harness/tests/enums/environment.py +3 -3
- codemie_test_harness/tests/enums/integrations.py +1 -0
- codemie_test_harness/tests/enums/model_types.py +1 -0
- codemie_test_harness/tests/integrations/project/test_default_integrations.py +41 -15
- codemie_test_harness/tests/integrations/project/test_project_integrations.py +42 -0
- codemie_test_harness/tests/integrations/user/test_default_integrations.py +0 -7
- codemie_test_harness/tests/llm/assistants/test_llm.py +56 -2
- codemie_test_harness/tests/test_data/assistant_test_data.py +448 -448
- codemie_test_harness/tests/test_data/codebase_tools_test_data.py +2 -0
- codemie_test_harness/tests/test_data/data_management_tools_test_data.py +18 -0
- codemie_test_harness/tests/test_data/direct_tools/data_management_tools_test_data.py +18 -1
- codemie_test_harness/tests/test_data/direct_tools/report_portal_tools_test_data.py +189 -197
- codemie_test_harness/tests/test_data/integrations_test_data.py +163 -2
- codemie_test_harness/tests/test_data/llm_test_data.py +1 -0
- codemie_test_harness/tests/test_data/open_api_tools_test_data.py +22 -1
- codemie_test_harness/tests/test_data/report_portal_tools_test_data.py +89 -112
- codemie_test_harness/tests/test_data/research_tools_test_data.py +29 -7
- codemie_test_harness/tests/utils/assistant_utils.py +22 -12
- codemie_test_harness/tests/utils/credentials_manager.py +66 -8
- codemie_test_harness/tests/utils/workflow_utils.py +91 -0
- codemie_test_harness/tests/workflow/assistant_tools/access_management/test_workflow_with_assistant_with_keycloak_tool.py +7 -0
- codemie_test_harness/tests/workflow/assistant_tools/ado/test_workflow_with_assistant_with_ado_test_plan_tools.py +50 -1
- codemie_test_harness/tests/workflow/assistant_tools/ado/test_workflow_with_assistant_with_ado_wiki_tools.py +39 -1
- codemie_test_harness/tests/workflow/assistant_tools/ado/test_workflow_with_assistant_with_ado_work_item_tools.py +34 -1
- codemie_test_harness/tests/workflow/assistant_tools/cloud/test_workflow_with_assistant_cloud_tools.py +6 -0
- codemie_test_harness/tests/workflow/assistant_tools/codebase/test_worfklow_with_assistant_codebase_tools.py +11 -0
- codemie_test_harness/tests/workflow/assistant_tools/data_management/test_workflow_with_assistant_with_data_management_tools.py +72 -1
- codemie_test_harness/tests/workflow/assistant_tools/default_integrations/test_default_integrations_for_tool.py +31 -0
- codemie_test_harness/tests/workflow/assistant_tools/default_integrations/test_default_integrations_for_tool_kit.py +31 -0
- codemie_test_harness/tests/workflow/assistant_tools/default_integrations/test_default_integrations_for_tool_with_datasource.py +26 -0
- codemie_test_harness/tests/workflow/assistant_tools/file_management/test_workflow_with_assistant_with_file_management_tools.py +63 -1
- codemie_test_harness/tests/workflow/assistant_tools/git/test_workflow_with_assistant_git_tools.py +82 -7
- codemie_test_harness/tests/workflow/assistant_tools/mcp/test_workflow_with_assistant_with_mcp_server.py +23 -4
- codemie_test_harness/tests/workflow/assistant_tools/notification/test_workflow_with_assistant_notification_tools.py +12 -0
- codemie_test_harness/tests/workflow/assistant_tools/open_api/test_workflow_with_assistant_with_open_api_tools.py +6 -0
- codemie_test_harness/tests/workflow/assistant_tools/plugin/test_workflow_with_assistant_with_development_plugin.py +29 -2
- codemie_test_harness/tests/workflow/assistant_tools/plugin/test_workflow_with_assistant_with_plugin_and_mcp_servers.py +14 -1
- codemie_test_harness/tests/workflow/assistant_tools/project_management/test_workflow_with_assistant_pm_tools.py +7 -0
- codemie_test_harness/tests/workflow/assistant_tools/report_portal/test_workflow_with_assistant_with_report_portal_tools.py +7 -0
- codemie_test_harness/tests/workflow/assistant_tools/research/test_workflow_with_assistant_research_tools.py +14 -1
- codemie_test_harness/tests/workflow/assistant_tools/servicenow/test_workflow_with_servicenow_tools.py +6 -0
- codemie_test_harness/tests/workflow/assistant_tools/vcs/workflow_with_assistant_vcs_tools.py +6 -0
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_cloud_tools.py +12 -9
- codemie_test_harness/tests/workflow/virtual_assistant_tools/access_management/test_workflow_with_keycloak_tool.py +8 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/ado/test_workflow_with_ado_test_plan_tools.py +28 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/ado/test_workflow_with_ado_wiki_tools.py +24 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/ado/test_workflow_with_ado_work_item_tools.py +20 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/cloud/test_workflow_with_cloud_tools.py +13 -4
- codemie_test_harness/tests/workflow/virtual_assistant_tools/codebase/test_workflow_with_codebase_tools.py +16 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/data_management/test_workflow_with_data_management_tools.py +73 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/default_integrations/test_default_integrations_for_tool.py +34 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/default_integrations/test_default_integrations_for_tool_kit.py +34 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/default_integrations/test_default_integrations_for_tool_with_datasource.py +34 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/file_management/test_workflow_with_file_management_tools.py +101 -49
- codemie_test_harness/tests/workflow/virtual_assistant_tools/git/test_workflow_with_git_tools.py +42 -3
- codemie_test_harness/tests/workflow/virtual_assistant_tools/mcp/test_workflow_with_mcp_server.py +27 -5
- codemie_test_harness/tests/workflow/virtual_assistant_tools/notification/test_workflow_with_notification_tools.py +13 -0
- codemie_test_harness/tests/workflow/virtual_assistant_tools/open_api/test_workflow_with_open_api_tools.py +10 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/plugin/test_workflow_with_development_plugin.py +20 -0
- codemie_test_harness/tests/workflow/virtual_assistant_tools/plugin/test_workflow_with_plugin_and_mcp_servers.py +14 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/project_management/test_workflow_with_project_management_tools.py +10 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/report_portal/test_workflow_with_report_portal_tool.py +10 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/research/test_workflow_with_research_tools.py +9 -0
- codemie_test_harness/tests/workflow/virtual_assistant_tools/servicenow/test_workflow_with_servicenow_tools.py +10 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/vcs/test_workflow_with_vcs_tools.py +9 -1
- {codemie_test_harness-0.1.184.dist-info → codemie_test_harness-0.1.197.dist-info}/METADATA +38 -3
- {codemie_test_harness-0.1.184.dist-info → codemie_test_harness-0.1.197.dist-info}/RECORD +79 -79
- {codemie_test_harness-0.1.184.dist-info → codemie_test_harness-0.1.197.dist-info}/WHEEL +0 -0
- {codemie_test_harness-0.1.184.dist-info → codemie_test_harness-0.1.197.dist-info}/entry_points.txt +0 -0
|
@@ -12,7 +12,10 @@ from codemie_test_harness.tests.test_data.pm_tools_test_data import (
|
|
|
12
12
|
RESPONSE_FOR_JIRA_TOOL,
|
|
13
13
|
)
|
|
14
14
|
from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
|
|
15
|
-
from codemie_test_harness.tests.utils.base_utils import
|
|
15
|
+
from codemie_test_harness.tests.utils.base_utils import (
|
|
16
|
+
get_random_name,
|
|
17
|
+
assert_tool_triggered,
|
|
18
|
+
)
|
|
16
19
|
from codemie_test_harness.tests.utils.constants import test_project_name
|
|
17
20
|
|
|
18
21
|
|
|
@@ -77,6 +80,12 @@ def test_assistant_in_workflow_should_use_user_integration_by_default(
|
|
|
77
80
|
response = workflow_utils.execute_workflow(
|
|
78
81
|
test_workflow.id, assistant_and_state_name, user_input=JIRA_TOOL_PROMPT
|
|
79
82
|
)
|
|
83
|
+
|
|
84
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
85
|
+
test_workflow
|
|
86
|
+
)
|
|
87
|
+
assert_tool_triggered(ProjectManagementTool.JIRA, triggered_tools)
|
|
88
|
+
|
|
80
89
|
similarity_check.check_similarity(response, RESPONSE_FOR_JIRA_TOOL)
|
|
81
90
|
|
|
82
91
|
|
|
@@ -124,6 +133,12 @@ def test_assistant_in_workflow_with_global_and_project_integration(
|
|
|
124
133
|
response = workflow_utils.execute_workflow(
|
|
125
134
|
test_workflow.id, assistant_and_state_name, user_input=JIRA_TOOL_PROMPT
|
|
126
135
|
)
|
|
136
|
+
|
|
137
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
138
|
+
test_workflow
|
|
139
|
+
)
|
|
140
|
+
assert_tool_triggered(ProjectManagementTool.JIRA, triggered_tools)
|
|
141
|
+
|
|
127
142
|
similarity_check.check_similarity(response, RESPONSE_FOR_JIRA_TOOL)
|
|
128
143
|
|
|
129
144
|
|
|
@@ -162,6 +177,12 @@ def test_assistant_in_workflow_with_project_integration_only(
|
|
|
162
177
|
response = workflow_utils.execute_workflow(
|
|
163
178
|
test_workflow.id, assistant_and_state_name, user_input=JIRA_TOOL_PROMPT
|
|
164
179
|
)
|
|
180
|
+
|
|
181
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
182
|
+
test_workflow
|
|
183
|
+
)
|
|
184
|
+
assert_tool_triggered(ProjectManagementTool.JIRA, triggered_tools)
|
|
185
|
+
|
|
165
186
|
similarity_check.check_similarity(response, RESPONSE_FOR_JIRA_TOOL)
|
|
166
187
|
|
|
167
188
|
|
|
@@ -208,6 +229,12 @@ def test_assistant_in_workflow_with_global_valid_and_user_invalid_integration(
|
|
|
208
229
|
response = workflow_utils.execute_workflow(
|
|
209
230
|
test_workflow.id, assistant_and_state_name, user_input=JIRA_TOOL_PROMPT
|
|
210
231
|
)
|
|
232
|
+
|
|
233
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
234
|
+
test_workflow
|
|
235
|
+
)
|
|
236
|
+
assert_tool_triggered(ProjectManagementTool.JIRA, triggered_tools)
|
|
237
|
+
|
|
211
238
|
similarity_check.check_similarity(response, RESPONSE_FOR_JIRA_TOOL)
|
|
212
239
|
|
|
213
240
|
|
|
@@ -254,4 +281,10 @@ def test_assistant_in_workflow_with_project_valid_and_user_invalid_integration(
|
|
|
254
281
|
response = workflow_utils.execute_workflow(
|
|
255
282
|
test_workflow.id, assistant_and_state_name, user_input=JIRA_TOOL_PROMPT
|
|
256
283
|
)
|
|
284
|
+
|
|
285
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
286
|
+
test_workflow
|
|
287
|
+
)
|
|
288
|
+
assert_tool_triggered(ProjectManagementTool.JIRA, triggered_tools)
|
|
289
|
+
|
|
257
290
|
similarity_check.check_similarity(response, RESPONSE_FOR_JIRA_TOOL)
|
|
@@ -11,7 +11,10 @@ from codemie_test_harness.tests.test_data.ado_wiki_tools_test_data import (
|
|
|
11
11
|
ado_wiki_get_test_data,
|
|
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 test_project_name
|
|
16
19
|
|
|
17
20
|
ado_wiki_prompt = ado_wiki_get_test_data[1][2]
|
|
@@ -81,6 +84,12 @@ def test_assistant_in_workflow_should_use_user_integration_by_default(
|
|
|
81
84
|
response = workflow_utils.execute_workflow(
|
|
82
85
|
test_workflow.id, assistant_and_state_name, user_input=ado_wiki_prompt
|
|
83
86
|
)
|
|
87
|
+
|
|
88
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
89
|
+
test_workflow
|
|
90
|
+
)
|
|
91
|
+
assert_tool_triggered(AzureDevOpsWikiTool.GET_WIKI, triggered_tools)
|
|
92
|
+
|
|
84
93
|
similarity_check.check_similarity(response, ado_wiki_answer)
|
|
85
94
|
|
|
86
95
|
|
|
@@ -129,6 +138,12 @@ def test_assistant_in_workflow_with_global_and_project_integration(
|
|
|
129
138
|
response = workflow_utils.execute_workflow(
|
|
130
139
|
test_workflow.id, assistant_and_state_name, user_input=ado_wiki_prompt
|
|
131
140
|
)
|
|
141
|
+
|
|
142
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
143
|
+
test_workflow
|
|
144
|
+
)
|
|
145
|
+
assert_tool_triggered(AzureDevOpsWikiTool.GET_WIKI, triggered_tools)
|
|
146
|
+
|
|
132
147
|
similarity_check.check_similarity(response, ado_wiki_answer)
|
|
133
148
|
|
|
134
149
|
|
|
@@ -169,6 +184,12 @@ def test_assistant_in_workflow_with_project_integration_only(
|
|
|
169
184
|
response = workflow_utils.execute_workflow(
|
|
170
185
|
test_workflow.id, assistant_and_state_name, user_input=ado_wiki_prompt
|
|
171
186
|
)
|
|
187
|
+
|
|
188
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
189
|
+
test_workflow
|
|
190
|
+
)
|
|
191
|
+
assert_tool_triggered(AzureDevOpsWikiTool.GET_WIKI, triggered_tools)
|
|
192
|
+
|
|
172
193
|
similarity_check.check_similarity(response, ado_wiki_answer)
|
|
173
194
|
|
|
174
195
|
|
|
@@ -217,6 +238,12 @@ def test_assistant_in_workflow_with_global_valid_and_user_invalid_integration(
|
|
|
217
238
|
response = workflow_utils.execute_workflow(
|
|
218
239
|
test_workflow.id, assistant_and_state_name, user_input=ado_wiki_prompt
|
|
219
240
|
)
|
|
241
|
+
|
|
242
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
243
|
+
test_workflow
|
|
244
|
+
)
|
|
245
|
+
assert_tool_triggered(AzureDevOpsWikiTool.GET_WIKI, triggered_tools)
|
|
246
|
+
|
|
220
247
|
similarity_check.check_similarity(response, ado_wiki_answer)
|
|
221
248
|
|
|
222
249
|
|
|
@@ -265,4 +292,10 @@ def test_assistant_in_workflow_with_project_valid_and_user_invalid_integration(
|
|
|
265
292
|
response = workflow_utils.execute_workflow(
|
|
266
293
|
test_workflow.id, assistant_and_state_name, user_input=ado_wiki_prompt
|
|
267
294
|
)
|
|
295
|
+
|
|
296
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
297
|
+
test_workflow
|
|
298
|
+
)
|
|
299
|
+
assert_tool_triggered(AzureDevOpsWikiTool.GET_WIKI, triggered_tools)
|
|
300
|
+
|
|
268
301
|
similarity_check.check_similarity(response, ado_wiki_answer)
|
|
@@ -11,7 +11,10 @@ from codemie_test_harness.tests.test_data.git_tools_test_data import (
|
|
|
11
11
|
list_branches_set_active_branch_test_data,
|
|
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 test_project_name
|
|
16
19
|
|
|
17
20
|
git_tool_prompt = list_branches_set_active_branch_test_data[0][2]
|
|
@@ -92,6 +95,12 @@ def test_assistant_in_workflow_should_use_user_integration_by_default(
|
|
|
92
95
|
response = workflow_utils.execute_workflow(
|
|
93
96
|
test_workflow.id, assistant_and_state_name, user_input=git_tool_prompt
|
|
94
97
|
)
|
|
98
|
+
|
|
99
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
100
|
+
test_workflow
|
|
101
|
+
)
|
|
102
|
+
assert_tool_triggered(GitTool.LIST_BRANCHES_IN_REPO, triggered_tools)
|
|
103
|
+
|
|
95
104
|
similarity_check.check_similarity(response, git_tool_answer)
|
|
96
105
|
|
|
97
106
|
|
|
@@ -155,6 +164,12 @@ def test_assistant_in_workflow_with_global_and_project_integration(
|
|
|
155
164
|
response = workflow_utils.execute_workflow(
|
|
156
165
|
test_workflow.id, assistant_and_state_name, user_input=git_tool_prompt
|
|
157
166
|
)
|
|
167
|
+
|
|
168
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
169
|
+
test_workflow
|
|
170
|
+
)
|
|
171
|
+
assert_tool_triggered(GitTool.LIST_BRANCHES_IN_REPO, triggered_tools)
|
|
172
|
+
|
|
158
173
|
similarity_check.check_similarity(response, git_tool_answer)
|
|
159
174
|
|
|
160
175
|
|
|
@@ -205,6 +220,12 @@ def test_assistant_in_workflow_with_project_integration_only(
|
|
|
205
220
|
response = workflow_utils.execute_workflow(
|
|
206
221
|
test_workflow.id, assistant_and_state_name, user_input=git_tool_prompt
|
|
207
222
|
)
|
|
223
|
+
|
|
224
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
225
|
+
test_workflow
|
|
226
|
+
)
|
|
227
|
+
assert_tool_triggered(GitTool.LIST_BRANCHES_IN_REPO, triggered_tools)
|
|
228
|
+
|
|
208
229
|
similarity_check.check_similarity(response, git_tool_answer)
|
|
209
230
|
|
|
210
231
|
|
|
@@ -267,6 +288,12 @@ def test_assistant_in_workflow_with_global_valid_and_user_invalid_integration(
|
|
|
267
288
|
response = workflow_utils.execute_workflow(
|
|
268
289
|
test_workflow.id, assistant_and_state_name, user_input=git_tool_prompt
|
|
269
290
|
)
|
|
291
|
+
|
|
292
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
293
|
+
test_workflow
|
|
294
|
+
)
|
|
295
|
+
assert_tool_triggered(GitTool.LIST_BRANCHES_IN_REPO, triggered_tools)
|
|
296
|
+
|
|
270
297
|
similarity_check.check_similarity(response, git_tool_answer)
|
|
271
298
|
|
|
272
299
|
|
|
@@ -329,4 +356,10 @@ def test_assistant_in_workflow_with_project_valid_and_user_invalid_integration(
|
|
|
329
356
|
response = workflow_utils.execute_workflow(
|
|
330
357
|
test_workflow.id, assistant_and_state_name, user_input=git_tool_prompt
|
|
331
358
|
)
|
|
359
|
+
|
|
360
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
361
|
+
test_workflow
|
|
362
|
+
)
|
|
363
|
+
assert_tool_triggered(GitTool.LIST_BRANCHES_IN_REPO, triggered_tools)
|
|
364
|
+
|
|
332
365
|
similarity_check.check_similarity(response, git_tool_answer)
|
|
@@ -15,7 +15,10 @@ from codemie_test_harness.tests.test_data.file_management_tools_test_data import
|
|
|
15
15
|
RESPONSE_FOR_DIFF_UPDATE,
|
|
16
16
|
RESPONSE_FOR_FILE_EDITOR,
|
|
17
17
|
)
|
|
18
|
-
from codemie_test_harness.tests.utils.base_utils import
|
|
18
|
+
from codemie_test_harness.tests.utils.base_utils import (
|
|
19
|
+
get_random_name,
|
|
20
|
+
assert_tool_triggered,
|
|
21
|
+
)
|
|
19
22
|
from codemie_test_harness.tests.utils.env_resolver import EnvironmentResolver
|
|
20
23
|
|
|
21
24
|
|
|
@@ -48,6 +51,10 @@ def test_workflow_with_file_management_tools(
|
|
|
48
51
|
response = workflow_utils.execute_workflow(
|
|
49
52
|
test_workflow.id, assistant_and_state_name
|
|
50
53
|
)
|
|
54
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
55
|
+
test_workflow
|
|
56
|
+
)
|
|
57
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
51
58
|
|
|
52
59
|
similarity_check.check_similarity(response, expected_response)
|
|
53
60
|
|
|
@@ -73,6 +80,10 @@ def test_workflow_with_generate_image_tool(
|
|
|
73
80
|
response = workflow_utils.execute_workflow(
|
|
74
81
|
test_workflow.id, assistant_and_state_name
|
|
75
82
|
)
|
|
83
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
84
|
+
test_workflow
|
|
85
|
+
)
|
|
86
|
+
assert_tool_triggered(FileManagementTool.GENERATE_IMAGE, triggered_tools)
|
|
76
87
|
|
|
77
88
|
assert_that(
|
|
78
89
|
response.lower(),
|
|
@@ -96,25 +107,36 @@ def test_workflow_with_read_file_tool(
|
|
|
96
107
|
):
|
|
97
108
|
assistant_and_state_name = get_random_name()
|
|
98
109
|
# Step 1: Write file
|
|
110
|
+
write_workflow = workflow_with_virtual_assistant(
|
|
111
|
+
assistant_and_state_name,
|
|
112
|
+
FileManagementTool.WRITE_FILE,
|
|
113
|
+
integration=filesystem_integration,
|
|
114
|
+
task=WRITE_FILE_TASK,
|
|
115
|
+
)
|
|
99
116
|
workflow_utils.execute_workflow(
|
|
100
|
-
|
|
101
|
-
assistant_and_state_name,
|
|
102
|
-
FileManagementTool.WRITE_FILE,
|
|
103
|
-
integration=filesystem_integration,
|
|
104
|
-
task=WRITE_FILE_TASK,
|
|
105
|
-
).id,
|
|
117
|
+
write_workflow.id,
|
|
106
118
|
assistant_and_state_name,
|
|
107
119
|
)
|
|
120
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
121
|
+
write_workflow
|
|
122
|
+
)
|
|
123
|
+
assert_tool_triggered(FileManagementTool.WRITE_FILE, triggered_tools)
|
|
124
|
+
|
|
108
125
|
# Step 2: Read file
|
|
126
|
+
read_workflow = workflow_with_virtual_assistant(
|
|
127
|
+
assistant_and_state_name,
|
|
128
|
+
FileManagementTool.READ_FILE,
|
|
129
|
+
integration=filesystem_integration,
|
|
130
|
+
task=READ_FILE_TOOL_TASK,
|
|
131
|
+
)
|
|
109
132
|
response = workflow_utils.execute_workflow(
|
|
110
|
-
|
|
111
|
-
assistant_and_state_name,
|
|
112
|
-
FileManagementTool.READ_FILE,
|
|
113
|
-
integration=filesystem_integration,
|
|
114
|
-
task=READ_FILE_TOOL_TASK,
|
|
115
|
-
).id,
|
|
133
|
+
read_workflow.id,
|
|
116
134
|
assistant_and_state_name,
|
|
117
135
|
)
|
|
136
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
137
|
+
read_workflow
|
|
138
|
+
)
|
|
139
|
+
assert_tool_triggered(FileManagementTool.READ_FILE, triggered_tools)
|
|
118
140
|
similarity_check.check_similarity(response, RESPONSE_FOR_READ_FILE_TASK)
|
|
119
141
|
|
|
120
142
|
|
|
@@ -135,37 +157,52 @@ def test_workflow_with_file_editing_tool(
|
|
|
135
157
|
tool_names = (FileManagementTool.WRITE_FILE, FileManagementTool.DIFF_UPDATE)
|
|
136
158
|
|
|
137
159
|
# Create the file
|
|
160
|
+
create_workflow = workflow_with_virtual_assistant(
|
|
161
|
+
assistant_and_state_name,
|
|
162
|
+
tool_names,
|
|
163
|
+
integration=filesystem_integration,
|
|
164
|
+
task=create_file_task(file_to_update),
|
|
165
|
+
)
|
|
138
166
|
workflow_utils.execute_workflow(
|
|
139
|
-
|
|
140
|
-
assistant_and_state_name,
|
|
141
|
-
tool_names,
|
|
142
|
-
integration=filesystem_integration,
|
|
143
|
-
task=create_file_task(file_to_update),
|
|
144
|
-
).id,
|
|
167
|
+
create_workflow.id,
|
|
145
168
|
assistant_and_state_name,
|
|
146
169
|
)
|
|
170
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
171
|
+
create_workflow
|
|
172
|
+
)
|
|
173
|
+
assert_tool_triggered(FileManagementTool.WRITE_FILE, triggered_tools)
|
|
147
174
|
|
|
148
175
|
# Insert to the file
|
|
176
|
+
insert_workflow = workflow_with_virtual_assistant(
|
|
177
|
+
assistant_and_state_name,
|
|
178
|
+
tool_names,
|
|
179
|
+
integration=filesystem_integration,
|
|
180
|
+
task=insert_to_file_task(file_to_update),
|
|
181
|
+
)
|
|
149
182
|
workflow_utils.execute_workflow(
|
|
150
|
-
|
|
151
|
-
assistant_and_state_name,
|
|
152
|
-
tool_names,
|
|
153
|
-
integration=filesystem_integration,
|
|
154
|
-
task=insert_to_file_task(file_to_update),
|
|
155
|
-
).id,
|
|
183
|
+
insert_workflow.id,
|
|
156
184
|
assistant_and_state_name,
|
|
157
185
|
)
|
|
186
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
187
|
+
insert_workflow
|
|
188
|
+
)
|
|
189
|
+
assert_tool_triggered(FileManagementTool.DIFF_UPDATE, triggered_tools)
|
|
158
190
|
|
|
159
191
|
# Show the diff
|
|
192
|
+
diff_workflow = workflow_with_virtual_assistant(
|
|
193
|
+
assistant_and_state_name,
|
|
194
|
+
tool_names,
|
|
195
|
+
integration=filesystem_integration,
|
|
196
|
+
task=show_diff_task(file_to_update),
|
|
197
|
+
)
|
|
160
198
|
response = workflow_utils.execute_workflow(
|
|
161
|
-
|
|
162
|
-
assistant_and_state_name,
|
|
163
|
-
tool_names,
|
|
164
|
-
integration=filesystem_integration,
|
|
165
|
-
task=show_diff_task(file_to_update),
|
|
166
|
-
).id,
|
|
199
|
+
diff_workflow.id,
|
|
167
200
|
assistant_and_state_name,
|
|
168
201
|
)
|
|
202
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
203
|
+
diff_workflow
|
|
204
|
+
)
|
|
205
|
+
assert_tool_triggered(FileManagementTool.DIFF_UPDATE, triggered_tools)
|
|
169
206
|
|
|
170
207
|
similarity_check.check_similarity(response, RESPONSE_FOR_DIFF_UPDATE)
|
|
171
208
|
|
|
@@ -186,36 +223,51 @@ def test_workflow_with_filesystem_tool(
|
|
|
186
223
|
file_to_update = f"sum_{get_random_name()}.py"
|
|
187
224
|
|
|
188
225
|
# Create the file
|
|
226
|
+
create_workflow = workflow_with_virtual_assistant(
|
|
227
|
+
assistant_and_state_name,
|
|
228
|
+
FileManagementTool.FILESYSTEM_EDITOR,
|
|
229
|
+
integration=filesystem_integration,
|
|
230
|
+
task=create_file_task(file_to_update),
|
|
231
|
+
)
|
|
189
232
|
workflow_utils.execute_workflow(
|
|
190
|
-
|
|
191
|
-
assistant_and_state_name,
|
|
192
|
-
FileManagementTool.FILESYSTEM_EDITOR,
|
|
193
|
-
integration=filesystem_integration,
|
|
194
|
-
task=create_file_task(file_to_update),
|
|
195
|
-
).id,
|
|
233
|
+
create_workflow.id,
|
|
196
234
|
assistant_and_state_name,
|
|
197
235
|
)
|
|
236
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
237
|
+
create_workflow
|
|
238
|
+
)
|
|
239
|
+
assert_tool_triggered(FileManagementTool.FILESYSTEM_EDITOR, triggered_tools)
|
|
198
240
|
|
|
199
241
|
# Insert to the file
|
|
242
|
+
insert_workflow = workflow_with_virtual_assistant(
|
|
243
|
+
assistant_and_state_name,
|
|
244
|
+
FileManagementTool.FILESYSTEM_EDITOR,
|
|
245
|
+
integration=filesystem_integration,
|
|
246
|
+
task=insert_to_file_task(file_to_update),
|
|
247
|
+
)
|
|
200
248
|
workflow_utils.execute_workflow(
|
|
201
|
-
|
|
202
|
-
assistant_and_state_name,
|
|
203
|
-
FileManagementTool.FILESYSTEM_EDITOR,
|
|
204
|
-
integration=filesystem_integration,
|
|
205
|
-
task=insert_to_file_task(file_to_update),
|
|
206
|
-
).id,
|
|
249
|
+
insert_workflow.id,
|
|
207
250
|
assistant_and_state_name,
|
|
208
251
|
)
|
|
252
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
253
|
+
insert_workflow
|
|
254
|
+
)
|
|
255
|
+
assert_tool_triggered(FileManagementTool.FILESYSTEM_EDITOR, triggered_tools)
|
|
209
256
|
|
|
210
257
|
# Show the file content
|
|
258
|
+
show_workflow = workflow_with_virtual_assistant(
|
|
259
|
+
assistant_and_state_name,
|
|
260
|
+
FileManagementTool.FILESYSTEM_EDITOR,
|
|
261
|
+
integration=filesystem_integration,
|
|
262
|
+
task=show_file_task(file_to_update),
|
|
263
|
+
)
|
|
211
264
|
response = workflow_utils.execute_workflow(
|
|
212
|
-
|
|
213
|
-
assistant_and_state_name,
|
|
214
|
-
FileManagementTool.FILESYSTEM_EDITOR,
|
|
215
|
-
integration=filesystem_integration,
|
|
216
|
-
task=show_file_task(file_to_update),
|
|
217
|
-
).id,
|
|
265
|
+
show_workflow.id,
|
|
218
266
|
assistant_and_state_name,
|
|
219
267
|
)
|
|
268
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
269
|
+
show_workflow
|
|
270
|
+
)
|
|
271
|
+
assert_tool_triggered(FileManagementTool.FILESYSTEM_EDITOR, triggered_tools)
|
|
220
272
|
|
|
221
273
|
similarity_check.check_similarity(response, RESPONSE_FOR_FILE_EDITOR)
|
codemie_test_harness/tests/workflow/virtual_assistant_tools/git/test_workflow_with_git_tools.py
CHANGED
|
@@ -10,7 +10,11 @@ from codemie_test_harness.tests.test_data.git_tools_test_data import (
|
|
|
10
10
|
get_merge_request_changes_test_data,
|
|
11
11
|
update_file_test_data,
|
|
12
12
|
)
|
|
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
|
+
to_camel_case,
|
|
16
|
+
assert_tool_triggered,
|
|
17
|
+
)
|
|
14
18
|
|
|
15
19
|
|
|
16
20
|
@pytest.mark.workflow
|
|
@@ -45,6 +49,10 @@ def test_workflow_with_list_branch_set_active_branch_tools(
|
|
|
45
49
|
response = workflow_utils.execute_workflow(
|
|
46
50
|
test_workflow.id, assistant_and_state_name
|
|
47
51
|
)
|
|
52
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
53
|
+
test_workflow
|
|
54
|
+
)
|
|
55
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
48
56
|
similarity_check.check_similarity(response, expected_response)
|
|
49
57
|
|
|
50
58
|
|
|
@@ -85,6 +93,10 @@ def test_workflow_with_create_branch_tool(
|
|
|
85
93
|
response = workflow_utils.execute_workflow(
|
|
86
94
|
test_workflow.id, assistant_and_state_name
|
|
87
95
|
)
|
|
96
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
97
|
+
test_workflow
|
|
98
|
+
)
|
|
99
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
88
100
|
|
|
89
101
|
assert_that(
|
|
90
102
|
git_utils.branch_exists(name),
|
|
@@ -139,6 +151,10 @@ def test_workflow_with_create_file_tool(
|
|
|
139
151
|
response = workflow_utils.execute_workflow(
|
|
140
152
|
test_workflow.id, assistant_and_state_name
|
|
141
153
|
)
|
|
154
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
155
|
+
test_workflow
|
|
156
|
+
)
|
|
157
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
142
158
|
|
|
143
159
|
file_content = git_utils.get_file_content(file_name, "main")
|
|
144
160
|
|
|
@@ -189,6 +205,10 @@ def test_workflow_with_create_merge_request_tool(
|
|
|
189
205
|
response = workflow_utils.execute_workflow(
|
|
190
206
|
test_workflow.id, assistant_and_state_name
|
|
191
207
|
)
|
|
208
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
209
|
+
test_workflow
|
|
210
|
+
)
|
|
211
|
+
assert_tool_triggered(tool_name[0], triggered_tools)
|
|
192
212
|
mr_id = git_utils.get_merge_request_id_by_title(name)
|
|
193
213
|
|
|
194
214
|
expected = expected_template(source_branch, name, mr_id)
|
|
@@ -252,6 +272,10 @@ def test_workflow_with_delete_file_tool(
|
|
|
252
272
|
response = workflow_utils.execute_workflow(
|
|
253
273
|
test_workflow.id, assistant_and_state_name
|
|
254
274
|
)
|
|
275
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
276
|
+
test_workflow
|
|
277
|
+
)
|
|
278
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
255
279
|
|
|
256
280
|
assert_that(
|
|
257
281
|
git_utils.file_exists(file_name, "main"),
|
|
@@ -304,7 +328,11 @@ def test_workflow_with_get_merge_request_changes_tool(
|
|
|
304
328
|
|
|
305
329
|
create_mr_prompt = create_mr_prompt_template(source_branch, class_name, mr_name)
|
|
306
330
|
|
|
307
|
-
response = assistant_utils.ask_assistant(
|
|
331
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
332
|
+
assistant_instance, create_mr_prompt, minimal_response=False
|
|
333
|
+
)
|
|
334
|
+
assert_tool_triggered(tool_name[:-1], triggered_tools)
|
|
335
|
+
|
|
308
336
|
mr_id = git_utils.get_merge_request_id_by_title(mr_name)
|
|
309
337
|
|
|
310
338
|
create_mr_expected = create_mr_expected_template(source_branch, mr_name, mr_id)
|
|
@@ -327,6 +355,10 @@ def test_workflow_with_get_merge_request_changes_tool(
|
|
|
327
355
|
response = workflow_utils.execute_workflow(
|
|
328
356
|
test_workflow.id, assistant_and_state_name
|
|
329
357
|
)
|
|
358
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
359
|
+
test_workflow
|
|
360
|
+
)
|
|
361
|
+
assert_tool_triggered(tool_name[-1], triggered_tools)
|
|
330
362
|
|
|
331
363
|
similarity_check.check_similarity(response, get_changes_expected)
|
|
332
364
|
finally:
|
|
@@ -373,7 +405,10 @@ def test_workflow_with_update_file_tools(
|
|
|
373
405
|
)
|
|
374
406
|
|
|
375
407
|
create_prompt = create_prompt_template(class_name)
|
|
376
|
-
response = assistant_utils.ask_assistant(
|
|
408
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
409
|
+
assistant_instance, create_prompt, minimal_response=False
|
|
410
|
+
)
|
|
411
|
+
assert_tool_triggered(tool_name[0], triggered_tools)
|
|
377
412
|
|
|
378
413
|
create_expected = create_expected_template(class_name)
|
|
379
414
|
similarity_check.check_similarity(response, create_expected)
|
|
@@ -400,6 +435,10 @@ def test_workflow_with_update_file_tools(
|
|
|
400
435
|
response = workflow_utils.execute_workflow(
|
|
401
436
|
test_workflow.id, assistant_and_state_name
|
|
402
437
|
)
|
|
438
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
439
|
+
test_workflow
|
|
440
|
+
)
|
|
441
|
+
assert_tool_triggered(tool_name[1], triggered_tools)
|
|
403
442
|
|
|
404
443
|
similarity_check.check_similarity(response, update_expected)
|
|
405
444
|
|
codemie_test_harness/tests/workflow/virtual_assistant_tools/mcp/test_workflow_with_mcp_server.py
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
|
|
3
|
+
from codemie_test_harness.tests.enums.tools import (
|
|
4
|
+
CliMcpServer,
|
|
5
|
+
McpServerFetch,
|
|
6
|
+
McpServerTime,
|
|
7
|
+
)
|
|
3
8
|
from codemie_test_harness.tests.test_data.mcp_server_test_data import (
|
|
4
9
|
FETCH_MCP_SERVER,
|
|
5
10
|
fetch_expected_response,
|
|
@@ -12,11 +17,10 @@ from codemie_test_harness.tests.test_data.mcp_server_test_data import (
|
|
|
12
17
|
cli_mcp_server_test_data,
|
|
13
18
|
CLI_MCP_SERVER,
|
|
14
19
|
)
|
|
15
|
-
from codemie_test_harness.tests.utils.base_utils import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# )
|
|
20
|
+
from codemie_test_harness.tests.utils.base_utils import (
|
|
21
|
+
get_random_name,
|
|
22
|
+
assert_tool_triggered,
|
|
23
|
+
)
|
|
20
24
|
|
|
21
25
|
|
|
22
26
|
@pytest.mark.workflow
|
|
@@ -42,6 +46,12 @@ def test_workflow_with_time_mcp_server(
|
|
|
42
46
|
assistant_and_state_name,
|
|
43
47
|
time_server_prompt,
|
|
44
48
|
)
|
|
49
|
+
|
|
50
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
51
|
+
test_workflow
|
|
52
|
+
)
|
|
53
|
+
assert_tool_triggered(McpServerTime.CONVERT_TIME, triggered_tools)
|
|
54
|
+
|
|
45
55
|
similarity_check.check_similarity(response, time_expected_response)
|
|
46
56
|
|
|
47
57
|
|
|
@@ -74,6 +84,12 @@ def test_workflow_with_cli_mcp_server(
|
|
|
74
84
|
response = workflow_utils.execute_workflow(
|
|
75
85
|
test_workflow.id, assistant_and_state_name, f"execute the command: '{command}'"
|
|
76
86
|
)
|
|
87
|
+
|
|
88
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
89
|
+
test_workflow
|
|
90
|
+
)
|
|
91
|
+
assert_tool_triggered(CliMcpServer.RUN_COMMAND, triggered_tools)
|
|
92
|
+
|
|
77
93
|
similarity_check.check_similarity(response, expected_answer)
|
|
78
94
|
|
|
79
95
|
|
|
@@ -96,4 +112,10 @@ def test_workflow_with_fetch_mcp_server(
|
|
|
96
112
|
response = workflow_utils.execute_workflow(
|
|
97
113
|
test_workflow.id, assistant_and_state_name, fetch_server_prompt
|
|
98
114
|
)
|
|
115
|
+
|
|
116
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
117
|
+
test_workflow
|
|
118
|
+
)
|
|
119
|
+
assert_tool_triggered(McpServerFetch.FETCH, triggered_tools)
|
|
120
|
+
|
|
99
121
|
similarity_check.check_similarity(response, fetch_expected_response)
|
|
@@ -2,6 +2,7 @@ import pytest
|
|
|
2
2
|
from hamcrest import assert_that, equal_to
|
|
3
3
|
|
|
4
4
|
from codemie_test_harness.tests.enums.tools import NotificationTool
|
|
5
|
+
from codemie_test_harness.tests.utils.base_utils import assert_tool_triggered
|
|
5
6
|
from codemie_test_harness.tests.test_data.notification_tools_test_data import (
|
|
6
7
|
EMAIL_TOOL_PROMPT,
|
|
7
8
|
EMAIL_RESPONSE,
|
|
@@ -42,6 +43,12 @@ def test_workflow_with_notification_email_tool(
|
|
|
42
43
|
response = workflow_utils.execute_workflow(
|
|
43
44
|
test_workflow.id, assistant_and_state_name
|
|
44
45
|
)
|
|
46
|
+
|
|
47
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
48
|
+
test_workflow
|
|
49
|
+
)
|
|
50
|
+
assert_tool_triggered(NotificationTool.EMAIL, triggered_tools)
|
|
51
|
+
|
|
45
52
|
similarity_check.check_similarity(response, EMAIL_RESPONSE)
|
|
46
53
|
|
|
47
54
|
message_data = gmail_message_operator.get_messages_list()
|
|
@@ -85,4 +92,10 @@ def test_workflow_with_notification_telegram_tool(
|
|
|
85
92
|
response = workflow_utils.execute_workflow(
|
|
86
93
|
test_workflow.id, assistant_and_state_name
|
|
87
94
|
)
|
|
95
|
+
|
|
96
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
97
|
+
test_workflow
|
|
98
|
+
)
|
|
99
|
+
assert_tool_triggered(NotificationTool.TELEGRAM, triggered_tools)
|
|
100
|
+
|
|
88
101
|
similarity_check.check_similarity(response, TELEGRAM_RESPONSE)
|
|
@@ -3,7 +3,10 @@ import pytest
|
|
|
3
3
|
from codemie_test_harness.tests.test_data.open_api_tools_test_data import (
|
|
4
4
|
open_api_tools_test_data,
|
|
5
5
|
)
|
|
6
|
-
from codemie_test_harness.tests.utils.base_utils import
|
|
6
|
+
from codemie_test_harness.tests.utils.base_utils import (
|
|
7
|
+
get_random_name,
|
|
8
|
+
assert_tool_triggered,
|
|
9
|
+
)
|
|
7
10
|
from codemie_test_harness.tests.utils.env_resolver import EnvironmentResolver
|
|
8
11
|
|
|
9
12
|
|
|
@@ -40,4 +43,10 @@ def test_workflow_with_open_api_tools(
|
|
|
40
43
|
response = workflow_utils.execute_workflow(
|
|
41
44
|
test_workflow.id, assistant_and_state_name
|
|
42
45
|
)
|
|
46
|
+
|
|
47
|
+
triggered_tools = workflow_utils.extract_triggered_tools_from_execution(
|
|
48
|
+
test_workflow
|
|
49
|
+
)
|
|
50
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
51
|
+
|
|
43
52
|
similarity_check.check_similarity(response, expected_response)
|