codemie-test-harness 0.1.160__py3-none-any.whl → 0.1.162__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.

@@ -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
- client, assistant_utils, model_type, similarity_check
39
+ llm_utils, assistant_utils, model_type, similarity_check
40
40
  ):
41
41
  assert_that(
42
- [row.base_name for row in client.llms.list()],
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
- client, assistant_utils, model_type, similarity_check
60
+ llm_utils, assistant_utils, model_type, similarity_check
61
61
  ):
62
62
  assert_that(
63
- [row.base_name for row in client.llms.list()],
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
- client, assistant_utils, model_type, similarity_check
81
+ llm_utils, assistant_utils, model_type, similarity_check
82
82
  ):
83
83
  assert_that(
84
- [row.base_name for row in client.llms.list()],
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
  )
@@ -3,6 +3,14 @@ import uuid
3
3
  from datetime import datetime
4
4
 
5
5
  import pytest
6
+ from codemie_sdk.models.assistant import (
7
+ AssistantChatRequest,
8
+ ToolKitDetails,
9
+ ToolDetails,
10
+ ChatMessage,
11
+ ChatRole,
12
+ )
13
+ from codemie_sdk.models.task import BackgroundTaskEntity
6
14
  from hamcrest import (
7
15
  assert_that,
8
16
  has_length,
@@ -13,14 +21,6 @@ from hamcrest import (
13
21
  is_not,
14
22
  )
15
23
 
16
- from codemie_sdk.models.assistant import (
17
- AssistantChatRequest,
18
- ToolKitDetails,
19
- ToolDetails,
20
- ChatMessage,
21
- ChatRole,
22
- )
23
- from codemie_sdk.models.task import BackgroundTaskEntity
24
24
  from codemie_test_harness.tests import PROJECT
25
25
 
26
26
 
@@ -135,5 +135,12 @@ def test_get_task_not_found(assistant_utils):
135
135
  """Test getting a non-existent task."""
136
136
  with pytest.raises(Exception) as exc_info:
137
137
  assistant_utils.get_tasks("non-existent-task-id")
138
- # assert "404" in str(exc_info.value) or "not found" in str(exc_info.value).lower(), Need to fix API to produce error
139
- assert_that(str(exc_info.value), contains_string("500"))
138
+
139
+ assert_that(exc_info.value.response.status_code, equal_to(404))
140
+
141
+ assert_that(
142
+ exc_info.value.response.json()["error"]["details"],
143
+ equal_to(
144
+ "The task with ID [non-existent-task-id] could not be found in the system."
145
+ ),
146
+ )
@@ -1,6 +1,7 @@
1
1
  from time import sleep
2
2
 
3
3
  import pytest
4
+ from codemie_sdk.models.workflow import ExecutionStatus, WorkflowMode
4
5
  from hamcrest import (
5
6
  assert_that,
6
7
  equal_to,
@@ -12,10 +13,8 @@ from hamcrest import (
12
13
  is_not,
13
14
  )
14
15
 
15
- from codemie_sdk.models.workflow import ExecutionStatus, WorkflowMode
16
16
  from codemie_test_harness.tests import PROJECT
17
17
  from codemie_test_harness.tests.utils.base_utils import get_random_name
18
-
19
18
  from codemie_test_harness.tests.utils.yaml_utils import (
20
19
  AssistantModel,
21
20
  StateModel,
@@ -133,14 +132,16 @@ def test_run_workflow(workflow_utils, search_utils, test_workflow: str):
133
132
  )
134
133
 
135
134
 
136
- @pytest.mark.skip(reason="Bug: https://jiraeu.epam.com/browse/EPMCDME-7883")
137
135
  def test_list_executions_nonexistent_workflow(search_utils):
138
136
  with pytest.raises(Exception) as exc_info:
139
137
  search_utils.list_workflow_executions("non-existent-id")
140
138
 
139
+ assert_that(exc_info.value.response.status_code, equal_to(404))
141
140
  assert_that(
142
- str(exc_info.value).lower(),
143
- contains_string("No workflows found with id non-existent-id"),
141
+ str(exc_info.value.response.json()["error"]["details"]),
142
+ equal_to(
143
+ "The workflow with ID [non-existent-id] could not be found in the system."
144
+ ),
144
145
  )
145
146
 
146
147
 
@@ -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.160
3
+ Version: 0.1.162
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.160)
16
+ Requires-Dist: codemie-sdk-python (==0.1.162)
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/test_llm.py,sha256=06oFZikafBC8YrFxgm5RJqIw7or0h8CDWroZ-LvX1Dw,3495
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
@@ -91,9 +92,9 @@ codemie_test_harness/tests/service/test_assistant_service.py,sha256=NSQUNMv_Dk7x
91
92
  codemie_test_harness/tests/service/test_datasource_service.py,sha256=_mER2wtvZr4SqCd6rJnRBG6q6-kDtS63xY5ZsDCdNt4,15444
92
93
  codemie_test_harness/tests/service/test_integration_service.py,sha256=ODQJhBRELTIy75aFpZt_-axJHbB1wwrX6oz7JGNjtus,7529
93
94
  codemie_test_harness/tests/service/test_llm_service.py,sha256=aBJz6Z82JzeWeTuhHTVaRm1Cm7lJMKGRMQ1f6rIalTQ,543
94
- codemie_test_harness/tests/service/test_task_service.py,sha256=kxbZBbxyTg4YsRhteMBEoaqiLwbcF9h03fQ6e9m9xTY,4562
95
+ codemie_test_harness/tests/service/test_task_service.py,sha256=q2RaZbNooWraONLFCbebYqdgecs4aXUCbA9HOTzUIGw,4677
95
96
  codemie_test_harness/tests/service/test_user_service.py,sha256=NqSsxOLTGg7p7juHLFP6StEs2Qx_wfct9R7F83pe2JU,1135
96
- codemie_test_harness/tests/service/test_workflow_execution_service.py,sha256=dUNon4lHbzPIVM5Y9jwZw7PNTK1c9g-X4m98XQtUYDA,5356
97
+ codemie_test_harness/tests/service/test_workflow_execution_service.py,sha256=pHV7WXvQKzpw0wMn6aHVZ01g7yZupmU5NXLVE9rIKjo,5419
97
98
  codemie_test_harness/tests/service/test_workflow_service.py,sha256=QyxtorhaCI1oE2D1OLx7X7jAlBv0kwwFpQztvV1nUus,8152
98
99
  codemie_test_harness/tests/test_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
99
100
  codemie_test_harness/tests/test_data/ado_test_plan_tools_test_data.py,sha256=Al5u4HNfrcoj-b072uEGsqUqjKqwXLGJXKQ0QeJT3PI,5778
@@ -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=AUAJkK9XBx4IPfV8Gr8fn00yERrQFMjm7-2CXldOKU0,22734
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.160.dist-info/METADATA,sha256=aWQcHiEkFpoo7Fd1zEJOjpSIS-enVOPlQmrG49ZRj7c,8998
351
- codemie_test_harness-0.1.160.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
352
- codemie_test_harness-0.1.160.dist-info/entry_points.txt,sha256=n98t-EOM5M1mnMl_j2X4siyeO9zr0WD9a5LF7JyElIM,73
353
- codemie_test_harness-0.1.160.dist-info/RECORD,,
351
+ codemie_test_harness-0.1.162.dist-info/METADATA,sha256=P1Q4a4YnD6COFOY-PfS_-GBgT9mPzD-w_9kIBheM_gQ,8998
352
+ codemie_test_harness-0.1.162.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
353
+ codemie_test_harness-0.1.162.dist-info/entry_points.txt,sha256=n98t-EOM5M1mnMl_j2X4siyeO9zr0WD9a5LF7JyElIM,73
354
+ codemie_test_harness-0.1.162.dist-info/RECORD,,