codemie-test-harness 0.1.158__py3-none-any.whl → 0.1.160__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/assistant/datasource/test_confluence_datasource.py +2 -1
- codemie_test_harness/tests/assistant/datasource/test_jira_datasource.py +2 -1
- codemie_test_harness/tests/assistant/tools/cloud/test_cloud_tools.py +0 -7
- codemie_test_harness/tests/assistant/tools/codebase/test_codebase_tools.py +0 -1
- codemie_test_harness/tests/assistant/tools/datamanagement/test_assistant_with_data_management_tools.py +4 -5
- codemie_test_harness/tests/assistant/tools/filemanagement/test_assistant_with_file_management_tools.py +2 -9
- codemie_test_harness/tests/assistant/tools/mcp/test_cli_mcp_server.py +5 -7
- codemie_test_harness/tests/assistant/tools/mcp/test_mcp_servers.py +5 -7
- codemie_test_harness/tests/assistant/tools/notification/test_assistant_notification_tools.py +3 -3
- codemie_test_harness/tests/assistant/tools/openapi/test_assistant_with_open_api_tools.py +3 -2
- codemie_test_harness/tests/assistant/tools/report_portal/__init__.py +0 -0
- codemie_test_harness/tests/assistant/tools/report_portal/test_assistant_report_portal_tools.py +32 -0
- codemie_test_harness/tests/conftest.py +17 -2
- codemie_test_harness/tests/enums/environment.py +102 -0
- codemie_test_harness/tests/enums/model_types.py +1 -0
- codemie_test_harness/tests/enums/tools.py +14 -0
- codemie_test_harness/tests/integrations/project/test_default_integrations.py +47 -12
- codemie_test_harness/tests/integrations/project/test_project_integrations.py +0 -125
- codemie_test_harness/tests/integrations/user/test_default_integrations.py +47 -11
- codemie_test_harness/tests/integrations/user/test_user_integrations.py +0 -125
- codemie_test_harness/tests/llm/assistants/test_llm.py +3 -3
- codemie_test_harness/tests/service/test_assistant_service.py +2 -2
- codemie_test_harness/tests/test_data/cloud_tools_test_data.py +32 -11
- 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 +3 -3
- codemie_test_harness/tests/test_data/direct_tools/cloud_tools_test_data.py +7 -4
- codemie_test_harness/tests/test_data/direct_tools/codebase_tools_test_data.py +2 -0
- codemie_test_harness/tests/test_data/direct_tools/data_management_tools_test_data.py +4 -5
- codemie_test_harness/tests/test_data/direct_tools/file_management_tools_test_data.py +2 -2
- codemie_test_harness/tests/test_data/direct_tools/notification_tools_test_data.py +5 -2
- codemie_test_harness/tests/test_data/direct_tools/project_management_tools_test_data.py +2 -0
- codemie_test_harness/tests/test_data/direct_tools/report_portal_tools_test_data.py +1235 -0
- codemie_test_harness/tests/test_data/direct_tools/research_tools_test_data.py +1 -0
- codemie_test_harness/tests/test_data/direct_tools/vcs_tools_test_data.py +3 -0
- codemie_test_harness/tests/test_data/file_management_tools_test_data.py +9 -5
- codemie_test_harness/tests/test_data/index_test_data.py +9 -11
- codemie_test_harness/tests/test_data/integrations_test_data.py +71 -9
- codemie_test_harness/tests/test_data/llm_test_data.py +8 -6
- codemie_test_harness/tests/test_data/project_management_test_data.py +4 -0
- codemie_test_harness/tests/test_data/report_portal_tools_test_data.py +520 -0
- codemie_test_harness/tests/test_data/vcs_tools_test_data.py +11 -2
- codemie_test_harness/tests/utils/aws_parameters_store.py +33 -2
- codemie_test_harness/tests/utils/constants.py +1 -1
- codemie_test_harness/tests/utils/env_resolver.py +119 -0
- codemie_test_harness/tests/workflow/assistant_tools/cloud/test_workflow_with_assistant_cloud_tools.py +0 -7
- codemie_test_harness/tests/workflow/assistant_tools/codebase/test_worfklow_with_assistant_codebase_tools.py +0 -1
- codemie_test_harness/tests/workflow/assistant_tools/data_management/test_workflow_with_assistant_with_data_management_tools.py +3 -5
- codemie_test_harness/tests/workflow/assistant_tools/file_management/test_workflow_with_assistant_with_file_management_tools.py +2 -9
- codemie_test_harness/tests/workflow/assistant_tools/mcp/test_workflow_with_assistant_with_mcp_server.py +5 -10
- codemie_test_harness/tests/workflow/assistant_tools/notification/test_workflow_with_assistant_notification_tools.py +3 -2
- codemie_test_harness/tests/workflow/assistant_tools/open_api/test_workflow_with_assistant_with_open_api_tools.py +3 -2
- codemie_test_harness/tests/workflow/assistant_tools/report_portal/__init__.py +0 -0
- codemie_test_harness/tests/workflow/assistant_tools/report_portal/test_workflow_with_assistant_with_report_portal_tools.py +38 -0
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_data_management_tools_sql.py +3 -2
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_open_api_tools.py +3 -2
- codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_report_portal_tools.py +115 -0
- codemie_test_harness/tests/workflow/virtual_assistant_tools/cloud/test_workflow_with_cloud_tools.py +0 -7
- codemie_test_harness/tests/workflow/virtual_assistant_tools/codebase/test_workflow_with_codebase_tools.py +0 -1
- codemie_test_harness/tests/workflow/virtual_assistant_tools/data_management/test_workflow_with_data_management_tools.py +3 -5
- codemie_test_harness/tests/workflow/virtual_assistant_tools/file_management/test_workflow_with_file_management_tools.py +2 -9
- codemie_test_harness/tests/workflow/virtual_assistant_tools/mcp/test_workflow_with_mcp_server.py +5 -11
- codemie_test_harness/tests/workflow/virtual_assistant_tools/notification/test_workflow_with_notification_tools.py +3 -3
- codemie_test_harness/tests/workflow/virtual_assistant_tools/open_api/test_workflow_with_open_api_tools.py +3 -3
- codemie_test_harness/tests/workflow/virtual_assistant_tools/report_portal/__init__.py +0 -0
- codemie_test_harness/tests/workflow/virtual_assistant_tools/report_portal/test_workflow_with_report_portal_tool.py +39 -0
- {codemie_test_harness-0.1.158.dist-info → codemie_test_harness-0.1.160.dist-info}/METADATA +2 -2
- {codemie_test_harness-0.1.158.dist-info → codemie_test_harness-0.1.160.dist-info}/RECORD +69 -58
- {codemie_test_harness-0.1.158.dist-info → codemie_test_harness-0.1.160.dist-info}/WHEEL +0 -0
- {codemie_test_harness-0.1.158.dist-info → codemie_test_harness-0.1.160.dist-info}/entry_points.txt +0 -0
|
@@ -38,15 +38,16 @@ def confluence_cloud_datasource(datasource_utils, confluence_cloud_integration):
|
|
|
38
38
|
CONFLUENCE_TOOL_PROMPT,
|
|
39
39
|
RESPONSE_FOR_CONFLUENCE_TOOL,
|
|
40
40
|
marks=pytest.mark.confluence,
|
|
41
|
+
id="Confluence",
|
|
41
42
|
),
|
|
42
43
|
pytest.param(
|
|
43
44
|
"confluence_cloud_datasource",
|
|
44
45
|
CONFLUENCE_CLOUD_TOOL_PROMPT,
|
|
45
46
|
RESPONSE_FOR_CONFLUENCE_CLOUD_TOOL,
|
|
46
47
|
marks=[pytest.mark.confluence, pytest.mark.confluence_cloud],
|
|
48
|
+
id="Confluence Cloud",
|
|
47
49
|
),
|
|
48
50
|
],
|
|
49
|
-
ids=["Confluence", "Confluence Cloud"],
|
|
50
51
|
)
|
|
51
52
|
def test_create_datasource_with_confluence_and_confluence_cloud_integration(
|
|
52
53
|
request,
|
|
@@ -36,15 +36,16 @@ def jira_cloud_datasource(datasource_utils, jira_cloud_integration):
|
|
|
36
36
|
JIRA_TOOL_PROMPT,
|
|
37
37
|
RESPONSE_FOR_JIRA_TOOL,
|
|
38
38
|
marks=pytest.mark.jira,
|
|
39
|
+
id="Jira",
|
|
39
40
|
),
|
|
40
41
|
pytest.param(
|
|
41
42
|
"jira_cloud_datasource",
|
|
42
43
|
JIRA_CLOUD_TOOL_PROMPT,
|
|
43
44
|
RESPONSE_FOR_JIRA_CLOUD_TOOL,
|
|
44
45
|
marks=[pytest.mark.jira, pytest.mark.jira_cloud],
|
|
46
|
+
id="Jira Cloud",
|
|
45
47
|
),
|
|
46
48
|
],
|
|
47
|
-
ids=["Jira", "Jira Cloud"],
|
|
48
49
|
)
|
|
49
50
|
def test_create_datasource_with_jira_and_jira_cloud_integration(
|
|
50
51
|
request,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
|
|
3
|
-
from codemie_test_harness.tests.enums.tools import Toolkit, CloudTool
|
|
4
3
|
from codemie_test_harness.tests.test_data.cloud_tools_test_data import cloud_test_data
|
|
5
4
|
|
|
6
5
|
|
|
@@ -10,12 +9,6 @@ from codemie_test_harness.tests.test_data.cloud_tools_test_data import cloud_tes
|
|
|
10
9
|
@pytest.mark.parametrize(
|
|
11
10
|
"toolkit,tool_name,credential_type,credentials,prompt,expected_response",
|
|
12
11
|
cloud_test_data,
|
|
13
|
-
ids=[
|
|
14
|
-
f"{Toolkit.CLOUD}_{CloudTool.AWS}",
|
|
15
|
-
f"{Toolkit.CLOUD}_{CloudTool.AZURE}",
|
|
16
|
-
f"{Toolkit.CLOUD}_{CloudTool.GCP}",
|
|
17
|
-
f"{Toolkit.CLOUD}_{CloudTool.KUBERNETES}",
|
|
18
|
-
],
|
|
19
12
|
)
|
|
20
13
|
def test_assistant_with_cloud_tools(
|
|
21
14
|
assistant_utils,
|
|
@@ -39,7 +39,6 @@ def test_assistant_with_codebase_tools(
|
|
|
39
39
|
@pytest.mark.parametrize(
|
|
40
40
|
"toolkit, tool_name, credentials, prompt, expected",
|
|
41
41
|
sonar_tools_test_data,
|
|
42
|
-
ids=[f"{row[0]}_{row[1]}" for row in sonar_tools_test_data],
|
|
43
42
|
)
|
|
44
43
|
def test_assistant_with_sonar_tools(
|
|
45
44
|
assistant_utils,
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import os
|
|
2
1
|
import uuid
|
|
3
2
|
|
|
4
3
|
import pytest
|
|
5
4
|
from codemie_sdk.models.integration import CredentialTypes
|
|
6
5
|
|
|
7
|
-
from codemie_test_harness.tests.enums.integrations import DataBaseDialect
|
|
8
6
|
from codemie_test_harness.tests.enums.tools import (
|
|
9
7
|
Toolkit,
|
|
10
8
|
DataManagementTool,
|
|
@@ -20,9 +18,11 @@ from codemie_test_harness.tests.test_data.data_management_tools_test_data import
|
|
|
20
18
|
RESPONSE_FOR_SQL,
|
|
21
19
|
)
|
|
22
20
|
from codemie_test_harness.tests.utils.aws_parameters_store import CredentialsUtil
|
|
21
|
+
from codemie_test_harness.tests.utils.env_resolver import EnvironmentResolver
|
|
23
22
|
|
|
24
23
|
pytestmark = pytest.mark.skipif(
|
|
25
|
-
|
|
24
|
+
EnvironmentResolver.is_localhost(),
|
|
25
|
+
reason="Skipping this tests on local environment",
|
|
26
26
|
)
|
|
27
27
|
|
|
28
28
|
|
|
@@ -55,11 +55,10 @@ def test_create_assistant_with_elastic_tool(
|
|
|
55
55
|
@pytest.mark.parametrize(
|
|
56
56
|
"db_dialect",
|
|
57
57
|
sql_tools_test_data,
|
|
58
|
-
ids=[DataBaseDialect.MY_SQL, DataBaseDialect.POSTGRES, DataBaseDialect.MS_SQL],
|
|
59
58
|
)
|
|
60
59
|
@pytest.mark.testcase("EPMCDME-6132")
|
|
61
60
|
@pytest.mark.skipif(
|
|
62
|
-
|
|
61
|
+
EnvironmentResolver.is_localhost(), reason="Skipping this test on local environment"
|
|
63
62
|
)
|
|
64
63
|
def test_create_assistant_with_sql_tool(
|
|
65
64
|
integration_utils, assistant_utils, assistant, similarity_check, db_dialect
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
1
|
import pytest
|
|
4
2
|
from hamcrest import assert_that, contains_string, is_not, all_of
|
|
5
3
|
|
|
@@ -17,6 +15,7 @@ from codemie_test_harness.tests.test_data.file_management_tools_test_data import
|
|
|
17
15
|
show_diff_task,
|
|
18
16
|
)
|
|
19
17
|
from codemie_test_harness.tests.utils.base_utils import get_random_name
|
|
18
|
+
from codemie_test_harness.tests.utils.env_resolver import EnvironmentResolver
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
@pytest.mark.assistant
|
|
@@ -26,12 +25,6 @@ from codemie_test_harness.tests.utils.base_utils import get_random_name
|
|
|
26
25
|
@pytest.mark.parametrize(
|
|
27
26
|
"tool_name,prompt,expected_response",
|
|
28
27
|
file_management_tools_test_data,
|
|
29
|
-
ids=[
|
|
30
|
-
FileManagementTool.PYTHON_CODE_INTERPRETER,
|
|
31
|
-
FileManagementTool.LIST_DIRECTORY,
|
|
32
|
-
FileManagementTool.WRITE_FILE,
|
|
33
|
-
FileManagementTool.RUN_COMMAND_LINE,
|
|
34
|
-
],
|
|
35
28
|
)
|
|
36
29
|
def test_create_assistant_with_file_management_tool(
|
|
37
30
|
filesystem_integration,
|
|
@@ -56,7 +49,7 @@ def test_create_assistant_with_file_management_tool(
|
|
|
56
49
|
@pytest.mark.regression
|
|
57
50
|
@pytest.mark.testcase("EPMCDME-6103")
|
|
58
51
|
@pytest.mark.skipif(
|
|
59
|
-
|
|
52
|
+
EnvironmentResolver.is_localhost(), reason="Skipping this test on local environment"
|
|
60
53
|
)
|
|
61
54
|
def test_create_assistant_with_file_management_generate_image_tool(
|
|
62
55
|
filesystem_integration, assistant, assistant_utils, similarity_check
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import os
|
|
2
1
|
from copy import deepcopy
|
|
3
2
|
|
|
4
3
|
import pytest
|
|
@@ -8,19 +7,21 @@ from hamcrest import assert_that, contains_string
|
|
|
8
7
|
from codemie_sdk.models.integration import CredentialTypes
|
|
9
8
|
from codemie_test_harness.tests import autotest_entity_prefix
|
|
10
9
|
from codemie_test_harness.tests.utils.aws_parameters_store import CredentialsUtil
|
|
10
|
+
from codemie_test_harness.tests.utils.env_resolver import EnvironmentResolver
|
|
11
11
|
from codemie_test_harness.tests.utils.base_utils import get_random_name
|
|
12
12
|
from codemie_test_harness.tests.test_data.mcp_server_test_data import (
|
|
13
13
|
cli_mcp_server_test_data,
|
|
14
14
|
CLI_MCP_SERVER,
|
|
15
15
|
)
|
|
16
16
|
|
|
17
|
+
pytestmark = pytest.mark.skipif(
|
|
18
|
+
EnvironmentResolver.is_localhost(), reason="Skipping this test on local environment"
|
|
19
|
+
)
|
|
20
|
+
|
|
17
21
|
|
|
18
22
|
@pytest.mark.assistant
|
|
19
23
|
@pytest.mark.mcp
|
|
20
24
|
@pytest.mark.regression
|
|
21
|
-
@pytest.mark.skipif(
|
|
22
|
-
os.getenv("ENV") == "local", reason="Skipping this test on local environment"
|
|
23
|
-
)
|
|
24
25
|
@pytest.mark.parametrize(
|
|
25
26
|
"command,expected_answer",
|
|
26
27
|
cli_mcp_server_test_data,
|
|
@@ -41,9 +42,6 @@ def test_cli_mcp_server(
|
|
|
41
42
|
@pytest.mark.assistant
|
|
42
43
|
@pytest.mark.mcp
|
|
43
44
|
@pytest.mark.regression
|
|
44
|
-
@pytest.mark.skipif(
|
|
45
|
-
os.getenv("ENV") == "local", reason="Skipping this test on local environment"
|
|
46
|
-
)
|
|
47
45
|
def test_env_var_in_mcp_server(
|
|
48
46
|
assistant_utils, assistant, similarity_check, integration_utils
|
|
49
47
|
):
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
from codemie_test_harness.tests.utils.env_resolver import EnvironmentResolver
|
|
2
2
|
|
|
3
3
|
import pytest
|
|
4
4
|
|
|
@@ -11,13 +11,14 @@ from codemie_test_harness.tests.test_data.mcp_server_test_data import (
|
|
|
11
11
|
fetch_server_prompt,
|
|
12
12
|
)
|
|
13
13
|
|
|
14
|
+
pytestmark = pytest.mark.skipif(
|
|
15
|
+
EnvironmentResolver.is_localhost(), reason="Skipping this test on local environment"
|
|
16
|
+
)
|
|
17
|
+
|
|
14
18
|
|
|
15
19
|
@pytest.mark.assistant
|
|
16
20
|
@pytest.mark.mcp
|
|
17
21
|
@pytest.mark.regression
|
|
18
|
-
@pytest.mark.skipif(
|
|
19
|
-
os.getenv("ENV") == "local", reason="Skipping this test on local environment"
|
|
20
|
-
)
|
|
21
22
|
@pytest.mark.parametrize(
|
|
22
23
|
"mcp_server",
|
|
23
24
|
time_mcp_server_test_data,
|
|
@@ -41,9 +42,6 @@ def test_creation_mcp_server_with_form_configuration(
|
|
|
41
42
|
@pytest.mark.assistant
|
|
42
43
|
@pytest.mark.mcp
|
|
43
44
|
@pytest.mark.regression
|
|
44
|
-
@pytest.mark.skipif(
|
|
45
|
-
os.getenv("ENV") == "local", reason="Skipping this test on local environment"
|
|
46
|
-
)
|
|
47
45
|
def test_fetch_mcp_server(assistant_utils, assistant, similarity_check):
|
|
48
46
|
assistant = assistant(mcp_server=FETCH_MCP_SERVER)
|
|
49
47
|
|
codemie_test_harness/tests/assistant/tools/notification/test_assistant_notification_tools.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
1
|
import pytest
|
|
4
2
|
from hamcrest import assert_that, equal_to
|
|
5
3
|
|
|
6
4
|
from codemie_sdk.models.integration import CredentialTypes
|
|
7
5
|
from codemie_test_harness.tests.enums.tools import Toolkit, NotificationTool
|
|
8
6
|
from codemie_test_harness.tests.utils.aws_parameters_store import CredentialsUtil
|
|
7
|
+
from codemie_test_harness.tests.enums.environment import Environment
|
|
8
|
+
from codemie_test_harness.tests.utils.env_resolver import get_environment
|
|
9
9
|
from codemie_test_harness.tests.test_data.notification_tools_test_data import (
|
|
10
10
|
EMAIL_TOOL_PROMPT,
|
|
11
11
|
EMAIL_RESPONSE,
|
|
@@ -21,7 +21,7 @@ from codemie_test_harness.tests.test_data.notification_tools_test_data import (
|
|
|
21
21
|
@pytest.mark.email
|
|
22
22
|
@pytest.mark.regression
|
|
23
23
|
@pytest.mark.skipif(
|
|
24
|
-
|
|
24
|
+
get_environment() in [Environment.LOCALHOST, Environment.GCP],
|
|
25
25
|
reason="Skipping this test on local environment",
|
|
26
26
|
)
|
|
27
27
|
def test_assistant_with_email_tool(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
from codemie_test_harness.tests.utils.env_resolver import EnvironmentResolver
|
|
2
2
|
|
|
3
3
|
import pytest
|
|
4
4
|
|
|
@@ -13,7 +13,8 @@ from codemie_test_harness.tests.test_data.open_api_tools_test_data import (
|
|
|
13
13
|
@pytest.mark.regression
|
|
14
14
|
@pytest.mark.testcase("EPMCDME-6127")
|
|
15
15
|
@pytest.mark.skipif(
|
|
16
|
-
|
|
16
|
+
EnvironmentResolver.is_azure(),
|
|
17
|
+
reason="Still have an issue with encoding long strings",
|
|
17
18
|
)
|
|
18
19
|
@pytest.mark.parametrize(
|
|
19
20
|
"tool_name,prompt,expected_response",
|
|
File without changes
|
codemie_test_harness/tests/assistant/tools/report_portal/test_assistant_report_portal_tools.py
ADDED
|
@@ -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)
|
|
@@ -52,6 +52,10 @@ from codemie_test_harness.tests.utils.yaml_utils import (
|
|
|
52
52
|
StateModel,
|
|
53
53
|
prepare_yaml_content,
|
|
54
54
|
)
|
|
55
|
+
from codemie_test_harness.tests.utils.env_resolver import (
|
|
56
|
+
EnvironmentResolver,
|
|
57
|
+
get_environment,
|
|
58
|
+
)
|
|
55
59
|
|
|
56
60
|
logger = setup_logger(__name__)
|
|
57
61
|
|
|
@@ -84,7 +88,7 @@ def pytest_configure(config):
|
|
|
84
88
|
|
|
85
89
|
# Get dotenv configuration from AWS Parameter Store
|
|
86
90
|
dotenv = aws_parameters_store.get_parameter(
|
|
87
|
-
f"/codemie/autotests/dotenv/{
|
|
91
|
+
f"/codemie/autotests/dotenv/{str(get_environment())}"
|
|
88
92
|
)
|
|
89
93
|
|
|
90
94
|
# Safely update .env file with new content
|
|
@@ -374,6 +378,17 @@ def keycloak_integration(integration_utils):
|
|
|
374
378
|
integration_utils.delete_integration(integration)
|
|
375
379
|
|
|
376
380
|
|
|
381
|
+
@pytest.fixture(scope="module")
|
|
382
|
+
def report_portal_integration(integration_utils):
|
|
383
|
+
credential_values = CredentialsUtil.report_portal_credentials()
|
|
384
|
+
integration = integration_utils.create_integration(
|
|
385
|
+
CredentialTypes.REPORT_PORTAL, credential_values
|
|
386
|
+
)
|
|
387
|
+
yield integration
|
|
388
|
+
if integration:
|
|
389
|
+
integration_utils.delete_integration(integration)
|
|
390
|
+
|
|
391
|
+
|
|
377
392
|
@pytest.fixture(scope="function")
|
|
378
393
|
def general_integration(integration_utils):
|
|
379
394
|
created_integration: Optional[Integration] = None
|
|
@@ -826,7 +841,7 @@ def cloud_integration(integration_utils):
|
|
|
826
841
|
|
|
827
842
|
def pytest_sessionfinish(session):
|
|
828
843
|
"""Run cleanup code after all tests have finished."""
|
|
829
|
-
clean_up_timeout = 1 if
|
|
844
|
+
clean_up_timeout = 1 if EnvironmentResolver.is_production() else 0
|
|
830
845
|
if os.getenv("CLEANUP_DATA", "true").lower() == "true":
|
|
831
846
|
client = get_client()
|
|
832
847
|
prefix = autotest_entity_prefix
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Environment enumeration for CodeMie test harness.
|
|
3
|
+
|
|
4
|
+
This enum defines all supported environments for the CodeMie platform,
|
|
5
|
+
providing type safety and preventing typos in environment checks.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from enum import Enum
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Environment(Enum):
|
|
13
|
+
"""
|
|
14
|
+
Enumeration of supported CodeMie environments.
|
|
15
|
+
|
|
16
|
+
Each environment corresponds to a specific deployment of the CodeMie platform
|
|
17
|
+
with its own domain patterns and configuration requirements.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
PRODUCTION = "prod"
|
|
21
|
+
PREVIEW = "preview"
|
|
22
|
+
LOCALHOST = "localhost"
|
|
23
|
+
AZURE = "azure"
|
|
24
|
+
GCP = "gcp"
|
|
25
|
+
AWS = "aws"
|
|
26
|
+
UNKNOWN = "unknown"
|
|
27
|
+
|
|
28
|
+
def __str__(self) -> str:
|
|
29
|
+
"""Return the string value of the environment."""
|
|
30
|
+
return self.value
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def is_production(self) -> bool:
|
|
34
|
+
"""Check if this is the production environment."""
|
|
35
|
+
return self == Environment.PRODUCTION
|
|
36
|
+
|
|
37
|
+
@property
|
|
38
|
+
def is_preview(self) -> bool:
|
|
39
|
+
"""Check if this is the preview environment."""
|
|
40
|
+
return self == Environment.PREVIEW
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def is_localhost(self) -> bool:
|
|
44
|
+
"""Check if this is the localhost environment."""
|
|
45
|
+
return self == Environment.LOCALHOST
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def is_sandbox(self) -> bool:
|
|
49
|
+
"""Check if this is any sandbox environment (azure, gcp, aws)."""
|
|
50
|
+
return self in (Environment.AZURE, Environment.GCP, Environment.AWS)
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def is_azure(self) -> bool:
|
|
54
|
+
"""Check if this is the Azure sandbox environment."""
|
|
55
|
+
return self == Environment.AZURE
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def is_gcp(self) -> bool:
|
|
59
|
+
"""Check if this is the GCP sandbox environment."""
|
|
60
|
+
return self == Environment.GCP
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def is_aws(self) -> bool:
|
|
64
|
+
"""Check if this is the AWS sandbox environment."""
|
|
65
|
+
return self == Environment.AWS
|
|
66
|
+
|
|
67
|
+
@classmethod
|
|
68
|
+
def get_all_sandbox_environments(cls) -> List["Environment"]:
|
|
69
|
+
"""Get all sandbox environments as enum values."""
|
|
70
|
+
return [cls.AZURE, cls.GCP, cls.AWS]
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def get_all_environments(cls) -> List["Environment"]:
|
|
74
|
+
"""Get all available environments."""
|
|
75
|
+
return list(cls)
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def get_azure_environments(cls) -> List["Environment"]:
|
|
79
|
+
"""Get environments where Azure services are available.
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
List of Environment enums: [PREVIEW, AZURE, LOCALHOST]
|
|
83
|
+
"""
|
|
84
|
+
return [cls.PREVIEW, cls.AZURE, cls.LOCALHOST]
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def get_gcp_environments(cls) -> List["Environment"]:
|
|
88
|
+
"""Get environments where GCP services are available.
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
List of Environment enums: [PREVIEW, GCP, LOCALHOST]
|
|
92
|
+
"""
|
|
93
|
+
return [cls.PREVIEW, cls.GCP, cls.LOCALHOST]
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def get_aws_environments(cls) -> List["Environment"]:
|
|
97
|
+
"""Get environments where AWS services are available.
|
|
98
|
+
|
|
99
|
+
Returns:
|
|
100
|
+
List of Environment enums: [PREVIEW, AWS, LOCALHOST]
|
|
101
|
+
"""
|
|
102
|
+
return [cls.PREVIEW, cls.AWS, cls.LOCALHOST]
|
|
@@ -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"
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
1
|
import pytest
|
|
4
2
|
|
|
5
3
|
from codemie_sdk.models.integration import (
|
|
@@ -11,8 +9,8 @@ from codemie_test_harness.tests.enums.tools import (
|
|
|
11
9
|
NotificationTool,
|
|
12
10
|
ProjectManagementTool,
|
|
13
11
|
CodeBaseTool,
|
|
14
|
-
CloudTool,
|
|
15
12
|
AccessManagementTool,
|
|
13
|
+
ReportPortalTool,
|
|
16
14
|
)
|
|
17
15
|
from codemie_test_harness.tests.test_data.ado_test_plan_tools_test_data import (
|
|
18
16
|
ado_test_plan_get_test_data,
|
|
@@ -36,11 +34,16 @@ from codemie_test_harness.tests.test_data.pm_tools_test_data import (
|
|
|
36
34
|
JIRA_TOOL_PROMPT,
|
|
37
35
|
RESPONSE_FOR_JIRA_TOOL,
|
|
38
36
|
)
|
|
37
|
+
from codemie_test_harness.tests.test_data.report_portal_tools_test_data import (
|
|
38
|
+
rp_test_data,
|
|
39
|
+
)
|
|
39
40
|
from codemie_test_harness.tests.utils.aws_parameters_store import CredentialsUtil
|
|
41
|
+
from codemie_test_harness.tests.enums.environment import Environment
|
|
40
42
|
from codemie_test_harness.tests.utils.constants import test_project_name
|
|
43
|
+
from codemie_test_harness.tests.utils.env_resolver import get_environment
|
|
41
44
|
|
|
42
45
|
pytestmark = pytest.mark.skipif(
|
|
43
|
-
|
|
46
|
+
get_environment() in [Environment.LOCALHOST, Environment.GCP],
|
|
44
47
|
reason="Skipping this test on local environment",
|
|
45
48
|
)
|
|
46
49
|
|
|
@@ -55,12 +58,6 @@ pytestmark = pytest.mark.skipif(
|
|
|
55
58
|
@pytest.mark.parametrize(
|
|
56
59
|
"toolkit, tool_name, credential_type, credentials, prompt, expected_response",
|
|
57
60
|
cloud_test_data,
|
|
58
|
-
ids=[
|
|
59
|
-
f"{Toolkit.CLOUD}_{CloudTool.AWS}",
|
|
60
|
-
f"{Toolkit.CLOUD}_{CloudTool.AZURE}",
|
|
61
|
-
f"{Toolkit.CLOUD}_{CloudTool.GCP}",
|
|
62
|
-
f"{Toolkit.CLOUD}_{CloudTool.KUBERNETES}",
|
|
63
|
-
],
|
|
64
61
|
)
|
|
65
62
|
def test_assistant_with_default_integration_cloud(
|
|
66
63
|
general_integration,
|
|
@@ -143,7 +140,6 @@ def test_assistant_with_default_integration_ado(
|
|
|
143
140
|
@pytest.mark.parametrize(
|
|
144
141
|
"toolkit, tool_name, credentials, prompt, expected_response",
|
|
145
142
|
sonar_tools_test_data,
|
|
146
|
-
ids=[f"{row[0]}_{row[1]}" for row in sonar_tools_test_data],
|
|
147
143
|
)
|
|
148
144
|
def test_assistant_with_default_integration_codebase(
|
|
149
145
|
general_integration,
|
|
@@ -314,7 +310,6 @@ def test_assistant_with_default_integration_email(
|
|
|
314
310
|
@pytest.mark.project_integration
|
|
315
311
|
@pytest.mark.default_integration
|
|
316
312
|
@pytest.mark.regression
|
|
317
|
-
@pytest.mark.regression
|
|
318
313
|
def test_assistant_with_default_integration_keycloak(
|
|
319
314
|
general_integration,
|
|
320
315
|
integration_utils,
|
|
@@ -344,3 +339,43 @@ def test_assistant_with_default_integration_keycloak(
|
|
|
344
339
|
response = assistant_utils.ask_assistant(keycloak_assistant, KEYCLOAK_TOOL_PROMPT)
|
|
345
340
|
|
|
346
341
|
similarity_check.check_similarity(response, KEYCLOAK_TOOL_RESPONSE)
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
@pytest.mark.assistant
|
|
345
|
+
@pytest.mark.report_portal
|
|
346
|
+
@pytest.mark.integration
|
|
347
|
+
@pytest.mark.project_integration
|
|
348
|
+
@pytest.mark.default_integration
|
|
349
|
+
@pytest.mark.regression
|
|
350
|
+
def test_assistant_with_default_integration_report_portal(
|
|
351
|
+
general_integration,
|
|
352
|
+
integration_utils,
|
|
353
|
+
assistant,
|
|
354
|
+
assistant_utils,
|
|
355
|
+
similarity_check,
|
|
356
|
+
):
|
|
357
|
+
prompt = rp_test_data[7][2]
|
|
358
|
+
expected_response = rp_test_data[7][3]
|
|
359
|
+
|
|
360
|
+
# delete existing integrations of the same type
|
|
361
|
+
for integration_type in IntegrationType:
|
|
362
|
+
integration_utils.delete_integrations_by_type(
|
|
363
|
+
integration_type, CredentialTypes.REPORT_PORTAL, test_project_name
|
|
364
|
+
)
|
|
365
|
+
# create a new integration
|
|
366
|
+
general_integration(
|
|
367
|
+
integration_type=IntegrationType.PROJECT,
|
|
368
|
+
credential_type=CredentialTypes.REPORT_PORTAL,
|
|
369
|
+
credential_values=CredentialsUtil.report_portal_credentials(),
|
|
370
|
+
project_name=test_project_name,
|
|
371
|
+
)
|
|
372
|
+
# create an assistant
|
|
373
|
+
report_portal_assistant = assistant(
|
|
374
|
+
Toolkit.REPORT_PORTAL,
|
|
375
|
+
ReportPortalTool.GET_DASHBOARD_DATA,
|
|
376
|
+
project_name=test_project_name,
|
|
377
|
+
)
|
|
378
|
+
|
|
379
|
+
response = assistant_utils.ask_assistant(report_portal_assistant, prompt)
|
|
380
|
+
|
|
381
|
+
similarity_check.check_similarity(response, expected_response)
|