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

Files changed (21) hide show
  1. codemie_test_harness/tests/assistant/tools/report_portal/__init__.py +0 -0
  2. codemie_test_harness/tests/assistant/tools/report_portal/test_assistant_report_portal_tools.py +32 -0
  3. codemie_test_harness/tests/conftest.py +11 -0
  4. codemie_test_harness/tests/enums/tools.py +14 -0
  5. codemie_test_harness/tests/integrations/project/test_default_integrations.py +44 -1
  6. codemie_test_harness/tests/integrations/project/test_project_integrations.py +7 -0
  7. codemie_test_harness/tests/integrations/user/test_default_integrations.py +44 -0
  8. codemie_test_harness/tests/integrations/user/test_user_integrations.py +7 -0
  9. codemie_test_harness/tests/test_data/direct_tools/report_portal_tools_test_data.py +1235 -0
  10. codemie_test_harness/tests/test_data/integrations_test_data.py +16 -0
  11. codemie_test_harness/tests/test_data/report_portal_tools_test_data.py +520 -0
  12. codemie_test_harness/tests/utils/aws_parameters_store.py +28 -0
  13. codemie_test_harness/tests/workflow/assistant_tools/report_portal/__init__.py +0 -0
  14. codemie_test_harness/tests/workflow/assistant_tools/report_portal/test_workflow_with_assistant_with_report_portal_tools.py +38 -0
  15. codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_report_portal_tools.py +115 -0
  16. codemie_test_harness/tests/workflow/virtual_assistant_tools/report_portal/__init__.py +0 -0
  17. codemie_test_harness/tests/workflow/virtual_assistant_tools/report_portal/test_workflow_with_report_portal_tool.py +39 -0
  18. {codemie_test_harness-0.1.158.dist-info → codemie_test_harness-0.1.159.dist-info}/METADATA +2 -2
  19. {codemie_test_harness-0.1.158.dist-info → codemie_test_harness-0.1.159.dist-info}/RECORD +21 -12
  20. {codemie_test_harness-0.1.158.dist-info → codemie_test_harness-0.1.159.dist-info}/WHEEL +0 -0
  21. {codemie_test_harness-0.1.158.dist-info → codemie_test_harness-0.1.159.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,32 @@
1
+ import pytest
2
+
3
+ from codemie_test_harness.tests.test_data.report_portal_tools_test_data import (
4
+ rp_test_data,
5
+ )
6
+
7
+
8
+ @pytest.mark.assistant
9
+ @pytest.mark.report_portal
10
+ @pytest.mark.regression
11
+ @pytest.mark.parametrize(
12
+ "toolkit,tool_name,prompt,expected_response",
13
+ rp_test_data,
14
+ ids=[f"{row[0]}_{row[1]}" for row in rp_test_data],
15
+ )
16
+ def test_assistant_with_report_portal_tools(
17
+ assistant,
18
+ assistant_utils,
19
+ report_portal_integration,
20
+ similarity_check,
21
+ toolkit,
22
+ tool_name,
23
+ prompt,
24
+ expected_response,
25
+ ):
26
+ assistant = assistant(
27
+ toolkit,
28
+ tool_name,
29
+ settings=report_portal_integration,
30
+ )
31
+ response = assistant_utils.ask_assistant(assistant, prompt)
32
+ similarity_check.check_similarity(response, expected_response)
@@ -374,6 +374,17 @@ def keycloak_integration(integration_utils):
374
374
  integration_utils.delete_integration(integration)
375
375
 
376
376
 
377
+ @pytest.fixture(scope="module")
378
+ def report_portal_integration(integration_utils):
379
+ credential_values = CredentialsUtil.report_portal_credentials()
380
+ integration = integration_utils.create_integration(
381
+ CredentialTypes.REPORT_PORTAL, credential_values
382
+ )
383
+ yield integration
384
+ if integration:
385
+ integration_utils.delete_integration(integration)
386
+
387
+
377
388
  @pytest.fixture(scope="function")
378
389
  def general_integration(integration_utils):
379
390
  created_integration: Optional[Integration] = None
@@ -20,6 +20,7 @@ class Toolkit(str, Enum):
20
20
  DATA_MANAGEMENT = "Data Management"
21
21
  SERVICENOW = "IT Service Management"
22
22
  ACCESS_MANAGEMENT = "Access Management"
23
+ REPORT_PORTAL = "Report Portal"
23
24
 
24
25
 
25
26
  class GitTool(str, Enum):
@@ -185,3 +186,16 @@ class AccessManagementTool(str, Enum):
185
186
  """Enum for Access Management tool names."""
186
187
 
187
188
  KEYCLOAK = "keycloak"
189
+
190
+
191
+ class ReportPortalTool(str, Enum):
192
+ """Enum for Report Portal tool names."""
193
+
194
+ GET_EXTENDED_LAUNCH_DATA_AS_RAW = "get_extended_launch_data_as_raw"
195
+ GET_LAUNCH_DETAILS = "get_launch_details"
196
+ GET_ALL_LAUNCHES = "get_all_launches"
197
+ FIND_TEST_ITEM_BY_ID = "find_test_item_by_id"
198
+ GET_TEST_ITEMS_FOR_LAUNCH = "get_test_items_for_launch"
199
+ GET_LOGS_FOR_TEST_ITEM = "get_logs_for_test_item"
200
+ GET_USER_INFORMATION = "get_user_information"
201
+ GET_DASHBOARD_DATA = "get_dashboard_data"
@@ -13,6 +13,7 @@ from codemie_test_harness.tests.enums.tools import (
13
13
  CodeBaseTool,
14
14
  CloudTool,
15
15
  AccessManagementTool,
16
+ ReportPortalTool,
16
17
  )
17
18
  from codemie_test_harness.tests.test_data.ado_test_plan_tools_test_data import (
18
19
  ado_test_plan_get_test_data,
@@ -36,6 +37,9 @@ from codemie_test_harness.tests.test_data.pm_tools_test_data import (
36
37
  JIRA_TOOL_PROMPT,
37
38
  RESPONSE_FOR_JIRA_TOOL,
38
39
  )
40
+ from codemie_test_harness.tests.test_data.report_portal_tools_test_data import (
41
+ rp_test_data,
42
+ )
39
43
  from codemie_test_harness.tests.utils.aws_parameters_store import CredentialsUtil
40
44
  from codemie_test_harness.tests.utils.constants import test_project_name
41
45
 
@@ -314,7 +318,6 @@ def test_assistant_with_default_integration_email(
314
318
  @pytest.mark.project_integration
315
319
  @pytest.mark.default_integration
316
320
  @pytest.mark.regression
317
- @pytest.mark.regression
318
321
  def test_assistant_with_default_integration_keycloak(
319
322
  general_integration,
320
323
  integration_utils,
@@ -344,3 +347,43 @@ def test_assistant_with_default_integration_keycloak(
344
347
  response = assistant_utils.ask_assistant(keycloak_assistant, KEYCLOAK_TOOL_PROMPT)
345
348
 
346
349
  similarity_check.check_similarity(response, KEYCLOAK_TOOL_RESPONSE)
350
+
351
+
352
+ @pytest.mark.assistant
353
+ @pytest.mark.report_portal
354
+ @pytest.mark.integration
355
+ @pytest.mark.project_integration
356
+ @pytest.mark.default_integration
357
+ @pytest.mark.regression
358
+ def test_assistant_with_default_integration_report_portal(
359
+ general_integration,
360
+ integration_utils,
361
+ assistant,
362
+ assistant_utils,
363
+ similarity_check,
364
+ ):
365
+ prompt = rp_test_data[7][2]
366
+ expected_response = rp_test_data[7][3]
367
+
368
+ # delete existing integrations of the same type
369
+ for integration_type in IntegrationType:
370
+ integration_utils.delete_integrations_by_type(
371
+ integration_type, CredentialTypes.REPORT_PORTAL, test_project_name
372
+ )
373
+ # create a new integration
374
+ general_integration(
375
+ integration_type=IntegrationType.PROJECT,
376
+ credential_type=CredentialTypes.REPORT_PORTAL,
377
+ credential_values=CredentialsUtil.report_portal_credentials(),
378
+ project_name=test_project_name,
379
+ )
380
+ # create an assistant
381
+ report_portal_assistant = assistant(
382
+ Toolkit.REPORT_PORTAL,
383
+ ReportPortalTool.GET_DASHBOARD_DATA,
384
+ project_name=test_project_name,
385
+ )
386
+
387
+ response = assistant_utils.ask_assistant(report_portal_assistant, prompt)
388
+
389
+ similarity_check.check_similarity(response, expected_response)
@@ -50,6 +50,7 @@ from codemie_test_harness.tests.utils.base_utils import (
50
50
  f"Project integration: {CredentialTypes.SERVICE_NOW}",
51
51
  f"Project integration: {CredentialTypes.KUBERNETES}",
52
52
  f"Project integration: {CredentialTypes.KEYCLOAK}",
53
+ f"Project integration: {CredentialTypes.REPORT_PORTAL}",
53
54
  ],
54
55
  )
55
56
  def test_integration_created(
@@ -96,6 +97,7 @@ def test_integration_created(
96
97
  f"Project integration: {CredentialTypes.EMAIL}",
97
98
  f"Project integration: {CredentialTypes.SERVICE_NOW}",
98
99
  f"Project integration: {CredentialTypes.KUBERNETES}",
100
+ f"Project integration: {CredentialTypes.REPORT_PORTAL}",
99
101
  ],
100
102
  )
101
103
  def test_integration_after_creation(
@@ -158,6 +160,7 @@ def test_integration_after_creation(
158
160
  f"Project integration: {CredentialTypes.SERVICE_NOW}",
159
161
  f"Project integration: {CredentialTypes.KUBERNETES}",
160
162
  f"Project integration: {CredentialTypes.KEYCLOAK}",
163
+ f"Project integration: {CredentialTypes.REPORT_PORTAL}",
161
164
  ],
162
165
  )
163
166
  def test_update_integration(
@@ -214,6 +217,7 @@ def test_update_integration(
214
217
  f"Project integration: {CredentialTypes.CONFLUENCE}",
215
218
  f"Project integration: {CredentialTypes.SERVICE_NOW}",
216
219
  f"Project integration: {CredentialTypes.KUBERNETES}",
220
+ f"Project integration: {CredentialTypes.REPORT_PORTAL}",
217
221
  ],
218
222
  )
219
223
  def test_integration_with_invalid_credentials(
@@ -269,6 +273,7 @@ def test_integration_with_invalid_credentials(
269
273
  f"Project integration: {CredentialTypes.EMAIL}",
270
274
  f"Project integration: {CredentialTypes.SERVICE_NOW}",
271
275
  f"Project integration: {CredentialTypes.KUBERNETES}",
276
+ f"Project integration: {CredentialTypes.REPORT_PORTAL}",
272
277
  ],
273
278
  )
274
279
  def test_integration_during_creation(credential_type, credentials, integration_utils):
@@ -305,6 +310,7 @@ def test_integration_during_creation(credential_type, credentials, integration_u
305
310
  f"Project integration: {CredentialTypes.CONFLUENCE}",
306
311
  f"Project integration: {CredentialTypes.SERVICE_NOW}",
307
312
  f"Project integration: {CredentialTypes.KUBERNETES}",
313
+ f"Project integration: {CredentialTypes.REPORT_PORTAL}",
308
314
  ],
309
315
  )
310
316
  def test_integration_during_creation_with_invalid_credentials(
@@ -352,6 +358,7 @@ def test_integration_during_creation_with_invalid_credentials(
352
358
  f"Project integration: {CredentialTypes.SERVICE_NOW}",
353
359
  f"Project integration: {CredentialTypes.KUBERNETES}",
354
360
  f"Project integration: {CredentialTypes.KEYCLOAK}",
361
+ f"Project integration: {CredentialTypes.REPORT_PORTAL}",
355
362
  ],
356
363
  )
357
364
  def test_delete_integration(
@@ -13,6 +13,7 @@ from codemie_test_harness.tests.enums.tools import (
13
13
  CodeBaseTool,
14
14
  CloudTool,
15
15
  AccessManagementTool,
16
+ ReportPortalTool,
16
17
  )
17
18
  from codemie_test_harness.tests.test_data.ado_test_plan_tools_test_data import (
18
19
  ado_test_plan_get_test_data,
@@ -36,6 +37,9 @@ from codemie_test_harness.tests.test_data.pm_tools_test_data import (
36
37
  JIRA_TOOL_PROMPT,
37
38
  RESPONSE_FOR_JIRA_TOOL,
38
39
  )
40
+ from codemie_test_harness.tests.test_data.report_portal_tools_test_data import (
41
+ rp_test_data,
42
+ )
39
43
  from codemie_test_harness.tests.utils.aws_parameters_store import CredentialsUtil
40
44
  from codemie_test_harness.tests.utils.constants import test_project_name
41
45
 
@@ -343,3 +347,43 @@ def test_assistant_with_default_integration_keycloak(
343
347
  response = assistant_utils.ask_assistant(keycloak_assistant, KEYCLOAK_TOOL_PROMPT)
344
348
 
345
349
  similarity_check.check_similarity(response, KEYCLOAK_TOOL_RESPONSE)
350
+
351
+
352
+ @pytest.mark.assistant
353
+ @pytest.mark.report_portal
354
+ @pytest.mark.integration
355
+ @pytest.mark.user_integration
356
+ @pytest.mark.default_integration
357
+ @pytest.mark.regression
358
+ def test_assistant_with_default_integration_report_portal(
359
+ general_integration,
360
+ integration_utils,
361
+ assistant,
362
+ assistant_utils,
363
+ similarity_check,
364
+ ):
365
+ prompt = rp_test_data[7][2]
366
+ expected_response = rp_test_data[7][3]
367
+
368
+ # delete existing integrations of the same type
369
+ for integration_type in IntegrationType:
370
+ integration_utils.delete_integrations_by_type(
371
+ integration_type, CredentialTypes.REPORT_PORTAL, test_project_name
372
+ )
373
+ # create a new integration
374
+ general_integration(
375
+ integration_type=IntegrationType.USER,
376
+ credential_type=CredentialTypes.REPORT_PORTAL,
377
+ credential_values=CredentialsUtil.report_portal_credentials(),
378
+ project_name=test_project_name,
379
+ )
380
+ # create an assistant
381
+ report_portal_assistant = assistant(
382
+ Toolkit.REPORT_PORTAL,
383
+ ReportPortalTool.GET_DASHBOARD_DATA,
384
+ project_name=test_project_name,
385
+ )
386
+
387
+ response = assistant_utils.ask_assistant(report_portal_assistant, prompt)
388
+
389
+ similarity_check.check_similarity(response, expected_response)
@@ -51,6 +51,7 @@ from codemie_test_harness.tests.utils.base_utils import (
51
51
  f"User integration: {CredentialTypes.SERVICE_NOW}",
52
52
  f"User integration: {CredentialTypes.KUBERNETES}",
53
53
  f"User integration: {CredentialTypes.KEYCLOAK}",
54
+ f"User integration: {CredentialTypes.REPORT_PORTAL}",
54
55
  ],
55
56
  )
56
57
  def test_integration_created(
@@ -98,6 +99,7 @@ def test_integration_created(
98
99
  f"User integration: {CredentialTypes.EMAIL}",
99
100
  f"User integration: {CredentialTypes.SERVICE_NOW}",
100
101
  f"User integration: {CredentialTypes.KUBERNETES}",
102
+ f"User integration: {CredentialTypes.REPORT_PORTAL}",
101
103
  ],
102
104
  )
103
105
  def test_integration_after_creation(
@@ -160,6 +162,7 @@ def test_integration_after_creation(
160
162
  f"User integration: {CredentialTypes.SERVICE_NOW}",
161
163
  f"User integration: {CredentialTypes.KUBERNETES}",
162
164
  f"User integration: {CredentialTypes.KEYCLOAK}",
165
+ f"User integration: {CredentialTypes.REPORT_PORTAL}",
163
166
  ],
164
167
  )
165
168
  def test_update_integration(
@@ -217,6 +220,7 @@ def test_update_integration(
217
220
  f"User integration: {CredentialTypes.CONFLUENCE}",
218
221
  f"User integration: {CredentialTypes.SERVICE_NOW}",
219
222
  f"User integration: {CredentialTypes.KUBERNETES}",
223
+ f"User integration: {CredentialTypes.REPORT_PORTAL}",
220
224
  ],
221
225
  )
222
226
  def test_integration_with_invalid_credentials(
@@ -272,6 +276,7 @@ def test_integration_with_invalid_credentials(
272
276
  f"User integration: {CredentialTypes.EMAIL}",
273
277
  f"User integration: {CredentialTypes.SERVICE_NOW}",
274
278
  f"User integration: {CredentialTypes.KUBERNETES}",
279
+ f"User integration: {CredentialTypes.REPORT_PORTAL}",
275
280
  ],
276
281
  )
277
282
  def test_integration_during_creation(credential_type, credentials, integration_utils):
@@ -308,6 +313,7 @@ def test_integration_during_creation(credential_type, credentials, integration_u
308
313
  f"User integration: {CredentialTypes.CONFLUENCE}",
309
314
  f"User integration: {CredentialTypes.SERVICE_NOW}",
310
315
  f"User integration: {CredentialTypes.KUBERNETES}",
316
+ f"User integration: {CredentialTypes.REPORT_PORTAL}",
311
317
  ],
312
318
  )
313
319
  def test_integration_during_creation_with_invalid_credentials(
@@ -355,6 +361,7 @@ def test_integration_during_creation_with_invalid_credentials(
355
361
  f"User integration: {CredentialTypes.SERVICE_NOW}",
356
362
  f"User integration: {CredentialTypes.KUBERNETES}",
357
363
  f"User integration: {CredentialTypes.KEYCLOAK}",
364
+ f"User integration: {CredentialTypes.REPORT_PORTAL}",
358
365
  ],
359
366
  )
360
367
  def test_delete_integration(