codemie-test-harness 0.1.163__py3-none-any.whl → 0.1.165__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/__init__.py +2 -1
- codemie_test_harness/tests/assistant/datasource/test_confluence_datasource.py +2 -2
- codemie_test_harness/tests/assistant/datasource/test_jira_datasource.py +2 -2
- codemie_test_harness/tests/assistant/default_integrations/test_default_integrations_for_tool.py +11 -11
- codemie_test_harness/tests/assistant/default_integrations/test_default_integrations_for_tool_kit.py +11 -11
- codemie_test_harness/tests/assistant/default_integrations/test_default_integrations_for_tool_with_datasource.py +14 -14
- codemie_test_harness/tests/assistant/tools/ado/test_assistant_for_ado_test_plan_tools.py +3 -3
- codemie_test_harness/tests/assistant/tools/ado/test_assistant_for_ado_wiki_tools.py +3 -3
- codemie_test_harness/tests/assistant/tools/ado/test_assistant_for_ado_work_item_tools.py +3 -3
- codemie_test_harness/tests/assistant/tools/datamanagement/test_assistant_with_data_management_tools.py +3 -3
- codemie_test_harness/tests/assistant/tools/mcp/test_cli_mcp_server.py +2 -2
- codemie_test_harness/tests/assistant/tools/notification/test_assistant_notification_tools.py +3 -3
- codemie_test_harness/tests/assistant/tools/project_management/test_assistant_pm_tools.py +5 -5
- codemie_test_harness/tests/conftest.py +73 -45
- codemie_test_harness/tests/e2e/test_e2e.py +5 -5
- codemie_test_harness/tests/integrations/project/test_default_integrations.py +7 -7
- codemie_test_harness/tests/integrations/user/test_default_integrations.py +7 -7
- codemie_test_harness/tests/llm/assistants/test_lite_llm.py +3 -3
- codemie_test_harness/tests/search/test_search_datasource.py +2 -2
- codemie_test_harness/tests/search/test_search_integration.py +3 -3
- codemie_test_harness/tests/service/test_datasource_service.py +12 -12
- codemie_test_harness/tests/test_data/cloud_tools_test_data.py +5 -5
- codemie_test_harness/tests/test_data/codebase_tools_test_data.py +3 -3
- codemie_test_harness/tests/test_data/direct_tools/cloud_tools_test_data.py +5 -5
- codemie_test_harness/tests/test_data/direct_tools/file_management_tools_test_data.py +5 -1
- codemie_test_harness/tests/test_data/integrations_test_data.py +48 -48
- codemie_test_harness/tests/test_data/llm_test_data.py +1 -1
- codemie_test_harness/tests/test_data/notification_tools_test_data.py +2 -6
- codemie_test_harness/tests/test_data/report_portal_tools_test_data.py +4 -220
- codemie_test_harness/tests/test_data/vcs_tools_test_data.py +8 -5
- codemie_test_harness/tests/utils/aws_parameters_store.py +0 -560
- codemie_test_harness/tests/utils/base_utils.py +2 -2
- codemie_test_harness/tests/utils/client_factory.py +11 -9
- codemie_test_harness/tests/utils/credentials_manager.py +1358 -0
- codemie_test_harness/tests/utils/datasource_utils.py +7 -6
- codemie_test_harness/tests/utils/gitbud_utils.py +4 -4
- codemie_test_harness/tests/utils/notification_utils.py +6 -6
- codemie_test_harness/tests/workflow/assistant_tools/data_management/test_workflow_with_assistant_with_data_management_tools.py +3 -3
- codemie_test_harness/tests/workflow/assistant_tools/default_integrations/test_default_integrations_for_tool.py +11 -11
- codemie_test_harness/tests/workflow/assistant_tools/default_integrations/test_default_integrations_for_tool_kit.py +11 -11
- codemie_test_harness/tests/workflow/assistant_tools/default_integrations/test_default_integrations_for_tool_with_datasource.py +14 -14
- codemie_test_harness/tests/workflow/direct_tools_calling/default_integrations/test_default_integrations_for_tool.py +11 -11
- codemie_test_harness/tests/workflow/direct_tools_calling/default_integrations/test_default_integrations_for_tool_kit.py +11 -11
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_codebase_tools.py +7 -7
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_data_management_tools_elastic.py +4 -4
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_data_management_tools_sql.py +4 -4
- codemie_test_harness/tests/workflow/virtual_assistant_tools/codebase/test_workflow_with_codebase_tools.py +2 -2
- codemie_test_harness/tests/workflow/virtual_assistant_tools/data_management/test_workflow_with_data_management_tools.py +3 -3
- codemie_test_harness/tests/workflow/virtual_assistant_tools/default_integrations/test_default_integrations_for_tool.py +11 -11
- codemie_test_harness/tests/workflow/virtual_assistant_tools/default_integrations/test_default_integrations_for_tool_kit.py +11 -11
- codemie_test_harness/tests/workflow/virtual_assistant_tools/default_integrations/test_default_integrations_for_tool_with_datasource.py +14 -14
- {codemie_test_harness-0.1.163.dist-info → codemie_test_harness-0.1.165.dist-info}/METADATA +2 -2
- {codemie_test_harness-0.1.163.dist-info → codemie_test_harness-0.1.165.dist-info}/RECORD +55 -54
- {codemie_test_harness-0.1.163.dist-info → codemie_test_harness-0.1.165.dist-info}/WHEEL +0 -0
- {codemie_test_harness-0.1.163.dist-info → codemie_test_harness-0.1.165.dist-info}/entry_points.txt +0 -0
|
@@ -29,7 +29,7 @@ from codemie_test_harness.tests.test_data.google_datasource_test_data import (
|
|
|
29
29
|
GOOGLE_DOC_URL,
|
|
30
30
|
)
|
|
31
31
|
from codemie_test_harness.tests.utils.assistant_utils import AssistantUtils
|
|
32
|
-
from codemie_test_harness.tests.utils.
|
|
32
|
+
from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
|
|
33
33
|
from codemie_test_harness.tests.utils.base_utils import get_random_name, wait_for_entity
|
|
34
34
|
from codemie_test_harness.tests.utils.client_factory import get_client
|
|
35
35
|
from codemie_test_harness.tests.utils.constants import TESTS_PATH
|
|
@@ -60,6 +60,33 @@ from codemie_test_harness.tests.utils.env_resolver import (
|
|
|
60
60
|
logger = setup_logger(__name__)
|
|
61
61
|
|
|
62
62
|
|
|
63
|
+
def cleanup_plugin_process(process):
|
|
64
|
+
"""Helper function to cleanly terminate a plugin process.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
process: The subprocess.Popen process to terminate
|
|
68
|
+
"""
|
|
69
|
+
if process and process.poll() is None: # Process is still running
|
|
70
|
+
logger.info(f"Terminating plugin process with PID: {process.pid}")
|
|
71
|
+
try:
|
|
72
|
+
process.terminate()
|
|
73
|
+
process.wait(timeout=10) # Wait up to 10 seconds for graceful shutdown
|
|
74
|
+
logger.info(
|
|
75
|
+
f"Successfully terminated plugin process with PID: {process.pid}"
|
|
76
|
+
)
|
|
77
|
+
except subprocess.TimeoutExpired:
|
|
78
|
+
logger.warning(
|
|
79
|
+
f"Plugin process {process.pid} did not terminate gracefully, forcing kill"
|
|
80
|
+
)
|
|
81
|
+
process.kill()
|
|
82
|
+
process.wait()
|
|
83
|
+
logger.info(f"Successfully killed plugin process with PID: {process.pid}")
|
|
84
|
+
except Exception as e:
|
|
85
|
+
logger.error(f"Error during plugin process cleanup: {e}")
|
|
86
|
+
else:
|
|
87
|
+
logger.info("Plugin process already terminated or not found")
|
|
88
|
+
|
|
89
|
+
|
|
63
90
|
def pytest_configure(config):
|
|
64
91
|
"""Pytest hook that runs before test collection starts.
|
|
65
92
|
|
|
@@ -200,9 +227,9 @@ def workflow_utils(client):
|
|
|
200
227
|
def git_utils():
|
|
201
228
|
"""Create GitBudUtils instance"""
|
|
202
229
|
return GitBudUtils(
|
|
203
|
-
url=
|
|
204
|
-
token=
|
|
205
|
-
project_id=
|
|
230
|
+
url=CredentialsManager.get_parameter("GITLAB_URL"),
|
|
231
|
+
token=CredentialsManager.get_parameter("GITLAB_TOKEN"),
|
|
232
|
+
project_id=CredentialsManager.get_parameter("GITLAB_PROJECT_ID"),
|
|
206
233
|
)
|
|
207
234
|
|
|
208
235
|
|
|
@@ -230,7 +257,7 @@ def conversation_utils(client):
|
|
|
230
257
|
def git_integration(integration_utils):
|
|
231
258
|
integration = integration_utils.create_integration(
|
|
232
259
|
credential_type=CredentialTypes.GIT,
|
|
233
|
-
credential_values=
|
|
260
|
+
credential_values=CredentialsManager.gitlab_credentials(),
|
|
234
261
|
)
|
|
235
262
|
yield integration
|
|
236
263
|
if integration:
|
|
@@ -241,7 +268,7 @@ def git_integration(integration_utils):
|
|
|
241
268
|
def github_integration(integration_utils):
|
|
242
269
|
integration = integration_utils.create_integration(
|
|
243
270
|
credential_type=CredentialTypes.GIT,
|
|
244
|
-
credential_values=
|
|
271
|
+
credential_values=CredentialsManager.github_credentials(),
|
|
245
272
|
)
|
|
246
273
|
yield integration
|
|
247
274
|
if integration:
|
|
@@ -252,7 +279,7 @@ def github_integration(integration_utils):
|
|
|
252
279
|
def gitlab_integration(integration_utils):
|
|
253
280
|
integration = integration_utils.create_integration(
|
|
254
281
|
credential_type=CredentialTypes.GIT,
|
|
255
|
-
credential_values=
|
|
282
|
+
credential_values=CredentialsManager.gitlab_credentials(),
|
|
256
283
|
)
|
|
257
284
|
yield integration
|
|
258
285
|
if integration:
|
|
@@ -263,11 +290,7 @@ def gitlab_integration(integration_utils):
|
|
|
263
290
|
def jira_integration(integration_utils):
|
|
264
291
|
integration = integration_utils.create_integration(
|
|
265
292
|
credential_type=CredentialTypes.JIRA,
|
|
266
|
-
credential_values=
|
|
267
|
-
CredentialValues(key="url", value=os.getenv("JIRA_URL")),
|
|
268
|
-
CredentialValues(key="name", value="test-token-name"),
|
|
269
|
-
CredentialValues(key="token", value=os.getenv("JIRA_TOKEN")),
|
|
270
|
-
],
|
|
293
|
+
credential_values=CredentialsManager.jira_credentials(),
|
|
271
294
|
)
|
|
272
295
|
yield integration
|
|
273
296
|
if integration:
|
|
@@ -278,7 +301,7 @@ def jira_integration(integration_utils):
|
|
|
278
301
|
def jira_cloud_integration(integration_utils):
|
|
279
302
|
integration = integration_utils.create_integration(
|
|
280
303
|
credential_type=CredentialTypes.JIRA,
|
|
281
|
-
credential_values=
|
|
304
|
+
credential_values=CredentialsManager.jira_cloud_credentials(),
|
|
282
305
|
)
|
|
283
306
|
yield integration
|
|
284
307
|
if integration:
|
|
@@ -289,11 +312,7 @@ def jira_cloud_integration(integration_utils):
|
|
|
289
312
|
def confluence_integration(integration_utils):
|
|
290
313
|
integration = integration_utils.create_integration(
|
|
291
314
|
credential_type=CredentialTypes.CONFLUENCE,
|
|
292
|
-
credential_values=
|
|
293
|
-
CredentialValues(key="url", value=os.getenv("CONFLUENCE_URL")),
|
|
294
|
-
CredentialValues(key="name", value="test-token-name"),
|
|
295
|
-
CredentialValues(key="token", value=os.getenv("CONFLUENCE_TOKEN")),
|
|
296
|
-
],
|
|
315
|
+
credential_values=CredentialsManager.confluence_credentials(),
|
|
297
316
|
)
|
|
298
317
|
yield integration
|
|
299
318
|
if integration:
|
|
@@ -304,7 +323,7 @@ def confluence_integration(integration_utils):
|
|
|
304
323
|
def confluence_cloud_integration(integration_utils):
|
|
305
324
|
integration = integration_utils.create_integration(
|
|
306
325
|
credential_type=CredentialTypes.CONFLUENCE,
|
|
307
|
-
credential_values=
|
|
326
|
+
credential_values=CredentialsManager.confluence_cloud_credentials(),
|
|
308
327
|
)
|
|
309
328
|
yield integration
|
|
310
329
|
if integration:
|
|
@@ -316,7 +335,7 @@ def filesystem_integration(integration_utils):
|
|
|
316
335
|
"""Create Filesystem integration"""
|
|
317
336
|
integration = integration_utils.create_integration(
|
|
318
337
|
credential_type=CredentialTypes.FILESYSTEM,
|
|
319
|
-
credential_values=
|
|
338
|
+
credential_values=CredentialsManager.file_system_credentials(),
|
|
320
339
|
)
|
|
321
340
|
yield integration
|
|
322
341
|
if integration:
|
|
@@ -325,7 +344,7 @@ def filesystem_integration(integration_utils):
|
|
|
325
344
|
|
|
326
345
|
@pytest.fixture(scope="module")
|
|
327
346
|
def open_api_integration(client, integration_utils):
|
|
328
|
-
credential_values =
|
|
347
|
+
credential_values = CredentialsManager.open_api_credentials(str(client.token))
|
|
329
348
|
integration = integration_utils.create_integration(
|
|
330
349
|
CredentialTypes.OPENAPI, credential_values
|
|
331
350
|
)
|
|
@@ -336,7 +355,7 @@ def open_api_integration(client, integration_utils):
|
|
|
336
355
|
|
|
337
356
|
@pytest.fixture(scope="module")
|
|
338
357
|
def email_integration(integration_utils):
|
|
339
|
-
credential_values =
|
|
358
|
+
credential_values = CredentialsManager.gmail_credentials()
|
|
340
359
|
integration = integration_utils.create_integration(
|
|
341
360
|
CredentialTypes.EMAIL, credential_values
|
|
342
361
|
)
|
|
@@ -347,7 +366,7 @@ def email_integration(integration_utils):
|
|
|
347
366
|
|
|
348
367
|
@pytest.fixture(scope="module")
|
|
349
368
|
def telegram_integration(integration_utils):
|
|
350
|
-
credential_values =
|
|
369
|
+
credential_values = CredentialsManager.telegram_credentials()
|
|
351
370
|
integration = integration_utils.create_integration(
|
|
352
371
|
CredentialTypes.TELEGRAM, credential_values
|
|
353
372
|
)
|
|
@@ -358,7 +377,7 @@ def telegram_integration(integration_utils):
|
|
|
358
377
|
|
|
359
378
|
@pytest.fixture(scope="module")
|
|
360
379
|
def service_now_integration(integration_utils):
|
|
361
|
-
credential_values =
|
|
380
|
+
credential_values = CredentialsManager.servicenow_credentials()
|
|
362
381
|
integration = integration_utils.create_integration(
|
|
363
382
|
CredentialTypes.SERVICE_NOW, credential_values
|
|
364
383
|
)
|
|
@@ -369,7 +388,7 @@ def service_now_integration(integration_utils):
|
|
|
369
388
|
|
|
370
389
|
@pytest.fixture(scope="module")
|
|
371
390
|
def keycloak_integration(integration_utils):
|
|
372
|
-
credential_values =
|
|
391
|
+
credential_values = CredentialsManager.keycloak_credentials()
|
|
373
392
|
integration = integration_utils.create_integration(
|
|
374
393
|
CredentialTypes.KEYCLOAK, credential_values
|
|
375
394
|
)
|
|
@@ -380,7 +399,7 @@ def keycloak_integration(integration_utils):
|
|
|
380
399
|
|
|
381
400
|
@pytest.fixture(scope="module")
|
|
382
401
|
def report_portal_integration(integration_utils):
|
|
383
|
-
credential_values =
|
|
402
|
+
credential_values = CredentialsManager.report_portal_credentials()
|
|
384
403
|
integration = integration_utils.create_integration(
|
|
385
404
|
CredentialTypes.REPORT_PORTAL, credential_values
|
|
386
405
|
)
|
|
@@ -423,14 +442,15 @@ def general_integration(integration_utils):
|
|
|
423
442
|
def code_datasource(
|
|
424
443
|
datasource_utils, gitlab_integration, github_integration, default_embedding_llm
|
|
425
444
|
):
|
|
445
|
+
git_env = CredentialsManager.get_parameter("GIT_ENV", "gitlab")
|
|
426
446
|
datasource = datasource_utils.create_code_datasource(
|
|
427
|
-
link=
|
|
428
|
-
if
|
|
429
|
-
else
|
|
430
|
-
branch="main" if
|
|
447
|
+
link=CredentialsManager.get_parameter("GITLAB_PROJECT")
|
|
448
|
+
if git_env == "gitlab"
|
|
449
|
+
else CredentialsManager.get_parameter("GITHUB_PROJECT"),
|
|
450
|
+
branch="main" if git_env == "gitlab" else "master",
|
|
431
451
|
embeddings_model=default_embedding_llm.base_name,
|
|
432
452
|
setting_id=gitlab_integration.id
|
|
433
|
-
if
|
|
453
|
+
if git_env == "gitlab"
|
|
434
454
|
else github_integration.id,
|
|
435
455
|
)
|
|
436
456
|
yield datasource
|
|
@@ -714,7 +734,7 @@ def filesystem_server(integration_utils):
|
|
|
714
734
|
key = str(uuid.uuid4())
|
|
715
735
|
logger.info(f"Plugin key: {key}")
|
|
716
736
|
|
|
717
|
-
credential_values =
|
|
737
|
+
credential_values = CredentialsManager.plugin_credentials(key)
|
|
718
738
|
settings = integration_utils.create_integration(
|
|
719
739
|
CredentialTypes.PLUGIN, credential_values
|
|
720
740
|
)
|
|
@@ -729,7 +749,7 @@ def filesystem_server(integration_utils):
|
|
|
729
749
|
"--plugin-key",
|
|
730
750
|
key,
|
|
731
751
|
"--plugin-engine-uri",
|
|
732
|
-
|
|
752
|
+
CredentialsManager.get_parameter("NATS_URL"),
|
|
733
753
|
"mcp",
|
|
734
754
|
"run",
|
|
735
755
|
"-s",
|
|
@@ -737,9 +757,11 @@ def filesystem_server(integration_utils):
|
|
|
737
757
|
"-e",
|
|
738
758
|
"filesystem=FILE_PATHS",
|
|
739
759
|
]
|
|
740
|
-
subprocess.Popen(command, env=env)
|
|
760
|
+
process = subprocess.Popen(command, env=env)
|
|
761
|
+
logger.info(f"Started filesystem server process with PID: {process.pid}")
|
|
741
762
|
sleep(10)
|
|
742
|
-
|
|
763
|
+
yield settings
|
|
764
|
+
cleanup_plugin_process(process)
|
|
743
765
|
|
|
744
766
|
|
|
745
767
|
@pytest.fixture(scope="session")
|
|
@@ -747,7 +769,7 @@ def cli_server(integration_utils):
|
|
|
747
769
|
key = str(uuid.uuid4())
|
|
748
770
|
logger.info(f"Plugin key: {key}")
|
|
749
771
|
|
|
750
|
-
credential_values =
|
|
772
|
+
credential_values = CredentialsManager.plugin_credentials(key)
|
|
751
773
|
settings = integration_utils.create_integration(
|
|
752
774
|
CredentialTypes.PLUGIN, credential_values
|
|
753
775
|
)
|
|
@@ -763,7 +785,7 @@ def cli_server(integration_utils):
|
|
|
763
785
|
"--plugin-key",
|
|
764
786
|
key,
|
|
765
787
|
"--plugin-engine-uri",
|
|
766
|
-
|
|
788
|
+
CredentialsManager.get_parameter("NATS_URL"),
|
|
767
789
|
"mcp",
|
|
768
790
|
"run",
|
|
769
791
|
"-s",
|
|
@@ -771,19 +793,23 @@ def cli_server(integration_utils):
|
|
|
771
793
|
"-e",
|
|
772
794
|
"cli-mcp-server=ALLOWED_DIR",
|
|
773
795
|
]
|
|
774
|
-
subprocess.Popen(command, env=env)
|
|
796
|
+
process = subprocess.Popen(command, env=env)
|
|
797
|
+
logger.info(f"Started CLI server process with PID: {process.pid}")
|
|
775
798
|
sleep(10)
|
|
776
|
-
|
|
799
|
+
yield settings
|
|
800
|
+
cleanup_plugin_process(process)
|
|
777
801
|
|
|
778
802
|
|
|
779
803
|
@pytest.fixture(scope="session")
|
|
780
804
|
def development_plugin(integration_utils):
|
|
781
805
|
key = str(uuid.uuid4())
|
|
806
|
+
logger.info(f"Plugin key: {key}")
|
|
782
807
|
|
|
783
|
-
credential_values =
|
|
808
|
+
credential_values = CredentialsManager.plugin_credentials(key)
|
|
784
809
|
settings = integration_utils.create_integration(
|
|
785
810
|
CredentialTypes.PLUGIN, credential_values
|
|
786
811
|
)
|
|
812
|
+
logger.info(f"Integration id: {settings.id}")
|
|
787
813
|
|
|
788
814
|
env = os.environ.copy()
|
|
789
815
|
env["PLUGIN_EXPERIMENTAL_PROTOCOL"] = "true"
|
|
@@ -793,15 +819,17 @@ def development_plugin(integration_utils):
|
|
|
793
819
|
"--plugin-key",
|
|
794
820
|
key,
|
|
795
821
|
"--plugin-engine-uri",
|
|
796
|
-
|
|
822
|
+
CredentialsManager.get_parameter("NATS_URL"),
|
|
797
823
|
"development",
|
|
798
824
|
"run",
|
|
799
825
|
"--repo-path",
|
|
800
826
|
str(TESTS_PATH),
|
|
801
827
|
]
|
|
802
|
-
subprocess.Popen(command, env=env)
|
|
828
|
+
process = subprocess.Popen(command, env=env)
|
|
829
|
+
logger.info(f"Started development plugin process with PID: {process.pid}")
|
|
803
830
|
sleep(10)
|
|
804
|
-
|
|
831
|
+
yield settings
|
|
832
|
+
cleanup_plugin_process(process)
|
|
805
833
|
|
|
806
834
|
|
|
807
835
|
@pytest.fixture(scope="module")
|
|
@@ -809,7 +837,7 @@ def ado_integration(integration_utils):
|
|
|
809
837
|
"""Create Azure DevOps integration"""
|
|
810
838
|
integration = integration_utils.create_integration(
|
|
811
839
|
CredentialTypes.AZURE_DEVOPS,
|
|
812
|
-
|
|
840
|
+
CredentialsManager.azure_devops_credentials(),
|
|
813
841
|
)
|
|
814
842
|
yield integration
|
|
815
843
|
if integration:
|
|
@@ -842,7 +870,7 @@ def cloud_integration(integration_utils):
|
|
|
842
870
|
def pytest_sessionfinish(session):
|
|
843
871
|
"""Run cleanup code after all tests have finished."""
|
|
844
872
|
clean_up_timeout = 1 if EnvironmentResolver.is_production() else 0
|
|
845
|
-
if
|
|
873
|
+
if CredentialsManager.get_parameter("CLEANUP_DATA", "true").lower() == "true":
|
|
846
874
|
client = get_client()
|
|
847
875
|
prefix = autotest_entity_prefix
|
|
848
876
|
integrations = client.integrations.list(
|
|
@@ -12,7 +12,7 @@ from codemie_test_harness.tests.enums.tools import (
|
|
|
12
12
|
VcsTool,
|
|
13
13
|
)
|
|
14
14
|
from codemie_sdk.models.integration import CredentialTypes
|
|
15
|
-
from codemie_test_harness.tests.utils.
|
|
15
|
+
from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
@pytest.fixture(scope="session")
|
|
@@ -20,12 +20,12 @@ def git_integration(integration_utils):
|
|
|
20
20
|
if os.getenv("GIT_ENV", "gitlab") == "gitlab":
|
|
21
21
|
integration = integration_utils.create_integration(
|
|
22
22
|
credential_type=CredentialTypes.GIT,
|
|
23
|
-
credential_values=
|
|
23
|
+
credential_values=CredentialsManager.gitlab_credentials(),
|
|
24
24
|
)
|
|
25
25
|
else:
|
|
26
26
|
integration = integration_utils.create_integration(
|
|
27
27
|
credential_type=CredentialTypes.GIT,
|
|
28
|
-
credential_values=
|
|
28
|
+
credential_values=CredentialsManager.github_credentials(),
|
|
29
29
|
)
|
|
30
30
|
yield integration
|
|
31
31
|
if integration:
|
|
@@ -79,7 +79,7 @@ def test_assistant_with_vcs_gitlab_tool(
|
|
|
79
79
|
|
|
80
80
|
response = assistant_utils.ask_assistant(
|
|
81
81
|
assistant,
|
|
82
|
-
f"Run gitlab tool to list branches in the repository for project with ID {
|
|
82
|
+
f"Run gitlab tool to list branches in the repository for project with ID {CredentialsManager.get_parameter('GITLAB_PROJECT_ID')}. "
|
|
83
83
|
"Do not ask user confirmation to do this. "
|
|
84
84
|
"Do not return branches to user but just confirm if you have an access to repository or not",
|
|
85
85
|
)
|
|
@@ -113,7 +113,7 @@ def test_assistant_with_vcs_github_tool(
|
|
|
113
113
|
|
|
114
114
|
response = assistant_utils.ask_assistant(
|
|
115
115
|
assistant,
|
|
116
|
-
f"Run github tool to list branches in the repository for project {
|
|
116
|
+
f"Run github tool to list branches in the repository for project {CredentialsManager.get_parameter('GITHUB_PROJECT')}. "
|
|
117
117
|
"Do not ask user confirmation to do this. "
|
|
118
118
|
"Do not return branches to user but just confirm if you have an access to repository or not",
|
|
119
119
|
)
|
|
@@ -37,7 +37,7 @@ 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.
|
|
40
|
+
from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
|
|
41
41
|
from codemie_test_harness.tests.enums.environment import Environment
|
|
42
42
|
from codemie_test_harness.tests.utils.constants import test_project_name
|
|
43
43
|
from codemie_test_harness.tests.utils.env_resolver import get_environment
|
|
@@ -120,7 +120,7 @@ def test_assistant_with_default_integration_ado(
|
|
|
120
120
|
general_integration(
|
|
121
121
|
integration_type=IntegrationType.PROJECT,
|
|
122
122
|
credential_type=CredentialTypes.AZURE_DEVOPS,
|
|
123
|
-
credential_values=
|
|
123
|
+
credential_values=CredentialsManager.azure_devops_credentials(),
|
|
124
124
|
project_name=test_project_name,
|
|
125
125
|
)
|
|
126
126
|
# create an assistant
|
|
@@ -206,7 +206,7 @@ def test_assistant_with_default_integration_git(
|
|
|
206
206
|
_git_integration = general_integration(
|
|
207
207
|
integration_type=IntegrationType.PROJECT,
|
|
208
208
|
credential_type=CredentialTypes.GIT,
|
|
209
|
-
credential_values=
|
|
209
|
+
credential_values=CredentialsManager.gitlab_credentials(),
|
|
210
210
|
project_name=test_project_name,
|
|
211
211
|
)
|
|
212
212
|
# create a new datasource
|
|
@@ -252,7 +252,7 @@ def test_assistant_with_default_integration_jira(
|
|
|
252
252
|
general_integration(
|
|
253
253
|
integration_type=IntegrationType.PROJECT,
|
|
254
254
|
credential_type=CredentialTypes.JIRA,
|
|
255
|
-
credential_values=
|
|
255
|
+
credential_values=CredentialsManager.jira_credentials(),
|
|
256
256
|
project_name=test_project_name,
|
|
257
257
|
)
|
|
258
258
|
# create an assistant
|
|
@@ -291,7 +291,7 @@ def test_assistant_with_default_integration_email(
|
|
|
291
291
|
general_integration(
|
|
292
292
|
integration_type=IntegrationType.PROJECT,
|
|
293
293
|
credential_type=CredentialTypes.EMAIL,
|
|
294
|
-
credential_values=
|
|
294
|
+
credential_values=CredentialsManager.gmail_credentials(),
|
|
295
295
|
project_name=test_project_name,
|
|
296
296
|
)
|
|
297
297
|
# create an assistant
|
|
@@ -326,7 +326,7 @@ def test_assistant_with_default_integration_keycloak(
|
|
|
326
326
|
general_integration(
|
|
327
327
|
integration_type=IntegrationType.PROJECT,
|
|
328
328
|
credential_type=CredentialTypes.KEYCLOAK,
|
|
329
|
-
credential_values=
|
|
329
|
+
credential_values=CredentialsManager.keycloak_credentials(),
|
|
330
330
|
project_name=test_project_name,
|
|
331
331
|
)
|
|
332
332
|
# create an assistant
|
|
@@ -366,7 +366,7 @@ def test_assistant_with_default_integration_report_portal(
|
|
|
366
366
|
general_integration(
|
|
367
367
|
integration_type=IntegrationType.PROJECT,
|
|
368
368
|
credential_type=CredentialTypes.REPORT_PORTAL,
|
|
369
|
-
credential_values=
|
|
369
|
+
credential_values=CredentialsManager.report_portal_credentials(),
|
|
370
370
|
project_name=test_project_name,
|
|
371
371
|
)
|
|
372
372
|
# create an assistant
|
|
@@ -37,7 +37,7 @@ 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.
|
|
40
|
+
from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
|
|
41
41
|
from codemie_test_harness.tests.enums.environment import Environment
|
|
42
42
|
from codemie_test_harness.tests.utils.constants import test_project_name
|
|
43
43
|
from codemie_test_harness.tests.utils.env_resolver import get_environment
|
|
@@ -120,7 +120,7 @@ def test_assistant_with_default_integration_ado(
|
|
|
120
120
|
general_integration(
|
|
121
121
|
integration_type=IntegrationType.USER,
|
|
122
122
|
credential_type=CredentialTypes.AZURE_DEVOPS,
|
|
123
|
-
credential_values=
|
|
123
|
+
credential_values=CredentialsManager.azure_devops_credentials(),
|
|
124
124
|
project_name=test_project_name,
|
|
125
125
|
)
|
|
126
126
|
# create an assistant
|
|
@@ -206,7 +206,7 @@ def test_assistant_with_default_integration_git(
|
|
|
206
206
|
_git_integration = general_integration(
|
|
207
207
|
integration_type=IntegrationType.USER,
|
|
208
208
|
credential_type=CredentialTypes.GIT,
|
|
209
|
-
credential_values=
|
|
209
|
+
credential_values=CredentialsManager.gitlab_credentials(),
|
|
210
210
|
project_name=test_project_name,
|
|
211
211
|
)
|
|
212
212
|
# create a new datasource
|
|
@@ -252,7 +252,7 @@ def test_assistant_with_default_integration_jira(
|
|
|
252
252
|
general_integration(
|
|
253
253
|
integration_type=IntegrationType.USER,
|
|
254
254
|
credential_type=CredentialTypes.JIRA,
|
|
255
|
-
credential_values=
|
|
255
|
+
credential_values=CredentialsManager.jira_credentials(),
|
|
256
256
|
project_name=test_project_name,
|
|
257
257
|
)
|
|
258
258
|
# create an assistant
|
|
@@ -291,7 +291,7 @@ def test_assistant_with_default_integration_email(
|
|
|
291
291
|
general_integration(
|
|
292
292
|
integration_type=IntegrationType.USER,
|
|
293
293
|
credential_type=CredentialTypes.EMAIL,
|
|
294
|
-
credential_values=
|
|
294
|
+
credential_values=CredentialsManager.gmail_credentials(),
|
|
295
295
|
project_name=test_project_name,
|
|
296
296
|
)
|
|
297
297
|
# create an assistant
|
|
@@ -326,7 +326,7 @@ def test_assistant_with_default_integration_keycloak(
|
|
|
326
326
|
general_integration(
|
|
327
327
|
integration_type=IntegrationType.USER,
|
|
328
328
|
credential_type=CredentialTypes.KEYCLOAK,
|
|
329
|
-
credential_values=
|
|
329
|
+
credential_values=CredentialsManager.keycloak_credentials(),
|
|
330
330
|
project_name=test_project_name,
|
|
331
331
|
)
|
|
332
332
|
# create an assistant
|
|
@@ -366,7 +366,7 @@ def test_assistant_with_default_integration_report_portal(
|
|
|
366
366
|
general_integration(
|
|
367
367
|
integration_type=IntegrationType.USER,
|
|
368
368
|
credential_type=CredentialTypes.REPORT_PORTAL,
|
|
369
|
-
credential_values=
|
|
369
|
+
credential_values=CredentialsManager.report_portal_credentials(),
|
|
370
370
|
project_name=test_project_name,
|
|
371
371
|
)
|
|
372
372
|
# create an assistant
|
|
@@ -4,7 +4,7 @@ from hamcrest import assert_that, has_item
|
|
|
4
4
|
|
|
5
5
|
from codemie_test_harness.tests.enums.model_types import ModelTypes
|
|
6
6
|
from codemie_test_harness.tests.test_data.llm_test_data import MODEL_RESPONSES
|
|
7
|
-
from codemie_test_harness.tests.utils.
|
|
7
|
+
from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
|
|
8
8
|
from codemie_test_harness.tests.utils.client_factory import get_client
|
|
9
9
|
from codemie_test_harness.tests.utils.constants import test_project_name
|
|
10
10
|
from codemie_test_harness.tests.utils.env_resolver import get_environment
|
|
@@ -13,7 +13,7 @@ from codemie_test_harness.tests.utils.pytest_utils import check_mark
|
|
|
13
13
|
|
|
14
14
|
@pytest.fixture(scope="module")
|
|
15
15
|
def lite_llm_integration(integration_utils):
|
|
16
|
-
credential_values =
|
|
16
|
+
credential_values = CredentialsManager.lite_llm_credentials()
|
|
17
17
|
integration = integration_utils.create_user_integration(
|
|
18
18
|
CredentialTypes.LITE_LLM,
|
|
19
19
|
credential_values,
|
|
@@ -25,7 +25,7 @@ def lite_llm_integration(integration_utils):
|
|
|
25
25
|
|
|
26
26
|
@pytest.fixture(scope="function")
|
|
27
27
|
def invalid_lite_llm_integration(integration_utils):
|
|
28
|
-
credential_values =
|
|
28
|
+
credential_values = CredentialsManager.invalid_lite_llm_credentials()
|
|
29
29
|
integration = integration_utils.create_user_integration(
|
|
30
30
|
CredentialTypes.LITE_LLM,
|
|
31
31
|
credential_values,
|
|
@@ -4,7 +4,7 @@ from hamcrest import assert_that
|
|
|
4
4
|
from codemie_sdk.models.datasource import DataSourceType, DataSourceStatus
|
|
5
5
|
from codemie_sdk.models.integration import CredentialTypes
|
|
6
6
|
from codemie_test_harness.tests import TEST_USER, PROJECT
|
|
7
|
-
from codemie_test_harness.tests.utils.
|
|
7
|
+
from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
|
|
8
8
|
from codemie_test_harness.tests.utils.base_utils import get_random_name
|
|
9
9
|
|
|
10
10
|
ASSERTION_ERROR = "Datasource is not found in search results."
|
|
@@ -30,7 +30,7 @@ def datasource(
|
|
|
30
30
|
):
|
|
31
31
|
code_integration = integration_utils.create_integration(
|
|
32
32
|
credential_type=CredentialTypes.GIT,
|
|
33
|
-
credential_values=
|
|
33
|
+
credential_values=CredentialsManager.gitlab_credentials(),
|
|
34
34
|
)
|
|
35
35
|
|
|
36
36
|
datasource = datasource_utils.create_gitlab_datasource(
|
|
@@ -2,7 +2,7 @@ import pytest
|
|
|
2
2
|
from hamcrest import assert_that
|
|
3
3
|
|
|
4
4
|
from codemie_sdk.models.integration import CredentialTypes, IntegrationType
|
|
5
|
-
from codemie_test_harness.tests.utils.
|
|
5
|
+
from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
|
|
6
6
|
from codemie_test_harness.tests.utils.base_utils import get_random_name
|
|
7
7
|
|
|
8
8
|
ASSERTION_ERROR = "Integration is not found in search results."
|
|
@@ -26,7 +26,7 @@ def user_integration(integration_utils, user_integration_name):
|
|
|
26
26
|
setting_type=IntegrationType.USER,
|
|
27
27
|
integration_alias=user_integration_name,
|
|
28
28
|
credential_type=CredentialTypes.GIT,
|
|
29
|
-
credential_values=
|
|
29
|
+
credential_values=CredentialsManager.gitlab_credentials(),
|
|
30
30
|
)
|
|
31
31
|
yield integration
|
|
32
32
|
integration_utils.delete_integration(integration)
|
|
@@ -38,7 +38,7 @@ def project_integration(integration_utils, project_integration_name):
|
|
|
38
38
|
setting_type=IntegrationType.PROJECT,
|
|
39
39
|
integration_alias=project_integration_name,
|
|
40
40
|
credential_type=CredentialTypes.GIT,
|
|
41
|
-
credential_values=
|
|
41
|
+
credential_values=CredentialsManager.gitlab_credentials(),
|
|
42
42
|
)
|
|
43
43
|
yield integration
|
|
44
44
|
if integration:
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import os
|
|
2
1
|
import pytest
|
|
3
2
|
from hamcrest import (
|
|
4
3
|
assert_that,
|
|
@@ -27,6 +26,7 @@ from codemie_sdk.models.integration import (
|
|
|
27
26
|
)
|
|
28
27
|
from codemie_test_harness.tests import PROJECT
|
|
29
28
|
from codemie_test_harness.tests.utils.base_utils import get_random_name
|
|
29
|
+
from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
@pytest.fixture
|
|
@@ -34,19 +34,19 @@ def integration_config():
|
|
|
34
34
|
"""Configuration for different integration types."""
|
|
35
35
|
return {
|
|
36
36
|
CredentialTypes.GIT: {
|
|
37
|
-
"url":
|
|
37
|
+
"url": CredentialsManager.get_parameter("GITLAB_URL"),
|
|
38
38
|
"token_name": "test-token-name",
|
|
39
|
-
"token":
|
|
39
|
+
"token": CredentialsManager.get_parameter("GITLAB_TOKEN"),
|
|
40
40
|
},
|
|
41
41
|
CredentialTypes.CONFLUENCE: {
|
|
42
|
-
"url":
|
|
42
|
+
"url": CredentialsManager.get_parameter("CONFLUENCE_URL"),
|
|
43
43
|
"token_name": "test-token-name",
|
|
44
|
-
"token":
|
|
44
|
+
"token": CredentialsManager.get_parameter("CONFLUENCE_TOKEN"),
|
|
45
45
|
},
|
|
46
46
|
CredentialTypes.JIRA: {
|
|
47
|
-
"url":
|
|
47
|
+
"url": CredentialsManager.get_parameter("JIRA_URL"),
|
|
48
48
|
"token_name": "test-token-name",
|
|
49
|
-
"token":
|
|
49
|
+
"token": CredentialsManager.get_parameter("JIRA_TOKEN"),
|
|
50
50
|
},
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -188,7 +188,7 @@ class TestDatasources(TestDatasourceBase):
|
|
|
188
188
|
"name": integration.alias,
|
|
189
189
|
"project_name": PROJECT,
|
|
190
190
|
"description": "Code datasource description",
|
|
191
|
-
"link":
|
|
191
|
+
"link": CredentialsManager.get_parameter("GITLAB_PROJECT"),
|
|
192
192
|
"branch": "main",
|
|
193
193
|
"index_type": DataSourceType.CODE,
|
|
194
194
|
"embeddings_model": embeddings_model.base_name,
|
|
@@ -201,7 +201,7 @@ class TestDatasources(TestDatasourceBase):
|
|
|
201
201
|
)
|
|
202
202
|
|
|
203
203
|
update_request_params = {
|
|
204
|
-
"link":
|
|
204
|
+
"link": CredentialsManager.get_parameter("GITHUB_PROJECT"),
|
|
205
205
|
"branch": "master",
|
|
206
206
|
"name": integration.alias,
|
|
207
207
|
"project_name": PROJECT,
|
|
@@ -235,7 +235,7 @@ class TestDatasources(TestDatasourceBase):
|
|
|
235
235
|
"name": integration.alias,
|
|
236
236
|
"project_name": PROJECT,
|
|
237
237
|
"description": "Datasource for KB space",
|
|
238
|
-
"cql":
|
|
238
|
+
"cql": CredentialsManager.confluence_cql(),
|
|
239
239
|
"setting_id": integration.id,
|
|
240
240
|
}
|
|
241
241
|
created = datasource_utils.create_confluence_datasource(**create_request_params)
|
|
@@ -278,7 +278,7 @@ class TestDatasources(TestDatasourceBase):
|
|
|
278
278
|
"name": integration.alias,
|
|
279
279
|
"project_name": PROJECT,
|
|
280
280
|
"description": "Jira datasource description",
|
|
281
|
-
"jql":
|
|
281
|
+
"jql": CredentialsManager.jira_jql(),
|
|
282
282
|
"setting_id": integration.id,
|
|
283
283
|
}
|
|
284
284
|
created = datasource_utils.create_jira_datasource(**create_request_params)
|
|
@@ -291,7 +291,7 @@ class TestDatasources(TestDatasourceBase):
|
|
|
291
291
|
"name": integration.alias,
|
|
292
292
|
"project_name": PROJECT,
|
|
293
293
|
"description": "Updated Jira datasource description",
|
|
294
|
-
"jql":
|
|
294
|
+
"jql": CredentialsManager.jira_jql(),
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
updated = datasource_utils.update_jira_datasource(
|