qase-python-commons 3.4.3__py3-none-any.whl → 3.5.0__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 qase-python-commons might be problematic. Click here for more details.
- qase/commons/client/api_v1_client.py +2 -1
- qase/commons/client/api_v2_client.py +11 -5
- qase/commons/config.py +33 -9
- qase/commons/models/config/qaseconfig.py +6 -0
- qase/commons/models/config/run.py +7 -0
- qase/commons/utils.py +17 -0
- {qase_python_commons-3.4.3.dist-info → qase_python_commons-3.5.0.dist-info}/METADATA +1 -1
- {qase_python_commons-3.4.3.dist-info → qase_python_commons-3.5.0.dist-info}/RECORD +10 -10
- {qase_python_commons-3.4.3.dist-info → qase_python_commons-3.5.0.dist-info}/WHEEL +1 -1
- {qase_python_commons-3.4.3.dist-info → qase_python_commons-3.5.0.dist-info}/top_level.txt +0 -0
|
@@ -100,7 +100,8 @@ class ApiV1Client(BaseApiClient):
|
|
|
100
100
|
environment_id=(int(environment_id) if environment_id else None),
|
|
101
101
|
plan_id=(int(plan_id) if plan_id else plan_id),
|
|
102
102
|
is_autotest=True,
|
|
103
|
-
start_time=datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S")
|
|
103
|
+
start_time=datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S"),
|
|
104
|
+
tags=self.config.testops.run.tags
|
|
104
105
|
)
|
|
105
106
|
self.logger.log_debug(f"Creating test run with parameters: {kwargs}")
|
|
106
107
|
try:
|
|
@@ -84,7 +84,7 @@ class ApiV2Client(ApiV1Client):
|
|
|
84
84
|
attachments=[attach.hash for attach in attached],
|
|
85
85
|
steps=steps,
|
|
86
86
|
steps_type=ResultStepsType.CLASSIC,
|
|
87
|
-
params=result.params,
|
|
87
|
+
params=result.params if not self.config.exclude_params else {key: value for key, value in result.params.items() if key not in self.config.exclude_params},
|
|
88
88
|
param_groups=result.param_groups,
|
|
89
89
|
message=result.message,
|
|
90
90
|
defect=self.config.testops.defect,
|
|
@@ -111,10 +111,16 @@ class ApiV2Client(ApiV1Client):
|
|
|
111
111
|
|
|
112
112
|
try:
|
|
113
113
|
prepared_step = {'execution': {}, 'data': {}, 'steps': []}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
if step.execution.status == 'untested':
|
|
115
|
+
prepared_step['execution']['status'] = ResultStepStatus('skipped')
|
|
116
|
+
prepared_step['execution']['duration'] = 0
|
|
117
|
+
prepared_step['execution']['start_time'] = None
|
|
118
|
+
prepared_step['execution']['end_time'] = None
|
|
119
|
+
else:
|
|
120
|
+
prepared_step['execution']['status'] = ResultStepStatus(step.execution.status)
|
|
121
|
+
prepared_step['execution']['duration'] = step.execution.duration
|
|
122
|
+
prepared_step['execution']['start_time'] = step.execution.start_time
|
|
123
|
+
prepared_step['execution']['end_time'] = step.execution.end_time
|
|
118
124
|
|
|
119
125
|
if step.step_type == StepType.TEXT:
|
|
120
126
|
prepared_step['data']['action'] = step.data.action
|
qase/commons/config.py
CHANGED
|
@@ -58,10 +58,16 @@ class ConfigManager:
|
|
|
58
58
|
config.get("debug")
|
|
59
59
|
)
|
|
60
60
|
|
|
61
|
+
if config.get("excludeParams"):
|
|
62
|
+
self.config.set_exclude_params(
|
|
63
|
+
config.get("excludeParams")
|
|
64
|
+
)
|
|
65
|
+
|
|
61
66
|
if config.get("executionPlan"):
|
|
62
67
|
execution_plan = config.get("executionPlan")
|
|
63
68
|
if execution_plan.get("path"):
|
|
64
|
-
self.config.execution_plan.set_path(
|
|
69
|
+
self.config.execution_plan.set_path(
|
|
70
|
+
execution_plan.get("path"))
|
|
65
71
|
|
|
66
72
|
if config.get("testops"):
|
|
67
73
|
testops = config.get("testops")
|
|
@@ -70,13 +76,16 @@ class ConfigManager:
|
|
|
70
76
|
api = testops.get("api")
|
|
71
77
|
|
|
72
78
|
if api.get("host"):
|
|
73
|
-
self.config.testops.api.set_host(
|
|
79
|
+
self.config.testops.api.set_host(
|
|
80
|
+
api.get("host"))
|
|
74
81
|
|
|
75
82
|
if api.get("token"):
|
|
76
|
-
self.config.testops.api.set_token(
|
|
83
|
+
self.config.testops.api.set_token(
|
|
84
|
+
api.get("token"))
|
|
77
85
|
|
|
78
86
|
if testops.get("project"):
|
|
79
|
-
self.config.testops.set_project(
|
|
87
|
+
self.config.testops.set_project(
|
|
88
|
+
testops.get("project"))
|
|
80
89
|
|
|
81
90
|
if testops.get("defect") is not None:
|
|
82
91
|
self.config.testops.set_defect(
|
|
@@ -96,21 +105,28 @@ class ConfigManager:
|
|
|
96
105
|
self.config.testops.run.set_id(run.get("id"))
|
|
97
106
|
|
|
98
107
|
if run.get("title"):
|
|
99
|
-
self.config.testops.run.set_title(
|
|
108
|
+
self.config.testops.run.set_title(
|
|
109
|
+
run.get("title"))
|
|
100
110
|
|
|
101
111
|
if run.get("description"):
|
|
102
|
-
self.config.testops.run.set_description(
|
|
112
|
+
self.config.testops.run.set_description(
|
|
113
|
+
run.get("description"))
|
|
103
114
|
|
|
104
115
|
if run.get("complete") is not None:
|
|
105
116
|
self.config.testops.run.set_complete(
|
|
106
117
|
run.get("complete")
|
|
107
118
|
)
|
|
108
119
|
|
|
120
|
+
if run.get("tags"):
|
|
121
|
+
self.config.testops.run.set_tags(
|
|
122
|
+
[tag.strip() for tag in run.get("tags")])
|
|
123
|
+
|
|
109
124
|
if testops.get("batch"):
|
|
110
125
|
batch = testops.get("batch")
|
|
111
126
|
|
|
112
127
|
if batch.get("size"):
|
|
113
|
-
self.config.testops.batch.set_size(
|
|
128
|
+
self.config.testops.batch.set_size(
|
|
129
|
+
batch.get("size"))
|
|
114
130
|
|
|
115
131
|
if config.get("report"):
|
|
116
132
|
report = config.get("report")
|
|
@@ -122,7 +138,8 @@ class ConfigManager:
|
|
|
122
138
|
connection = report.get("connection")
|
|
123
139
|
|
|
124
140
|
if connection.get("path"):
|
|
125
|
-
self.config.report.connection.set_path(
|
|
141
|
+
self.config.report.connection.set_path(
|
|
142
|
+
connection.get("path"))
|
|
126
143
|
|
|
127
144
|
if connection.get("format"):
|
|
128
145
|
self.config.report.connection.set_format(
|
|
@@ -177,6 +194,10 @@ class ConfigManager:
|
|
|
177
194
|
if key == 'QASE_DEBUG':
|
|
178
195
|
self.config.set_debug(value)
|
|
179
196
|
|
|
197
|
+
if key == 'QASE_EXCLUDE_PARAMS':
|
|
198
|
+
self.config.set_exclude_params(
|
|
199
|
+
[param.strip() for param in value.split(',')])
|
|
200
|
+
|
|
180
201
|
if key == 'QASE_EXECUTION_PLAN_PATH':
|
|
181
202
|
self.config.execution_plan.set_path(value)
|
|
182
203
|
|
|
@@ -207,6 +228,10 @@ class ConfigManager:
|
|
|
207
228
|
if key == 'QASE_TESTOPS_RUN_COMPLETE':
|
|
208
229
|
self.config.testops.run.set_complete(value)
|
|
209
230
|
|
|
231
|
+
if key == 'QASE_TESTOPS_RUN_TAGS':
|
|
232
|
+
self.config.testops.run.set_tags(
|
|
233
|
+
[tag.strip() for tag in value.split(',')])
|
|
234
|
+
|
|
210
235
|
if key == 'QASE_TESTOPS_BATCH_SIZE':
|
|
211
236
|
self.config.testops.batch.set_size(value)
|
|
212
237
|
|
|
@@ -228,6 +253,5 @@ class ConfigManager:
|
|
|
228
253
|
if key == 'QASE_PYTEST_XFAIL_STATUS_XPASS':
|
|
229
254
|
self.config.framework.pytest.xfail_status.set_xpass(value)
|
|
230
255
|
|
|
231
|
-
|
|
232
256
|
except Exception as e:
|
|
233
257
|
self.logger.log("Failed to load config from env vars {e}", "error")
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
|
+
from typing import List
|
|
2
3
|
|
|
3
4
|
from .framework import Framework
|
|
4
5
|
from .report import ReportConfig
|
|
@@ -34,6 +35,7 @@ class QaseConfig(BaseModel):
|
|
|
34
35
|
report: ReportConfig = None
|
|
35
36
|
profilers: list = None
|
|
36
37
|
framework: Framework = None
|
|
38
|
+
exclude_params: list = None
|
|
37
39
|
|
|
38
40
|
def __init__(self):
|
|
39
41
|
self.mode = Mode.off
|
|
@@ -44,6 +46,7 @@ class QaseConfig(BaseModel):
|
|
|
44
46
|
self.execution_plan = ExecutionPlan()
|
|
45
47
|
self.framework = Framework()
|
|
46
48
|
self.profilers = []
|
|
49
|
+
self.exclude_params = []
|
|
47
50
|
|
|
48
51
|
def set_mode(self, mode: str):
|
|
49
52
|
if any(mode == e.value for e in Mode.__members__.values()):
|
|
@@ -64,3 +67,6 @@ class QaseConfig(BaseModel):
|
|
|
64
67
|
|
|
65
68
|
def set_debug(self, debug):
|
|
66
69
|
self.debug = QaseUtils.parse_bool(debug)
|
|
70
|
+
|
|
71
|
+
def set_exclude_params(self, exclude_params: List[str]):
|
|
72
|
+
self.exclude_params = exclude_params
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from typing import List
|
|
1
2
|
from ..basemodel import BaseModel
|
|
2
3
|
from ... import QaseUtils
|
|
3
4
|
|
|
@@ -7,9 +8,12 @@ class RunConfig(BaseModel):
|
|
|
7
8
|
description: str = None
|
|
8
9
|
complete: bool = None
|
|
9
10
|
id: int = None
|
|
11
|
+
tags: List[str] = None
|
|
12
|
+
|
|
10
13
|
|
|
11
14
|
def __init__(self):
|
|
12
15
|
self.complete = True
|
|
16
|
+
self.tags = []
|
|
13
17
|
|
|
14
18
|
def set_title(self, title: str):
|
|
15
19
|
self.title = title
|
|
@@ -22,3 +26,6 @@ class RunConfig(BaseModel):
|
|
|
22
26
|
|
|
23
27
|
def set_id(self, id: int):
|
|
24
28
|
self.id = id
|
|
29
|
+
|
|
30
|
+
def set_tags(self, tags: List[str]):
|
|
31
|
+
self.tags = tags
|
qase/commons/utils.py
CHANGED
|
@@ -2,6 +2,7 @@ import os
|
|
|
2
2
|
import platform
|
|
3
3
|
import threading
|
|
4
4
|
import sys
|
|
5
|
+
from typing import Union, List
|
|
5
6
|
import pip
|
|
6
7
|
import string
|
|
7
8
|
import uuid
|
|
@@ -64,6 +65,22 @@ class QaseUtils:
|
|
|
64
65
|
def get_filename(path) -> str:
|
|
65
66
|
return os.path.basename(path)
|
|
66
67
|
|
|
68
|
+
@staticmethod
|
|
69
|
+
def get_signature(testops_ids: Union[List[int], None], suites: List[str], params: dict) -> str:
|
|
70
|
+
signature_parts = []
|
|
71
|
+
|
|
72
|
+
if testops_ids:
|
|
73
|
+
signature_parts.append(
|
|
74
|
+
f"{'-'.join(map(str, testops_ids))}")
|
|
75
|
+
|
|
76
|
+
for suite in suites:
|
|
77
|
+
signature_parts.append(suite.lower().replace(" ", "_"))
|
|
78
|
+
|
|
79
|
+
for key, val in params.items():
|
|
80
|
+
signature_parts.append(f"{{{key}:{val}}}")
|
|
81
|
+
|
|
82
|
+
return "::".join(signature_parts)
|
|
83
|
+
|
|
67
84
|
|
|
68
85
|
class StringFormatter(string.Formatter):
|
|
69
86
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qase-python-commons
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.5.0
|
|
4
4
|
Summary: A library for Qase TestOps and Qase Report
|
|
5
5
|
Author-email: Qase Team <support@qase.io>
|
|
6
6
|
Project-URL: Homepage, https://github.com/qase-tms/qase-python/tree/main/qase-python-commons
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
qase/commons/__init__.py,sha256=3HI65PJES4Q6YvtkSuRPh6tZboTETJo8wbdHlNYaePU,323
|
|
2
|
-
qase/commons/config.py,sha256=
|
|
2
|
+
qase/commons/config.py,sha256=tRxuaRaTrng5q0fiknlmNSK8I0Rd9Oj_4yPcdKSG1j8,10117
|
|
3
3
|
qase/commons/loader.py,sha256=-MMY4HgSI6q1xq3NaJoq_w4liM73qdFKjYLVCT1E7Pc,1064
|
|
4
4
|
qase/commons/logger.py,sha256=KEQr8G0eFZxlI3LJIaaNWOKD8o3NhKsZD06swXFn3FI,1313
|
|
5
|
-
qase/commons/utils.py,sha256=
|
|
6
|
-
qase/commons/client/api_v1_client.py,sha256=
|
|
7
|
-
qase/commons/client/api_v2_client.py,sha256=
|
|
5
|
+
qase/commons/utils.py,sha256=utPRoYyThLs2tgD1lmjkwJ9KZuE7ZjliUiZkJJWFca0,3330
|
|
6
|
+
qase/commons/client/api_v1_client.py,sha256=8neslPdfbtICTtVZZ6Dqd7VFudVz0kdG30CgeP0PVwk,6215
|
|
7
|
+
qase/commons/client/api_v2_client.py,sha256=GsIrXJcBw6GtzvJjbjMYa0tvUIxEEe4pALRN2LBMKPM,9043
|
|
8
8
|
qase/commons/client/base_api_client.py,sha256=qiK93rXXeLOmp6e3cgsLA4lmrV_rCL1BIi_xUeqFrDE,2613
|
|
9
9
|
qase/commons/exceptions/reporter.py,sha256=dP-Mwcq8HKBOjgu3YqhyULDmDGU09BmT6Fh9HjICaUc,45
|
|
10
10
|
qase/commons/models/__init__.py,sha256=FTt5dYASBX4r6-tQi-_JAUVx4uvJs9GTxROdAZEV6Jo,272
|
|
@@ -20,9 +20,9 @@ qase/commons/models/config/batch.py,sha256=X0H8SVOCCD2pV6LSMqjI-tIjRcLifnrM5Mare
|
|
|
20
20
|
qase/commons/models/config/connection.py,sha256=wK2fGjc0G0rMVVhPnjw_t_M1YWZwANlhwl-awmI7XSo,516
|
|
21
21
|
qase/commons/models/config/framework.py,sha256=sSWKQp18zxiS_79_XDH2hkHLpYEQnyH3bRquaT8XYYY,1803
|
|
22
22
|
qase/commons/models/config/plan.py,sha256=JbAY7qfGXYreXOLa32OLxw6z0paeCCf87-2b1m8xkks,137
|
|
23
|
-
qase/commons/models/config/qaseconfig.py,sha256
|
|
23
|
+
qase/commons/models/config/qaseconfig.py,sha256=ho_22bcouoJb1f68EGffeBs_ovK3DVyfbFrYXwQFrWs,1918
|
|
24
24
|
qase/commons/models/config/report.py,sha256=g3Z2B3Tewaasjc1TMj2mkXxz0Zc1C39sHeTXH0MRM2Y,497
|
|
25
|
-
qase/commons/models/config/run.py,sha256=
|
|
25
|
+
qase/commons/models/config/run.py,sha256=UeZ_1khhKSLbER3pzAl__5iKfDMErvUsXikelc31iKo,682
|
|
26
26
|
qase/commons/models/config/testops.py,sha256=_GT0Px04y2JqhmXdRbqC6vvSm4yRIU74L9Sr6eiYVLU,708
|
|
27
27
|
qase/commons/profilers/__init__.py,sha256=GhKT5hRbHbhAC4GhdyChA8XoAsGQOnIb8S2Z4-fdS7Q,222
|
|
28
28
|
qase/commons/profilers/db.py,sha256=Am1tvvLgJq4_A8JsuSeBGf47BD2lnSX-5KiMjSgr-Ko,391
|
|
@@ -35,7 +35,7 @@ qase/commons/reporters/testops.py,sha256=QEcpJhRqXTn4H_EcTt6vG_jqRgw6DGmgS2ZmysZ
|
|
|
35
35
|
qase/commons/util/__init__.py,sha256=0sRRfrMOIPCHpk9tXM94Pj10qrk18B61qEcbLpRjw_I,74
|
|
36
36
|
qase/commons/util/host_data.py,sha256=n8o5PDs8kELCZZ5GR7Jug6LsgZHWJudU7iRmZHRdrlw,5264
|
|
37
37
|
qase/commons/validators/base.py,sha256=wwSn-4YiuXtfGMGnSKgo9Vm5hAKevVmmfd2Ro6Q7MYQ,173
|
|
38
|
-
qase_python_commons-3.
|
|
39
|
-
qase_python_commons-3.
|
|
40
|
-
qase_python_commons-3.
|
|
41
|
-
qase_python_commons-3.
|
|
38
|
+
qase_python_commons-3.5.0.dist-info/METADATA,sha256=yuRmcDqspFXnzg7YkM_w9AFAyfUVS34GzeM_iTgydvg,1857
|
|
39
|
+
qase_python_commons-3.5.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
40
|
+
qase_python_commons-3.5.0.dist-info/top_level.txt,sha256=Mn5aFk7H7Uia4s1NRDsvebu8vCrFy9nOuRIBfkIY5kQ,5
|
|
41
|
+
qase_python_commons-3.5.0.dist-info/RECORD,,
|
|
File without changes
|