codemie-test-harness 0.1.184__py3-none-any.whl → 0.1.198__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 +42 -6
- codemie_test_harness/cli/commands/config_cmd.py +1 -1
- codemie_test_harness/cli/commands/run_cmd.py +24 -1
- codemie_test_harness/cli/constants.py +1 -0
- codemie_test_harness/cli/runner.py +17 -3
- codemie_test_harness/cli/utils.py +12 -2
- codemie_test_harness/pytest.ini +3 -0
- 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 +19 -3
- 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 +41 -15
- codemie_test_harness/tests/llm/assistants/test_llm.py +45 -2
- codemie_test_harness/tests/test_data/assistant_test_data.py +171 -171
- 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.198.dist-info}/METADATA +134 -3
- {codemie_test_harness-0.1.184.dist-info → codemie_test_harness-0.1.198.dist-info}/RECORD +81 -81
- {codemie_test_harness-0.1.184.dist-info → codemie_test_harness-0.1.198.dist-info}/WHEEL +0 -0
- {codemie_test_harness-0.1.184.dist-info → codemie_test_harness-0.1.198.dist-info}/entry_points.txt +0 -0
|
@@ -37,15 +37,9 @@ from codemie_test_harness.tests.test_data.pm_tools_test_data import (
|
|
|
37
37
|
from codemie_test_harness.tests.test_data.report_portal_tools_test_data import (
|
|
38
38
|
rp_test_data,
|
|
39
39
|
)
|
|
40
|
+
from codemie_test_harness.tests.utils.base_utils import assert_tool_triggered
|
|
40
41
|
from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
|
|
41
|
-
from codemie_test_harness.tests.enums.environment import Environment
|
|
42
42
|
from codemie_test_harness.tests.utils.constants import test_project_name
|
|
43
|
-
from codemie_test_harness.tests.utils.env_resolver import get_environment
|
|
44
|
-
|
|
45
|
-
pytestmark = pytest.mark.skipif(
|
|
46
|
-
get_environment() in [Environment.LOCALHOST, Environment.GCP],
|
|
47
|
-
reason="Skipping this test on local environment",
|
|
48
|
-
)
|
|
49
43
|
|
|
50
44
|
|
|
51
45
|
@pytest.mark.assistant
|
|
@@ -87,7 +81,11 @@ def test_assistant_with_default_integration_cloud(
|
|
|
87
81
|
# create an assistant
|
|
88
82
|
cloud_assistant = assistant(toolkit, tool_name, project_name=test_project_name)
|
|
89
83
|
|
|
90
|
-
response = assistant_utils.ask_assistant(
|
|
84
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
85
|
+
cloud_assistant, prompt, minimal_response=False
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
91
89
|
|
|
92
90
|
similarity_check.check_similarity(response, expected_response)
|
|
93
91
|
|
|
@@ -126,7 +124,11 @@ def test_assistant_with_default_integration_ado(
|
|
|
126
124
|
# create an assistant
|
|
127
125
|
ado_assistant = assistant(toolkit, tool_name, project_name=test_project_name)
|
|
128
126
|
|
|
129
|
-
response = assistant_utils.ask_assistant(
|
|
127
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
128
|
+
ado_assistant, prompt, minimal_response=False
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
130
132
|
|
|
131
133
|
similarity_check.check_similarity(response, expected_response)
|
|
132
134
|
|
|
@@ -170,7 +172,11 @@ def test_assistant_with_default_integration_codebase(
|
|
|
170
172
|
toolkit, CodeBaseTool.SONAR, project_name=test_project_name
|
|
171
173
|
)
|
|
172
174
|
|
|
173
|
-
response = assistant_utils.ask_assistant(
|
|
175
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
176
|
+
sonar_assistant, prompt, minimal_response=False
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
assert_tool_triggered(CodeBaseTool.SONAR, triggered_tools)
|
|
174
180
|
|
|
175
181
|
similarity_check.check_similarity(response, expected_response)
|
|
176
182
|
|
|
@@ -223,7 +229,11 @@ def test_assistant_with_default_integration_git(
|
|
|
223
229
|
project_name=test_project_name,
|
|
224
230
|
)
|
|
225
231
|
|
|
226
|
-
response = assistant_utils.ask_assistant(
|
|
232
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
233
|
+
git_assistant, prompt, minimal_response=False
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
assert_tool_triggered(tool_name, triggered_tools)
|
|
227
237
|
|
|
228
238
|
similarity_check.check_similarity(response, expected_response)
|
|
229
239
|
|
|
@@ -262,7 +272,11 @@ def test_assistant_with_default_integration_jira(
|
|
|
262
272
|
project_name=test_project_name,
|
|
263
273
|
)
|
|
264
274
|
|
|
265
|
-
response = assistant_utils.ask_assistant(
|
|
275
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
276
|
+
jira_assistant, JIRA_TOOL_PROMPT, minimal_response=False
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
assert_tool_triggered(ProjectManagementTool.JIRA, triggered_tools)
|
|
266
280
|
|
|
267
281
|
similarity_check.check_similarity(response, RESPONSE_FOR_JIRA_TOOL)
|
|
268
282
|
|
|
@@ -299,7 +313,11 @@ def test_assistant_with_default_integration_email(
|
|
|
299
313
|
Toolkit.NOTIFICATION, NotificationTool.EMAIL, project_name=test_project_name
|
|
300
314
|
)
|
|
301
315
|
|
|
302
|
-
response = assistant_utils.ask_assistant(
|
|
316
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
317
|
+
email_assistant, EMAIL_TOOL_PROMPT, minimal_response=False
|
|
318
|
+
)
|
|
319
|
+
|
|
320
|
+
assert_tool_triggered(NotificationTool.EMAIL, triggered_tools)
|
|
303
321
|
|
|
304
322
|
similarity_check.check_similarity(response, EMAIL_RESPONSE)
|
|
305
323
|
|
|
@@ -336,7 +354,11 @@ def test_assistant_with_default_integration_keycloak(
|
|
|
336
354
|
project_name=test_project_name,
|
|
337
355
|
)
|
|
338
356
|
|
|
339
|
-
response = assistant_utils.ask_assistant(
|
|
357
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
358
|
+
keycloak_assistant, KEYCLOAK_TOOL_PROMPT, minimal_response=False
|
|
359
|
+
)
|
|
360
|
+
|
|
361
|
+
assert_tool_triggered(AccessManagementTool.KEYCLOAK, triggered_tools)
|
|
340
362
|
|
|
341
363
|
similarity_check.check_similarity(response, KEYCLOAK_TOOL_RESPONSE)
|
|
342
364
|
|
|
@@ -376,6 +398,10 @@ def test_assistant_with_default_integration_report_portal(
|
|
|
376
398
|
project_name=test_project_name,
|
|
377
399
|
)
|
|
378
400
|
|
|
379
|
-
response = assistant_utils.ask_assistant(
|
|
401
|
+
response, triggered_tools = assistant_utils.ask_assistant(
|
|
402
|
+
report_portal_assistant, prompt, minimal_response=False
|
|
403
|
+
)
|
|
404
|
+
|
|
405
|
+
assert_tool_triggered(ReportPortalTool.GET_DASHBOARD_DATA, triggered_tools)
|
|
380
406
|
|
|
381
407
|
similarity_check.check_similarity(response, expected_response)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import pytest
|
|
2
|
+
from codemie_sdk.models.assistant import ToolKitDetails, ToolDetails
|
|
2
3
|
from hamcrest import assert_that, has_item
|
|
3
4
|
from codemie_test_harness.tests.enums.model_types import ModelTypes
|
|
5
|
+
from codemie_test_harness.tests.enums.tools import Toolkit, FileManagementTool
|
|
4
6
|
from codemie_test_harness.tests.test_data.llm_test_data import MODEL_RESPONSES
|
|
5
7
|
from codemie_test_harness.tests.utils.client_factory import get_client
|
|
6
8
|
from codemie_test_harness.tests.utils.env_resolver import get_environment
|
|
@@ -36,14 +38,25 @@ def pytest_generate_tests(metafunc):
|
|
|
36
38
|
@pytest.mark.api
|
|
37
39
|
@pytest.mark.smoke
|
|
38
40
|
def test_assistant_with_different_models(
|
|
39
|
-
llm_utils, assistant_utils, model_type, similarity_check
|
|
41
|
+
llm_utils, assistant_utils, model_type, similarity_check, filesystem_integration
|
|
40
42
|
):
|
|
41
43
|
assert_that(
|
|
42
44
|
[row.base_name for row in llm_utils.list_llm_models()],
|
|
43
45
|
has_item(model_type),
|
|
44
46
|
f"{model_type} is missing in backend response",
|
|
45
47
|
)
|
|
46
|
-
|
|
48
|
+
|
|
49
|
+
tool = ToolKitDetails(
|
|
50
|
+
toolkit=Toolkit.FILE_MANAGEMENT,
|
|
51
|
+
tools=[
|
|
52
|
+
ToolDetails(
|
|
53
|
+
name=FileManagementTool.GENERATE_IMAGE, settings=filesystem_integration
|
|
54
|
+
)
|
|
55
|
+
],
|
|
56
|
+
settings=filesystem_integration,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
assistant = assistant_utils.create_assistant(model_type, toolkits=[tool])
|
|
47
60
|
response = assistant_utils.ask_assistant(assistant, "Just say one word: 'Hello'")
|
|
48
61
|
|
|
49
62
|
if model_type in [ModelTypes.DEEPSEEK_R1, ModelTypes.RLAB_QWQ_32B]:
|
|
@@ -91,3 +104,33 @@ def test_assistant_with_different_models_with_temperature_parameter(
|
|
|
91
104
|
if model_type in [ModelTypes.DEEPSEEK_R1, ModelTypes.RLAB_QWQ_32B]:
|
|
92
105
|
response = "\n".join(response.split("\n")[-3:])
|
|
93
106
|
similarity_check.check_similarity(response, "Hello")
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
@pytest.mark.assistant
|
|
110
|
+
@pytest.mark.llm
|
|
111
|
+
@pytest.mark.api
|
|
112
|
+
@pytest.mark.smoke
|
|
113
|
+
def test_assistant_with_different_models_with_datasource_attached(
|
|
114
|
+
llm_utils,
|
|
115
|
+
assistant_utils,
|
|
116
|
+
model_type,
|
|
117
|
+
similarity_check,
|
|
118
|
+
datasource_utils,
|
|
119
|
+
default_embedding_llm,
|
|
120
|
+
kb_context,
|
|
121
|
+
file_datasource,
|
|
122
|
+
):
|
|
123
|
+
assert_that(
|
|
124
|
+
[row.base_name for row in llm_utils.list_llm_models()],
|
|
125
|
+
has_item(model_type),
|
|
126
|
+
f"{model_type} is missing in backend response",
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
assistant = assistant_utils.create_assistant(
|
|
130
|
+
model_type, context=[kb_context(file_datasource)]
|
|
131
|
+
)
|
|
132
|
+
response = assistant_utils.ask_assistant(assistant, "Just say one word: 'Hello'")
|
|
133
|
+
|
|
134
|
+
if model_type in [ModelTypes.DEEPSEEK_R1, ModelTypes.RLAB_QWQ_32B]:
|
|
135
|
+
response = "\n".join(response.split("\n")[-3:])
|
|
136
|
+
similarity_check.check_similarity(response, "Hello")
|