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

@@ -12,7 +12,7 @@ except Exception:
12
12
  from .constants import CONSOLE
13
13
 
14
14
 
15
- def _resolve_tests_path_and_root() -> tuple[str, str]:
15
+ def resolve_tests_path_and_root() -> tuple[str, str]:
16
16
  """Resolve tests path and working directory.
17
17
 
18
18
  Returns:
@@ -46,7 +46,7 @@ def _resolve_tests_path_and_root() -> tuple[str, str]:
46
46
  def build_pytest_cmd(
47
47
  workers: int, marks: str, reruns: int, extra: Iterable[str] | None = None
48
48
  ) -> tuple[List[str], str]:
49
- tests_path, root_dir = _resolve_tests_path_and_root()
49
+ tests_path, root_dir = resolve_tests_path_and_root()
50
50
  cmd = [sys.executable, "-m", "pytest", tests_path]
51
51
  if workers:
52
52
  cmd += ["-n", str(workers)]
@@ -6,8 +6,11 @@ from pathlib import Path
6
6
  from dotenv import load_dotenv
7
7
 
8
8
  from codemie_test_harness.tests.utils.aws_parameters_store import AwsParameterStore
9
+ from codemie_test_harness.cli.runner import resolve_tests_path_and_root
9
10
 
10
- load_dotenv()
11
+ _, root_dir = resolve_tests_path_and_root()
12
+ env_file_path = Path(root_dir) / ".env"
13
+ load_dotenv(env_file_path)
11
14
 
12
15
  if os.getenv("AWS_ACCESS_KEY") and os.getenv("AWS_SECRET_KEY"):
13
16
  aws_parameters_store = AwsParameterStore.get_instance(
@@ -20,10 +23,13 @@ if os.getenv("AWS_ACCESS_KEY") and os.getenv("AWS_SECRET_KEY"):
20
23
  f"/codemie/autotests/dotenv/{os.getenv('ENV')}"
21
24
  )
22
25
 
23
- with open(Path(__file__).parent.parent / ".env", "w") as file:
26
+ # Use the .env path that was loaded
27
+
28
+ with open(env_file_path, "w") as file:
24
29
  file.write(dotenv)
25
30
 
26
- load_dotenv()
31
+ # Reload .env file with AWS parameters
32
+ load_dotenv(env_file_path)
27
33
 
28
34
  LANGFUSE_TRACES_ENABLED = (
29
35
  os.getenv("LANGFUSE_TRACES_ENABLED", "false").lower() == "true"
@@ -1,6 +1,7 @@
1
1
  """Tests for Confluence datasource operations - Final version."""
2
2
 
3
3
  import os
4
+
4
5
  import pytest
5
6
  from hamcrest import assert_that, equal_to
6
7
  from requests import HTTPError
@@ -8,31 +9,60 @@ from requests import HTTPError
8
9
  from codemie_test_harness.tests.test_data.pm_tools_test_data import (
9
10
  CONFLUENCE_TOOL_PROMPT,
10
11
  RESPONSE_FOR_CONFLUENCE_TOOL,
12
+ CONFLUENCE_CLOUD_TOOL_PROMPT,
13
+ RESPONSE_FOR_CONFLUENCE_CLOUD_TOOL,
11
14
  )
15
+ from codemie_test_harness.tests.utils.aws_parameters_store import CredentialsUtil
12
16
  from codemie_test_harness.tests.utils.base_utils import get_random_name, assert_response
13
17
 
14
18
 
19
+ @pytest.fixture(scope="function")
20
+ def confluence_cloud_datasource(datasource_utils, confluence_cloud_integration):
21
+ datasource = datasource_utils.create_confluence_datasource(
22
+ setting_id=confluence_cloud_integration.id,
23
+ cql=CredentialsUtil.confluence_cloud_jql(),
24
+ )
25
+ yield datasource
26
+ if datasource:
27
+ datasource_utils.delete_datasource(datasource)
28
+
29
+
15
30
  @pytest.mark.regression
16
- def test_create_datasource_with_confluence_integration(
31
+ @pytest.mark.parametrize(
32
+ "datasource_fixture, prompt, expected_response",
33
+ [
34
+ ("confluence_datasource", CONFLUENCE_TOOL_PROMPT, RESPONSE_FOR_CONFLUENCE_TOOL),
35
+ (
36
+ "confluence_cloud_datasource",
37
+ CONFLUENCE_CLOUD_TOOL_PROMPT,
38
+ RESPONSE_FOR_CONFLUENCE_CLOUD_TOOL,
39
+ ),
40
+ ],
41
+ ids=["Confluence", "Confluence Cloud"],
42
+ )
43
+ def test_create_datasource_with_confluence_and_confluence_cloud_integration(
44
+ request,
17
45
  assistant,
18
46
  assistant_utils,
19
47
  datasource_utils,
20
- confluence_datasource,
21
48
  kb_context,
22
- default_llm,
23
49
  similarity_check,
50
+ datasource_fixture,
51
+ prompt,
52
+ expected_response,
24
53
  ):
25
- assistant = assistant(context=kb_context(confluence_datasource))
54
+ datasource = request.getfixturevalue(datasource_fixture)
55
+ assistant = assistant(context=kb_context(datasource))
26
56
 
27
- response = assistant_utils.ask_assistant(assistant, CONFLUENCE_TOOL_PROMPT)
28
- similarity_check.check_similarity(response, RESPONSE_FOR_CONFLUENCE_TOOL)
57
+ response = assistant_utils.ask_assistant(assistant, prompt)
58
+ similarity_check.check_similarity(response, expected_response)
29
59
 
30
60
  datasource_utils.update_confluence_datasource(
31
- confluence_datasource.id, full_reindex=True, skip_reindex=False
61
+ datasource.id, full_reindex=True, skip_reindex=False
32
62
  )
33
63
 
34
- response = assistant_utils.ask_assistant(assistant, CONFLUENCE_TOOL_PROMPT)
35
- similarity_check.check_similarity(response, RESPONSE_FOR_CONFLUENCE_TOOL)
64
+ response = assistant_utils.ask_assistant(assistant, prompt)
65
+ similarity_check.check_similarity(response, expected_response)
36
66
 
37
67
 
38
68
  @pytest.mark.regression
@@ -51,7 +81,7 @@ def test_edit_description_for_confluence_data_source(
51
81
 
52
82
  @pytest.mark.regression
53
83
  def test_create_confluence_datasource_with_existing_name(
54
- confluence_datasource, datasource_utils
84
+ datasource_utils, confluence_datasource
55
85
  ):
56
86
  datasource = datasource_utils.get_datasource(confluence_datasource.id)
57
87
 
@@ -8,36 +8,60 @@ from requests import HTTPError
8
8
  from codemie_test_harness.tests.test_data.pm_tools_test_data import (
9
9
  JIRA_TOOL_PROMPT,
10
10
  RESPONSE_FOR_JIRA_TOOL,
11
+ JIRA_CLOUD_TOOL_PROMPT,
12
+ RESPONSE_FOR_JIRA_CLOUD_TOOL,
11
13
  )
14
+ from codemie_test_harness.tests.utils.aws_parameters_store import CredentialsUtil
12
15
  from codemie_test_harness.tests.utils.base_utils import get_random_name, assert_response
13
16
 
14
17
 
18
+ @pytest.fixture(scope="function")
19
+ def jira_cloud_datasource(datasource_utils, jira_cloud_integration):
20
+ datasource = datasource_utils.create_jira_datasource(
21
+ setting_id=jira_cloud_integration.id, jql=CredentialsUtil.jira_cloud_jql()
22
+ )
23
+ yield datasource
24
+ if datasource:
25
+ datasource_utils.delete_datasource(datasource)
26
+
27
+
15
28
  @pytest.mark.regression
16
- def test_create_datasource_with_jira_integration(
29
+ @pytest.mark.parametrize(
30
+ "datasource_fixture, prompt, expected_response",
31
+ [
32
+ ("jira_datasource", JIRA_TOOL_PROMPT, RESPONSE_FOR_JIRA_TOOL),
33
+ ("jira_cloud_datasource", JIRA_CLOUD_TOOL_PROMPT, RESPONSE_FOR_JIRA_CLOUD_TOOL),
34
+ ],
35
+ ids=["Jira", "Jira Cloud"],
36
+ )
37
+ def test_create_datasource_with_jira_and_jira_cloud_integration(
38
+ request,
17
39
  assistant,
18
40
  assistant_utils,
19
41
  datasource_utils,
20
- jira_datasource,
21
42
  kb_context,
22
- default_llm,
23
43
  similarity_check,
44
+ datasource_fixture,
45
+ prompt,
46
+ expected_response,
24
47
  ):
25
- assistant = assistant(context=kb_context(jira_datasource))
48
+ datasource = request.getfixturevalue(datasource_fixture)
49
+ assistant = assistant(context=kb_context(datasource))
26
50
 
27
- response = assistant_utils.ask_assistant(assistant, JIRA_TOOL_PROMPT)
28
- similarity_check.check_similarity(response, RESPONSE_FOR_JIRA_TOOL)
51
+ response = assistant_utils.ask_assistant(assistant, prompt)
52
+ similarity_check.check_similarity(response, response)
29
53
 
30
54
  datasource_utils.update_jira_datasource(
31
- jira_datasource.id, full_reindex=True, skip_reindex=False
55
+ datasource.id, full_reindex=True, skip_reindex=False
32
56
  )
33
57
 
34
- response = assistant_utils.ask_assistant(assistant, JIRA_TOOL_PROMPT)
35
- similarity_check.check_similarity(response, RESPONSE_FOR_JIRA_TOOL)
58
+ response = assistant_utils.ask_assistant(assistant, prompt)
59
+ similarity_check.check_similarity(response, response)
36
60
 
37
61
 
38
62
  @pytest.mark.regression
39
63
  def test_edit_description_for_jira_data_source(
40
- client, jira_datasource, datasource_utils
64
+ client, datasource_utils, jira_datasource
41
65
  ):
42
66
  updated_description = get_random_name()
43
67
 
@@ -50,7 +74,7 @@ def test_edit_description_for_jira_data_source(
50
74
 
51
75
 
52
76
  @pytest.mark.regression
53
- def test_create_jira_datasource_with_existing_name(jira_datasource, datasource_utils):
77
+ def test_create_jira_datasource_with_existing_name(datasource_utils, jira_datasource):
54
78
  datasource = datasource_utils.get_datasource(jira_datasource.id)
55
79
 
56
80
  try:
@@ -72,10 +72,20 @@ CONFLUENCE_CLOUD_TOOL_PROMPT = """
72
72
  relative_url='/rest/api/content/search'
