codemie-test-harness 0.1.160__py3-none-any.whl → 0.1.161__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/tests/llm/assistants/test_lite_llm.py +96 -0
- codemie_test_harness/tests/llm/assistants/test_llm.py +6 -6
- codemie_test_harness/tests/utils/aws_parameters_store.py +18 -0
- {codemie_test_harness-0.1.160.dist-info → codemie_test_harness-0.1.161.dist-info}/METADATA +2 -2
- {codemie_test_harness-0.1.160.dist-info → codemie_test_harness-0.1.161.dist-info}/RECORD +7 -6
- {codemie_test_harness-0.1.160.dist-info → codemie_test_harness-0.1.161.dist-info}/WHEEL +0 -0
- {codemie_test_harness-0.1.160.dist-info → codemie_test_harness-0.1.161.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
from codemie_sdk.models.integration import CredentialTypes
|
|
3
|
+
from hamcrest import assert_that, has_item
|
|
4
|
+
|
|
5
|
+
from codemie_test_harness.tests.enums.model_types import ModelTypes
|
|
6
|
+
from codemie_test_harness.tests.test_data.llm_test_data import MODEL_RESPONSES
|
|
7
|
+
from codemie_test_harness.tests.utils.aws_parameters_store import CredentialsUtil
|
|
8
|
+
from codemie_test_harness.tests.utils.client_factory import get_client
|
|
9
|
+
from codemie_test_harness.tests.utils.constants import test_project_name
|
|
10
|
+
from codemie_test_harness.tests.utils.env_resolver import get_environment
|
|
11
|
+
from codemie_test_harness.tests.utils.pytest_utils import check_mark
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@pytest.fixture(scope="module")
|
|
15
|
+
def lite_llm_integration(integration_utils):
|
|
16
|
+
credential_values = CredentialsUtil.lite_llm_credentials()
|
|
17
|
+
integration = integration_utils.create_user_integration(
|
|
18
|
+
CredentialTypes.LITE_LLM,
|
|
19
|
+
credential_values,
|
|
20
|
+
)
|
|
21
|
+
yield integration
|
|
22
|
+
if integration:
|
|
23
|
+
integration_utils.delete_integration(integration)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@pytest.fixture(scope="function")
|
|
27
|
+
def invalid_lite_llm_integration(integration_utils):
|
|
28
|
+
credential_values = CredentialsUtil.invalid_lite_llm_credentials()
|
|
29
|
+
integration = integration_utils.create_user_integration(
|
|
30
|
+
CredentialTypes.LITE_LLM,
|
|
31
|
+
credential_values,
|
|
32
|
+
project_name=test_project_name,
|
|
33
|
+
)
|
|
34
|
+
yield integration
|
|
35
|
+
if integration:
|
|
36
|
+
integration_utils.delete_integration(integration)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def pytest_generate_tests(metafunc):
|
|
40
|
+
if "model_type" in metafunc.fixturenames:
|
|
41
|
+
is_smoke = check_mark(metafunc, "smoke")
|
|
42
|
+
test_data = []
|
|
43
|
+
env = get_environment()
|
|
44
|
+
if is_smoke:
|
|
45
|
+
available_models = get_client().llms.list()
|
|
46
|
+
for model in available_models:
|
|
47
|
+
test_data.append(pytest.param(model.base_name))
|
|
48
|
+
else:
|
|
49
|
+
for model_data in MODEL_RESPONSES:
|
|
50
|
+
test_data.append(
|
|
51
|
+
pytest.param(
|
|
52
|
+
model_data.model_type,
|
|
53
|
+
marks=pytest.mark.skipif(
|
|
54
|
+
env not in model_data.environments,
|
|
55
|
+
reason=f"Skip on non {'/'.join(str(env) for env in model_data.environments[:-1])} envs",
|
|
56
|
+
),
|
|
57
|
+
)
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
metafunc.parametrize("model_type", test_data)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@pytest.mark.assistant
|
|
64
|
+
@pytest.mark.lite_llm
|
|
65
|
+
@pytest.mark.regression
|
|
66
|
+
def test_assistant_with_different_models_in_lite_llm(
|
|
67
|
+
llm_utils,
|
|
68
|
+
lite_llm_integration,
|
|
69
|
+
assistant_utils,
|
|
70
|
+
model_type,
|
|
71
|
+
similarity_check,
|
|
72
|
+
):
|
|
73
|
+
assert_that(
|
|
74
|
+
[row.base_name for row in llm_utils.list_llm_models()],
|
|
75
|
+
has_item(model_type),
|
|
76
|
+
f"{model_type} is missing in backend response",
|
|
77
|
+
)
|
|
78
|
+
assistant = assistant_utils.create_assistant(model_type)
|
|
79
|
+
response = assistant_utils.ask_assistant(assistant, "Just say one word: 'Hello'")
|
|
80
|
+
|
|
81
|
+
if model_type in [ModelTypes.DEEPSEEK_R1, ModelTypes.RLAB_QWQ_32B]:
|
|
82
|
+
response = "\n".join(response.split("\n")[-3:])
|
|
83
|
+
similarity_check.check_similarity(response, "Hello")
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
@pytest.mark.assistant
|
|
87
|
+
@pytest.mark.lite_llm
|
|
88
|
+
@pytest.mark.regression
|
|
89
|
+
def test_assistant_with_invalid_lite_llm(
|
|
90
|
+
invalid_lite_llm_integration,
|
|
91
|
+
assistant,
|
|
92
|
+
assistant_utils,
|
|
93
|
+
):
|
|
94
|
+
assistant = assistant(project_name=test_project_name)
|
|
95
|
+
response = assistant_utils.ask_assistant(assistant, "Just say one word: 'Hello'")
|
|
96
|
+
assert_that(response.startswith("AI Agent run failed with error: Error code: 401"))
|
|
@@ -36,10 +36,10 @@ def pytest_generate_tests(metafunc):
|
|
|
36
36
|
@pytest.mark.regression
|
|
37
37
|
@pytest.mark.smoke
|
|
38
38
|
def test_assistant_with_different_models(
|
|
39
|
-
|
|
39
|
+
llm_utils, assistant_utils, model_type, similarity_check
|
|
40
40
|
):
|
|
41
41
|
assert_that(
|
|
42
|
-
[row.base_name for row in
|
|
42
|
+
[row.base_name for row in llm_utils.list_llm_models()],
|
|
43
43
|
has_item(model_type),
|
|
44
44
|
f"{model_type} is missing in backend response",
|
|
45
45
|
)
|
|
@@ -57,10 +57,10 @@ def test_assistant_with_different_models(
|
|
|
57
57
|
@pytest.mark.regression
|
|
58
58
|
@pytest.mark.smoke
|
|
59
59
|
def test_assistant_with_different_models_with_top_p_parameter(
|
|
60
|
-
|
|
60
|
+
llm_utils, assistant_utils, model_type, similarity_check
|
|
61
61
|
):
|
|
62
62
|
assert_that(
|
|
63
|
-
[row.base_name for row in
|
|
63
|
+
[row.base_name for row in llm_utils.list_llm_models()],
|
|
64
64
|
has_item(model_type),
|
|
65
65
|
f"{model_type} is missing in backend response",
|
|
66
66
|
)
|
|
@@ -78,10 +78,10 @@ def test_assistant_with_different_models_with_top_p_parameter(
|
|
|
78
78
|
@pytest.mark.regression
|
|
79
79
|
@pytest.mark.smoke
|
|
80
80
|
def test_assistant_with_different_models_with_temperature_parameter(
|
|
81
|
-
|
|
81
|
+
llm_utils, assistant_utils, model_type, similarity_check
|
|
82
82
|
):
|
|
83
83
|
assert_that(
|
|
84
|
-
[row.base_name for row in
|
|
84
|
+
[row.base_name for row in llm_utils.list_llm_models()],
|
|
85
85
|
has_item(model_type),
|
|
86
86
|
f"{model_type} is missing in backend response",
|
|
87
87
|
)
|
|
@@ -623,6 +623,24 @@ class CredentialsUtil:
|
|
|
623
623
|
cred.value = "wrong_key"
|
|
624
624
|
return credentials
|
|
625
625
|
|
|
626
|
+
@staticmethod
|
|
627
|
+
def lite_llm_credentials() -> List[CredentialValues]:
|
|
628
|
+
lite_llm_creds = AwsParameterStore.get_cloud_provider_credentials("litellm")
|
|
629
|
+
return [
|
|
630
|
+
CredentialValues(
|
|
631
|
+
key="api_key",
|
|
632
|
+
value=lite_llm_creds.get("api_key"),
|
|
633
|
+
),
|
|
634
|
+
]
|
|
635
|
+
|
|
636
|
+
@staticmethod
|
|
637
|
+
def invalid_lite_llm_credentials() -> List[CredentialValues]:
|
|
638
|
+
credentials = CredentialsUtil.lite_llm_credentials()
|
|
639
|
+
for cred in credentials:
|
|
640
|
+
if cred.key == "api_key":
|
|
641
|
+
cred.value = "wrong_key"
|
|
642
|
+
return credentials
|
|
643
|
+
|
|
626
644
|
@staticmethod
|
|
627
645
|
def jira_cloud_jql() -> str:
|
|
628
646
|
jira_creds = AwsParameterStore.get_cloud_provider_credentials("jira")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: codemie-test-harness
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.161
|
|
4
4
|
Summary: Autotest for CodeMie backend and UI
|
|
5
5
|
Author: Anton Yeromin
|
|
6
6
|
Author-email: anton_yeromin@epam.com
|
|
@@ -13,7 +13,7 @@ Requires-Dist: aws-assume-role-lib (>=2.10.0,<3.0.0)
|
|
|
13
13
|
Requires-Dist: boto3 (>=1.39.8,<2.0.0)
|
|
14
14
|
Requires-Dist: click (>=8.1.7,<9.0.0)
|
|
15
15
|
Requires-Dist: codemie-plugins (>=0.1.123,<0.2.0)
|
|
16
|
-
Requires-Dist: codemie-sdk-python (==0.1.
|
|
16
|
+
Requires-Dist: codemie-sdk-python (==0.1.161)
|
|
17
17
|
Requires-Dist: pytest (>=8.4.1,<9.0.0)
|
|
18
18
|
Requires-Dist: pytest-playwright (>=0.7.0,<0.8.0)
|
|
19
19
|
Requires-Dist: pytest-reportportal (>=5.5.2,<6.0.0)
|
|
@@ -78,7 +78,8 @@ codemie_test_harness/tests/integrations/user/test_default_integrations.py,sha256
|
|
|
78
78
|
codemie_test_harness/tests/integrations/user/test_user_integrations.py,sha256=lGOoyGyKby1vOvXbz9de-PfhS0eUEX6vS7tg6vixtEE,8120
|
|
79
79
|
codemie_test_harness/tests/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
80
80
|
codemie_test_harness/tests/llm/assistants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
81
|
-
codemie_test_harness/tests/llm/assistants/
|
|
81
|
+
codemie_test_harness/tests/llm/assistants/test_lite_llm.py,sha256=-X6QMjFw1wuTWQ1vTLM-Ae_Ha9jLCCHlFY7LgUttqHM,3485
|
|
82
|
+
codemie_test_harness/tests/llm/assistants/test_llm.py,sha256=rpS-rsRqR13HPKPDeT_PvgnlSg1_KtbXTAzQpfShL8E,3531
|
|
82
83
|
codemie_test_harness/tests/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
83
84
|
codemie_test_harness/tests/providers/test_providers_endpoints.py,sha256=SfZVCaYcsk_mG2b9zVu7w2wOY54loQHdmRS8eK5PNo4,8120
|
|
84
85
|
codemie_test_harness/tests/search/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
@@ -220,7 +221,7 @@ codemie_test_harness/tests/ui/test_workflow_templates.py,sha256=pVuF98d3eEfinb5j
|
|
|
220
221
|
codemie_test_harness/tests/ui/test_workflows.py,sha256=a2VY8BAsw3Po7e10r4g7S798GhpA4KYh2ZjnYEhU1PY,3664
|
|
221
222
|
codemie_test_harness/tests/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
222
223
|
codemie_test_harness/tests/utils/assistant_utils.py,sha256=jy3dFF4ZiT22Wippl1a5jIEAAyJ71P0ss8AIHPefz6k,6511
|
|
223
|
-
codemie_test_harness/tests/utils/aws_parameters_store.py,sha256=
|
|
224
|
+
codemie_test_harness/tests/utils/aws_parameters_store.py,sha256=1iwqGN5DbUTrJcCmDM2wLnNkak59SjxWyYFFX-gSBAk,23337
|
|
224
225
|
codemie_test_harness/tests/utils/base_utils.py,sha256=tfishCUxO3iEuasWOifoF9_fXspm4uIHS26Ryqu-NxA,5998
|
|
225
226
|
codemie_test_harness/tests/utils/client_factory.py,sha256=Yyg2iXe7g7fIfIUbOH8z_8qgVo_lB-nYLOfCV5ONXFw,641
|
|
226
227
|
codemie_test_harness/tests/utils/constants.py,sha256=ZNyM5wERHFN-c8TCvBcxCdFf0As9TOpr22YvLCMHArE,1116
|
|
@@ -347,7 +348,7 @@ codemie_test_harness/tests/workflow/virtual_assistant_tools/servicenow/__init__.
|
|
|
347
348
|
codemie_test_harness/tests/workflow/virtual_assistant_tools/servicenow/test_workflow_with_servicenow_tools.py,sha256=vq6tucNBxiNIQSmIj_pYiiPm0lipU9X3kzeCd6xEbRM,966
|
|
348
349
|
codemie_test_harness/tests/workflow/virtual_assistant_tools/vcs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
349
350
|
codemie_test_harness/tests/workflow/virtual_assistant_tools/vcs/test_workflow_with_vcs_tools.py,sha256=uD2qs361j6Egp4UumfoQ4gC24-NioXfiW0IF53N9hVA,1175
|
|
350
|
-
codemie_test_harness-0.1.
|
|
351
|
-
codemie_test_harness-0.1.
|
|
352
|
-
codemie_test_harness-0.1.
|
|
353
|
-
codemie_test_harness-0.1.
|
|
351
|
+
codemie_test_harness-0.1.161.dist-info/METADATA,sha256=8CsQCb2vq2XdzkZC8ZpOW8-PMgPMrW6mdpYPWszjG_Q,8998
|
|
352
|
+
codemie_test_harness-0.1.161.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
353
|
+
codemie_test_harness-0.1.161.dist-info/entry_points.txt,sha256=n98t-EOM5M1mnMl_j2X4siyeO9zr0WD9a5LF7JyElIM,73
|
|
354
|
+
codemie_test_harness-0.1.161.dist-info/RECORD,,
|
|
File without changes
|
{codemie_test_harness-0.1.160.dist-info → codemie_test_harness-0.1.161.dist-info}/entry_points.txt
RENAMED
|
File without changes
|