qase-python-commons 3.4.4__tar.gz → 3.5.1__tar.gz

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.

Files changed (46) hide show
  1. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/PKG-INFO +1 -1
  2. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/pyproject.toml +1 -1
  3. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/client/api_v1_client.py +2 -1
  4. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/client/api_v2_client.py +1 -1
  5. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/config.py +33 -9
  6. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/config/qaseconfig.py +6 -0
  7. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/config/run.py +7 -0
  8. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/reporters/testops.py +4 -1
  9. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/utils.py +17 -0
  10. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase_python_commons.egg-info/PKG-INFO +1 -1
  11. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/README.md +0 -0
  12. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/setup.cfg +0 -0
  13. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/__init__.py +0 -0
  14. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/client/base_api_client.py +0 -0
  15. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/exceptions/reporter.py +0 -0
  16. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/loader.py +0 -0
  17. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/logger.py +0 -0
  18. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/__init__.py +0 -0
  19. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/attachment.py +0 -0
  20. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/basemodel.py +0 -0
  21. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/config/api.py +0 -0
  22. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/config/batch.py +0 -0
  23. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/config/connection.py +0 -0
  24. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/config/framework.py +0 -0
  25. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/config/plan.py +0 -0
  26. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/config/report.py +0 -0
  27. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/config/testops.py +0 -0
  28. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/relation.py +0 -0
  29. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/result.py +0 -0
  30. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/run.py +0 -0
  31. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/runtime.py +0 -0
  32. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/models/step.py +0 -0
  33. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/profilers/__init__.py +0 -0
  34. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/profilers/db.py +0 -0
  35. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/profilers/network.py +0 -0
  36. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/profilers/sleep.py +0 -0
  37. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/reporters/__init__.py +0 -0
  38. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/reporters/core.py +0 -0
  39. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/reporters/report.py +0 -0
  40. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/util/__init__.py +0 -0
  41. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/util/host_data.py +0 -0
  42. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase/commons/validators/base.py +0 -0
  43. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase_python_commons.egg-info/SOURCES.txt +0 -0
  44. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase_python_commons.egg-info/dependency_links.txt +0 -0
  45. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase_python_commons.egg-info/requires.txt +0 -0
  46. {qase_python_commons-3.4.4 → qase_python_commons-3.5.1}/src/qase_python_commons.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qase-python-commons
3
- Version: 3.4.4
3
+ Version: 3.5.1
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "qase-python-commons"
7
- version = "3.4.4"
7
+ version = "3.5.1"
8
8
  description = "A library for Qase TestOps and Qase Report"
9
9
  readme = "README.md"
10
10
  authors = [{name = "Qase Team", email = "support@qase.io"}]
@@ -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,
@@ -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(execution_plan.get("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(api.get("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(api.get("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(testops.get("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(run.get("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(run.get("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(batch.get("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(connection.get("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
@@ -127,6 +127,9 @@ class QaseTestOps:
127
127
  def complete_worker(self) -> None:
128
128
  if len(self.results) > 0:
129
129
  self._send_results()
130
+ while self.count_running_threads > 0:
131
+ pass
132
+ self.logger.log_debug("Worker completed")
130
133
 
131
134
  def add_result(self, result: Result) -> None:
132
135
  if result.get_status() == 'failed':
@@ -148,7 +151,7 @@ class QaseTestOps:
148
151
  def __prepare_link(self, ids: Union[None, List[int]], title: str):
149
152
  link = f"{self.__baseUrl}/run/{self.project_code}/dashboard/{self.run_id}?source=logs&status=%5B2%5D&search="
150
153
  if ids is not None and len(ids) > 0:
151
- return f"{link}{ids[0]}"
154
+ return f"{link}{self.project_code}-{ids[0]}"
152
155
  return f"{link}{urllib.parse.quote_plus(title)}"
153
156
 
154
157
  @staticmethod
@@ -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.4.4
3
+ Version: 3.5.1
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