73
73
  method='GET'
74
74
  params='{'cql': 'title ~ "codemie"', 'limit': 5, 'expand': 'body.storage'}'
75
+ or Search Kb tool
76
+ and return the page content
75
77
  """
76
78
 
77
79
  RESPONSE_FOR_CONFLUENCE_CLOUD_TOOL = """
78
- I found one page related to "codemie":
79
- - **Title:** [Codemie Platform](https://codemie-test.atlassian.net/wiki/spaces/~71202043303b83370a486ea6ba5a1da8884d63/pages/131223/Codemie+Platform)
80
- Let me know if you need more information regarding this page or anything else.
80
+ Here are some pages related to "codemie" from the Confluence space:
81
+ Codemie Platform
82
+ Title: Codemie Platform
83
+ URL: Codemie Platform
84
+ Description: This page mentions that "Codemie Platform is the best one."
85
+
86
+ CODEMIE Overview
87
+ Title: CODEMIE
88
+ URL: CODEMIE Overview
89
+ Description: This space includes a section for describing the purpose of the space, a search feature, and a filter by label functionality.
90
+ If you need more detailed information about a specific page, please let me know!
81
91
  """
@@ -1,8 +1,12 @@
1
1
  import os
2
+ from pathlib import Path
2
3
 
3
4
  from dotenv import load_dotenv
5
+ from codemie_test_harness.cli.runner import resolve_tests_path_and_root
4
6
 
5
- load_dotenv()
7
+ _, root_dir = resolve_tests_path_and_root()
8
+ env_path = Path(root_dir) / ".env"
9
+ load_dotenv(env_path)
6
10
 
7
11
  api_domain = os.getenv("CODEMIE_API_DOMAIN")
8
12
  verify_ssl = os.getenv("VERIFY_SSL", "").lower() == "true"
@@ -563,3 +563,15 @@ class CredentialsUtil:
563
563
  if cred.key == "kubernetes_token":
564
564
  cred.value = "wrong_token"
565
565
  return credentials
566
+
567
+ @staticmethod
568
+ def jira_cloud_jql() -> str:
569
+ jira_creds = AwsParameterStore.get_cloud_provider_credentials("jira")
570
+ return jira_creds.get("jiracloud", {}).get("jql")
571
+
572
+ @staticmethod
573
+ def confluence_cloud_jql() -> str:
574
+ confluence_creds = AwsParameterStore.get_cloud_provider_credentials(
575
+ "confluence"
576
+ )
577
+ return confluence_creds.get("confluencecloud", {}).get("cql")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: codemie-test-harness
3
- Version: 0.1.132
3
+ Version: 0.1.134
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.132)
16
+ Requires-Dist: codemie-sdk-python (==0.1.134)
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)
@@ -6,17 +6,17 @@ codemie_test_harness/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
6
6
  codemie_test_harness/cli/commands/config_cmd.py,sha256=iCV7qJZrESIKZQdg_AmhuPz1EZLN2s-UpbdzzIjrVEU,1353
7
7
  codemie_test_harness/cli/commands/run_cmd.py,sha256=T5js1hwHKi1QuF-kLwP3c-GMtiO9QO15H3JJc7nzpp4,1052
8
8
  codemie_test_harness/cli/constants.py,sha256=956_apPJ4MjhnKo1ZtDooXCd2N89J3vyAB-J9-SOr7U,1637
9
- codemie_test_harness/cli/runner.py,sha256=IQC7up2qnQoOMf_oCAGSY-dfQbAXH1gnrar0_NM0wME,2351
9
+ codemie_test_harness/cli/runner.py,sha256=5VAL4noqiKrGjo5oYVJKzt4QNmkZFTe1Mw6Mll9uGfc,2349
10
10
  codemie_test_harness/cli/utils.py,sha256=NlRa8VFbXTbD74jfUaSqbccGNu2R1dUIg8d5SyDTmIM,1136
11
11
  codemie_test_harness/pytest.ini,sha256=Sxr-zVHZ9hJt2Ks0x7xxjh_SA-KhD-vRrDWAfDd9QKs,192
12
- codemie_test_harness/tests/__init__.py,sha256=VD47b_NmFnTzr1RxAY9NllZMESBxKWeaEXS_xJo4zls,1015
12
+ codemie_test_harness/tests/__init__.py,sha256=ASrWeb7WAqehvQkvz3g6h57stJuWAPj7jMG6vPvYalE,1257
13
13
  codemie_test_harness/tests/assistant/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  codemie_test_harness/tests/assistant/datasource/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  codemie_test_harness/tests/assistant/datasource/test_code_datasource.py,sha256=NZmw3efv_FBkyi-1FnkQjNknlg34w4PEFv0rodUvCFw,2599
16
- codemie_test_harness/tests/assistant/datasource/test_confluence_datasource.py,sha256=cj7O4Sr1YohqKLD_bycfpQL0ugFmpJ2ZCWurlAUKkO8,2248
16
+ codemie_test_harness/tests/assistant/datasource/test_confluence_datasource.py,sha256=woV0grYUPqj8SNNdfbhnNvVdgGTC2Bca35JUWloSJM4,3206
17
17
  codemie_test_harness/tests/assistant/datasource/test_file_indexing.py,sha256=VC3kFcbaOIMMN2-tCmwC4QdZLRGdCiMf1Dq7ZMFZNBE,5536
18
18
  codemie_test_harness/tests/assistant/datasource/test_google_datasource.py,sha256=G1nj0Toj4SFVnfVpec5J9kKEfmzzl15G2-jtQolY4MA,2224
19
- codemie_test_harness/tests/assistant/datasource/test_jira_datasource.py,sha256=FeWP8RhtyWTkB4rftEn_BCPWKVDtgGoEVPX9jbKl2Dw,2122
19
+ codemie_test_harness/tests/assistant/datasource/test_jira_datasource.py,sha256=s5MROPK0kGaX0-3WZFZbd35MzIHOrJ9GdtrTYSWz5P8,2951
20
20
  codemie_test_harness/tests/assistant/default_integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  codemie_test_harness/tests/assistant/default_integrations/test_default_integrations_for_tool.py,sha256=FxYeYhc7EHpFmnDrthQl73BZg6p0beW0JJ5FUj6Kk88,7232
22
22
  codemie_test_harness/tests/assistant/default_integrations/test_default_integrations_for_tool_kit.py,sha256=XgRn2bNCazNO5nml0ZXWqv4VuDGocCl6PbP5bopnyVA,7503
@@ -140,7 +140,7 @@ codemie_test_harness/tests/test_data/open_api_tools_test_data.py,sha256=XhVzelRX
140
140
  codemie_test_harness/tests/test_data/openapi.json,sha256=X4uqtfjpTUuMifefQRf8mHI1k8pspp8-L0rpJlhLOI4,10459
141
141
  codemie_test_harness/tests/test_data/output_schema_test_data.py,sha256=4l7AvXbMl9hIvoFxu1LPPSGz9hb5Uz2_is4zTm77ARY,261
142
142
  codemie_test_harness/tests/test_data/plugin_tools_test_data.py,sha256=OnOKcstocjHSX_kzcsi3QNjAKyMB_nDSwtw9yLzPOoY,2926
143
- codemie_test_harness/tests/test_data/pm_tools_test_data.py,sha256=-H9EF7_0VKiKjSR0Yd1N_ua9QeRT6c23aKLaaQUSu4M,2955
143
+ codemie_test_harness/tests/test_data/pm_tools_test_data.py,sha256=ctPwLSJYy7xPg4B-uwAAhRwIogdxTgBn-PPY2rN0llc,3248
144
144
  codemie_test_harness/tests/test_data/project_management_test_data.py,sha256=gdWlX6xhie7JpLurGjq5S8jBNLpp80fVQy5jV7BjNJk,1207
145
145
  codemie_test_harness/tests/test_data/research_tools_test_data.py,sha256=FtOhWp7PbRdw36IUIa46OBbE2wy8yKZkpI6uwCfSoXQ,4745
146
146
  codemie_test_harness/tests/test_data/servicenow_tools_test_data.py,sha256=PKw9zEYSNcQM1KApCSjsBiA_3Py0bNQI7clqw8cmT-s,1983
@@ -207,9 +207,9 @@ codemie_test_harness/tests/ui/test_workflow_details.py,sha256=PkLMhvQSd3XOYZMj8Q
207
207
  codemie_test_harness/tests/ui/test_workflow_executions_page.py,sha256=9GMFNKtIO3AN8bnaM8XIcoR79X09_vLTF4tbMJ-ebCw,11644
208
208
  codemie_test_harness/tests/ui/test_workflow_templates.py,sha256=A6eaR-7M5VXoPlUJfKIAzqdxVquC1WnzwzMpOg74dwc,4558
209
209
  codemie_test_harness/tests/ui/test_workflows.py,sha256=_UQT9soqxV68aqFt0V3KJ3iJFA55kzE891EJIER9kk8,3464
210
- codemie_test_harness/tests/utils/__init__.py,sha256=IytbI4DHEFmsvw_TJJVUNP6ZB6upkajgpSkw_MAurwc,162
210
+ codemie_test_harness/tests/utils/__init__.py,sha256=Bu1sRfq1DeSYdW979HKcg3LcG-yYHjZWLsPDiy1Wmus,346
211
211
  codemie_test_harness/tests/utils/assistant_utils.py,sha256=2ziNJlLDDso-USjktN32bKX64x9pSkwC_Cj7rKEXlig,5419
212
- codemie_test_harness/tests/utils/aws_parameters_store.py,sha256=GyL4l8Z6jtV2aRtWV3mFDL4sk6OxDT0X5v0yYq3subI,20184
212
+ codemie_test_harness/tests/utils/aws_parameters_store.py,sha256=zpFR3PourK-jPOGkwoWOCx3YIHrx9TZkS5KF-QgbHJY,20612
213
213
  codemie_test_harness/tests/utils/base_utils.py,sha256=tfishCUxO3iEuasWOifoF9_fXspm4uIHS26Ryqu-NxA,5998
214
214
  codemie_test_harness/tests/utils/client_factory.py,sha256=Yyg2iXe7g7fIfIUbOH8z_8qgVo_lB-nYLOfCV5ONXFw,641
215
215
  codemie_test_harness/tests/utils/constants.py,sha256=lb6mgLjt0GM85Khs18rL1jnE9ILx8L811ykNhpF6IDA,1111
@@ -321,7 +321,7 @@ codemie_test_harness/tests/workflow/virtual_assistant_tools/servicenow/__init__.
321
321
  codemie_test_harness/tests/workflow/virtual_assistant_tools/servicenow/test_workflow_with_servicenow_tools.py,sha256=Cxe5Yuy9JE_IEsnQOThpVIZQqpfLuHfDkF6JwLngDc8,890
322
322
  codemie_test_harness/tests/workflow/virtual_assistant_tools/vcs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
323
323
  codemie_test_harness/tests/workflow/virtual_assistant_tools/vcs/test_workflow_with_vcs_tools.py,sha256=tm0NvUf_UtzLPTYJWykYpsNoxoVs-Eh80guDmRwImwg,1106
324
- codemie_test_harness-0.1.132.dist-info/METADATA,sha256=JssHv0o_wKQ6-Zjzq7RY7Kd7fqbhWs3tSsn2r1TTSIg,8998
325
- codemie_test_harness-0.1.132.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
326
- codemie_test_harness-0.1.132.dist-info/entry_points.txt,sha256=n98t-EOM5M1mnMl_j2X4siyeO9zr0WD9a5LF7JyElIM,73
327
- codemie_test_harness-0.1.132.dist-info/RECORD,,
324
+ codemie_test_harness-0.1.134.dist-info/METADATA,sha256=_C34qXz4_gJ9nGFuh1iAbE4fl9w1pEnheiyvxxiVkx8,8998
325
+ codemie_test_harness-0.1.134.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
326
+ codemie_test_harness-0.1.134.dist-info/entry_points.txt,sha256=n98t-EOM5M1mnMl_j2X4siyeO9zr0WD9a5LF7JyElIM,73
327
+ codemie_test_harness-0.1.134.dist-info/RECORD,,