codemie-test-harness 0.1.172__py3-none-any.whl → 0.1.174__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.
@@ -1,306 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: codemie-test-harness
3
- Version: 0.1.172
4
- Summary: Autotest for CodeMie backend and UI
5
- Author: Anton Yeromin
6
- Author-email: anton_yeromin@epam.com
7
- Requires-Python: >=3.12,<4.0
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.12
10
- Classifier: Programming Language :: Python :: 3.13
11
- Requires-Dist: PyHamcrest (>=2.1.0,<3.0.0)
12
- Requires-Dist: aws-assume-role-lib (>=2.10.0,<3.0.0)
13
- Requires-Dist: boto3 (>=1.39.8,<2.0.0)
14
- Requires-Dist: click (>=8.1.7,<9.0.0)
15
- Requires-Dist: codemie-plugins (>=0.1.123,<0.2.0)
16
- Requires-Dist: codemie-sdk-python (==0.1.172)
17
- Requires-Dist: pytest (>=8.4.1,<9.0.0)
18
- Requires-Dist: pytest-playwright (>=0.7.0,<0.8.0)
19
- Requires-Dist: pytest-reportportal (>=5.5.2,<6.0.0)
20
- Requires-Dist: pytest-rerunfailures (>=15.1,<16.0)
21
- Requires-Dist: pytest-xdist (>=3.6.1,<4.0.0)
22
- Requires-Dist: python-dotenv (>=1.1.0,<2.0.0)
23
- Requires-Dist: python-gitlab (>=5.6.0,<6.0.0)
24
- Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
25
- Requires-Dist: tzlocal (>=5.3.1,<6.0.0)
26
- Description-Content-Type: text/markdown
27
-
28
- # CodeMie Test Harness
29
-
30
- End-to-end, integration, and UI test suite for CodeMie services. This repository exercises CodeMie APIs (LLM, assistants, workflows, tools) and common integrations.
31
-
32
- The suite is designed for high-parallel execution (pytest-xdist), resilient runs (pytest-rerunfailures), and optional reporting to ReportPortal.
33
-
34
- ## Table of Contents
35
-
36
- - Part 1: codemie-test-harness command line (recommended)
37
- - Installation
38
- - Configuration (CLI)
39
- - Run with command line
40
- - Useful CLI commands and common markers
41
- - Part 2: Contributors (pytest from repo)
42
- - Install and configure with .env (PREVIEW/AZURE/GCP/AWS/PROD/LOCAL)
43
- - Local with custom GitLab, GitHub, Jira and Confluence tokens
44
- - UI tests (Playwright)
45
- - ReportPortal integration
46
- - Makefile targets
47
- - Troubleshooting
48
-
49
- ---
50
-
51
- ## Part 1: codemie-test-harness command line (recommended)
52
-
53
- Use the CLI to install, configure, and run tests against your custom environment. No .env file is used in this flow. Values are stored in ~/.codemie/test-harness.json.
54
-
55
- ### Installation
56
-
57
- Install from PyPI:
58
-
59
- ```shell
60
- pip install codemie-test-harness
61
- ```
62
-
63
- Tip: Use a virtual environment (e.g., python -m venv .venv && source .venv/bin/activate).
64
-
65
- ### Configuration (CLI)
66
-
67
- Set required Auth/API values once (saved under ~/.codemie/test-harness.json):
68
-
69
- ```shell
70
- codemie-test-harness config set AUTH_SERVER_URL <auth_server_url>
71
- codemie-test-harness config set AUTH_CLIENT_ID <client_id>
72
- codemie-test-harness config set AUTH_CLIENT_SECRET <client_secret>
73
- codemie-test-harness config set AUTH_REALM_NAME <realm_name>
74
- codemie-test-harness config set CODEMIE_API_DOMAIN <codemie_api_domain_url>
75
- ```
76
-
77
- Optional defaults for pytest:
78
-
79
- ```shell
80
- codemie-test-harness config set PYTEST_MARKS "smoke"
81
- codemie-test-harness config set PYTEST_N 8
82
- codemie-test-harness config set PYTEST_RERUNS 2
83
- ```
84
-
85
- Optional integrations used by e2e tests:
86
-
87
- ```shell
88
- # Git provider selection
89
- codemie-test-harness config set GIT_ENV gitlab # or github
90
-
91
- # GitLab
92
- codemie-test-harness config set GITLAB_URL https://gitlab.example.com
93
- codemie-test-harness config set GITLAB_TOKEN <gitlab_token>
94
- codemie-test-harness config set GITLAB_PROJECT https://gitlab.example.com/group/project
95
- codemie-test-harness config set GITLAB_PROJECT_ID 12345
96
-
97
- # GitHub
98
- codemie-test-harness config set GITHUB_URL https://github.com
99
- codemie-test-harness config set GITHUB_TOKEN <github_token>
100
- codemie-test-harness config set GITHUB_PROJECT https://github.com/org/repo
101
-
102
- # Jira
103
- codemie-test-harness config set JIRA_URL https://jira.example.com
104
- codemie-test-harness config set JIRA_TOKEN <jira_token>
105
- codemie-test-harness config set JQL "project = 'EPMCDME' and issuetype = 'Epic' and status = 'Closed'"
106
-
107
- # Confluence
108
- codemie-test-harness config set CONFLUENCE_URL https://confluence.example.com
109
- codemie-test-harness config set CONFLUENCE_TOKEN <confluence_token>
110
- codemie-test-harness config set CQL "space = EPMCDME and type = page and title = 'AQA Backlog Estimation'"
111
- ```
112
-
113
- Notes:
114
- - Quoting is required for values with spaces (e.g., JQL/CQL).
115
- - Resolution precedence when running: CLI flags > environment variables > saved config > defaults.
116
- - Config file path: ~/.codemie/test-harness.json
117
-
118
- ### Run with command line
119
-
120
- Default run (uses saved config or defaults):
121
-
122
- ```shell
123
- codemie-test-harness run
124
- ```
125
-
126
- Override at runtime:
127
-
128
- ```shell
129
- # Change marks, workers, reruns just for this run
130
- codemie-test-harness run --marks "smoke or gitlab or jira_kb" -n 8 --reruns 2
131
- ```
132
-
133
- Provider-specific examples:
134
-
135
- ```shell
136
- # Only GitLab
137
- codemie-test-harness run --marks gitlab
138
-
139
- # Only GitHub
140
- codemie-test-harness run --marks github
141
-
142
- # Jira knowledge base
143
- codemie-test-harness run --marks jira_kb
144
-
145
- # Confluence knowledge base
146
- codemie-test-harness run --marks confluence_kb
147
-
148
- # Code knowledge base
149
- codemie-test-harness --git-env gitlab run --marks code_kb
150
-
151
- # Git tool
152
- codemie-test-harness --git-env github run --marks git
153
- ```
154
-
155
- ### Useful CLI commands and common markers
156
-
157
- CLI basics:
158
-
159
- ```shell
160
- codemie-test-harness --help
161
- codemie-test-harness config list
162
- codemie-test-harness config get AUTH_SERVER_URL
163
- codemie-test-harness config set PYTEST_N 12
164
- ```
165
-
166
- Common markers in this repo include:
167
- - smoke
168
- - mcp
169
- - plugin
170
- - regression
171
- - ui
172
- - jira_kb, confluence_kb, code_kb
173
- - gitlab, github, git
174
-
175
- ---
176
-
177
- ## Part 2: Contributors (pytest from repo)
178
-
179
- This section is for contributors who run tests from a cloned codemie-sdk repository (test-harness package). This flow uses a .env file and may pull values from AWS SSM Parameter Store.
180
-
181
- ### Install and configure with .env (PREVIEW/AZURE/GCP/AWS/PROD/LOCAL)
182
-
183
- 1) Clone the codemie-sdk repository and navigate to the test-harness folder.
184
- 2) Create a .env file in the project root. If you provide AWS credentials, the suite will fetch additional values from AWS Systems Manager Parameter Store and recreate .env accordingly.
185
-
186
- ```properties
187
- ENV=local
188
-
189
- AWS_ACCESS_KEY=<aws_access_token>
190
- AWS_SECRET_KEY=<aws_secret_key>
191
- ```
192
-
193
- ### Local with custom GitLab, GitHub, Jira and Confluence tokens
194
-
195
- 1) Start from a .env populated via AWS (optional)
196
- 2) Replace the tokens below with your personal values
197
- 3) Important: After replacing tokens, remove AWS_ACCESS_KEY and AWS_SECRET_KEY from .env — otherwise they will overwrite your changes next time .env is regenerated
198
-
199
- Full .env example:
200
-
201
- ```properties
202
- ENV=local
203
- PROJECT_NAME=codemie
204
- GIT_ENV=gitlab # required for e2e tests only
205
- DEFAULT_TIMEOUT=60
206
- CLEANUP_DATA=True
207
- LANGFUSE_TRACES_ENABLED=False
208
-
209
- CODEMIE_API_DOMAIN=http://localhost:8080
210
-
211
- FRONTEND_URL=https://localhost:5173/
212
- HEADLESS=False
213
-
214
- NATS_URL=nats://localhost:4222
215
-
216
- TEST_USER_FULL_NAME=dev-codemie-user
217
-
218
- GITLAB_URL=<gitlab_url>
219
- GITLAB_TOKEN=<gitlab_token>
220
- GITLAB_PROJECT=<gitlab_project>
221
- GITLAB_PROJECT_ID=<gitlab_project_id>
222
-
223
- GITHUB_URL=<github_url>
224
- GITHUB_TOKEN=<github_token>
225
- GITHUB_PROJECT=<github_project>
226
-
227
- JIRA_URL=<jira_url>
228
- JIRA_TOKEN=<jira_token>
229
- JQL="project = 'EPMCDME' and issuetype = 'Epic' and status = 'Closed'"
230
-
231
- CONFLUENCE_URL=<confluence_url>
232
- CONFLUENCE_TOKEN=<confluence_token>
233
- CQL="space = EPMCDME and type = page and title = 'AQA Backlog Estimation'"
234
-
235
- RP_API_KEY=<report_portal_api_key>
236
- ```
237
-
238
- Now you can run full or subset packs. Examples:
239
-
240
- ```shell
241
- # All tests except tests that cannot be run in parallel (-n controls the number of workers)
242
- pytest -n 10 -m "not not_for_parallel_run" --reruns 2
243
-
244
- # Tests that cannot be run in parallel
245
- pytest -m not_for_parallel_run --reruns 2
246
-
247
- # Regression tests
248
- pytest -n 10 -m "regression and not not_for_parallel_run" --reruns 2
249
- pytest -m not_for_parallel_run --reruns 3
250
- ```
251
-
252
- Note: "--reruns 2" uses pytest-rerunfailures to improve resiliency in flaky environments.
253
-
254
- ### UI tests (Playwright)
255
-
256
- Install browsers once:
257
-
258
- ```shell
259
- playwright install
260
- ```
261
-
262
- Then run UI pack:
263
-
264
- ```shell
265
- pytest -n 4 -m ui --reruns 2
266
- ```
267
-
268
- Playwright docs: https://playwright.dev/python/docs/intro
269
-
270
- ### ReportPortal integration
271
-
272
- pytest.ini is preconfigured with rp_endpoint, rp_project, and a default rp_launch. To publish results:
273
-
274
- 1) Set RP_API_KEY in .env
275
- 2) Add the flag:
276
-
277
- ```shell
278
- pytest -n 10 -m "regression and not not_for_parallel_run" --reruns 2 --reportportal
279
- ```
280
-
281
- If you need access to the ReportPortal project, contact: Anton Yeromin (anton_yeromin@epam.com).
282
-
283
- ### Makefile targets
284
-
285
- - install — poetry install
286
- - ruff — lint and format with Ruff
287
- - ruff-format — format only
288
- - ruff-fix — apply autofixes
289
- - build — poetry build
290
- - publish — poetry publish
291
-
292
- Example:
293
-
294
- ```shell
295
- make install
296
- make ruff
297
- ```
298
-
299
- ### Troubleshooting
300
-
301
- - Playwright not installed: Run playwright install.
302
- - Headless issues locally: Set HEADLESS=True in .env for CI or False for local debugging.
303
- - Env values keep reverting: Ensure AWS_ACCESS_KEY and AWS_SECRET_KEY are removed after manual edits to .env.
304
- - Authentication failures: Verify AUTH_* variables and CODEMIE_API_DOMAIN are correct for the target environment.
305
- - Slow or flaky runs: Reduce -n, increase timeouts, and/or use --reruns.
306
-