qase-python-commons 3.1.0b3__py3-none-any.whl → 3.1.0b5__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.

@@ -10,7 +10,7 @@ from .testops import QaseTestOps
10
10
 
11
11
  from ..models import Result, Attachment, Runtime
12
12
  from ..models.config.qaseconfig import Mode
13
- from typing import Union
13
+ from typing import Union, List
14
14
 
15
15
  """
16
16
  CoreReporter is a facade for all reporters and it is used to initialize and manage them.
@@ -23,7 +23,7 @@ class QaseCoreReporter:
23
23
  config.validate_config()
24
24
  self.config = config.config
25
25
  self.logger = Logger(self.config.debug)
26
- self.execution_plan = None
26
+ self._execution_plan = None
27
27
  self.profilers = []
28
28
  self.overhead = 0
29
29
 
@@ -151,6 +151,9 @@ class QaseCoreReporter:
151
151
  self.logger.log(e, 'error')
152
152
  self._run_fallback()
153
153
 
154
+ def get_execution_plan(self) -> Union[None, List[int]]:
155
+ return self._execution_plan
156
+
154
157
  def _run_fallback(self) -> None:
155
158
  if self.fallback:
156
159
  try:
@@ -176,7 +179,7 @@ class QaseCoreReporter:
176
179
  api_token=self.config.testops.api.token,
177
180
  host=self.config.testops.api.host
178
181
  )
179
- self.execution_plan = loader.load(self.config.testops.project,
182
+ self._execution_plan = loader.load(self.config.testops.project,
180
183
  int(self.config.testops.plan.id))
181
184
  except Exception as e:
182
185
  self.logger.log('Failed to load test plan from Qase TestOps', 'info')
@@ -1,4 +1,5 @@
1
1
  import threading
2
+ import urllib.parse
2
3
 
3
4
  from datetime import datetime
4
5
  from typing import List
@@ -17,6 +18,7 @@ class QaseTestOps:
17
18
  def __init__(self, config: QaseConfig, logger: Logger) -> None:
18
19
  self.config = config
19
20
  self.logger = logger
21
+ self.__baseUrl = self.__get_host(config.testops.api.host)
20
22
 
21
23
  self.client = self._prepare_client()
22
24
 
@@ -128,6 +130,8 @@ class QaseTestOps:
128
130
  self._send_results()
129
131
 
130
132
  def add_result(self, result: Result) -> None:
133
+ if result.get_status() == 'failed':
134
+ self.__show_link(result.testops_id, result.title)
131
135
  self.results.append(result)
132
136
  if len(self.results) >= self.batch_size:
133
137
  self._send_results()
@@ -137,3 +141,21 @@ class QaseTestOps:
137
141
 
138
142
  def set_results(self, results) -> None:
139
143
  self.results = results
144
+
145
+ def __show_link(self, id, title: str):
146
+ link = self.__prepare_link(id, title)
147
+ self.logger.log(f"See why this test failed: {link}", "info")
148
+
149
+ def __prepare_link(self, id, title: str):
150
+ link = f"{self.__baseUrl}/run/{self.project_code}/dashboard/{self.run_id}?source=logs&status=%5B2%5D&search="
151
+ if id:
152
+ return f"{link}{id}`"
153
+
154
+ return f"{link}{urllib.parse.quote_plus(title)}"
155
+
156
+ @staticmethod
157
+ def __get_host(host: str):
158
+ if host == 'qase.io':
159
+ return 'https://app.qase.io'
160
+
161
+ return f'https://{host.replace("api", "app")}'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qase-python-commons
3
- Version: 3.1.0b3
3
+ Version: 3.1.0b5
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/master/qase-python-commons
@@ -20,18 +20,18 @@ Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
21
  Requires-Python: >=3.7
22
22
  Description-Content-Type: text/markdown
23
- Requires-Dist: certifi >=2024.2.2
24
- Requires-Dist: attrs >=23.2.0
25
- Requires-Dist: qase-api-client ~=1.0.1
26
- Requires-Dist: qase-api-v2-client ~=1.0.0
23
+ Requires-Dist: certifi>=2024.2.2
24
+ Requires-Dist: attrs>=23.2.0
25
+ Requires-Dist: qase-api-client~=1.0.1
26
+ Requires-Dist: qase-api-v2-client~=1.0.0
27
27
  Requires-Dist: more-itertools
28
28
  Provides-Extra: testing
29
- Requires-Dist: pytest ; extra == 'testing'
30
- Requires-Dist: pytest-cov ; extra == 'testing'
31
- Requires-Dist: mock ; extra == 'testing'
32
- Requires-Dist: more-itertools ; extra == 'testing'
33
- Requires-Dist: requests ; extra == 'testing'
34
- Requires-Dist: urllib3 ; extra == 'testing'
29
+ Requires-Dist: pytest; extra == "testing"
30
+ Requires-Dist: pytest-cov; extra == "testing"
31
+ Requires-Dist: mock; extra == "testing"
32
+ Requires-Dist: more-itertools; extra == "testing"
33
+ Requires-Dist: requests; extra == "testing"
34
+ Requires-Dist: urllib3; extra == "testing"
35
35
 
36
36
  # Qase Python Commons
37
37
 
@@ -30,11 +30,11 @@ qase/commons/profilers/db.py,sha256=Am1tvvLgJq4_A8JsuSeBGf47BD2lnSX-5KiMjSgr-Ko,
30
30
  qase/commons/profilers/network.py,sha256=zxW_sErcMgHjzVGxk6Njp23YzhZrGgh7trC1r2zHHjU,4784
31
31
  qase/commons/profilers/sleep.py,sha256=HT6h0R-2XHZAoBYRxS2T_KC8RrnEoVjP7MXusaE4Nec,1624
32
32
  qase/commons/reporters/__init__.py,sha256=J0aNLzb_MPPT_zF8BtX_w9nj_U7Ad06RGpyWK5Pxq1o,169
33
- qase/commons/reporters/core.py,sha256=vrI9k3cSXqM24fhkyrZRYLJl92ADMh7CCUoH47egEIM,7916
33
+ qase/commons/reporters/core.py,sha256=0x5G-KVfEOWyXiXaX5__7JBIr3Rxy8vhy0cByUSZUc0,8021
34
34
  qase/commons/reporters/report.py,sha256=MPsFv3k2l4652NyXEGFiSmwsSpwZT3Is-lLRXvsniz4,4606
35
- qase/commons/reporters/testops.py,sha256=NakisK3oGt-WaLKpc_l2NUBggTCtVoWqkZV8IoM3mQ0,5464
35
+ qase/commons/reporters/testops.py,sha256=f5BcorFwIK5BSeA4Rv4IKDddkWrAXL_w-Y5Xn--NdYs,6264
36
36
  qase/commons/validators/base.py,sha256=wwSn-4YiuXtfGMGnSKgo9Vm5hAKevVmmfd2Ro6Q7MYQ,173
37
- qase_python_commons-3.1.0b3.dist-info/METADATA,sha256=L_goGPytF0zj_0hvN-MfSd3qNAq9AmYb9P8tum_0E0U,1871
38
- qase_python_commons-3.1.0b3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
39
- qase_python_commons-3.1.0b3.dist-info/top_level.txt,sha256=Mn5aFk7H7Uia4s1NRDsvebu8vCrFy9nOuRIBfkIY5kQ,5
40
- qase_python_commons-3.1.0b3.dist-info/RECORD,,
37
+ qase_python_commons-3.1.0b5.dist-info/METADATA,sha256=GozJz3yYkR6VnirPyM6M0BCvZT5f2MLgYBTQKN1PiRA,1861
38
+ qase_python_commons-3.1.0b5.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
39
+ qase_python_commons-3.1.0b5.dist-info/top_level.txt,sha256=Mn5aFk7H7Uia4s1NRDsvebu8vCrFy9nOuRIBfkIY5kQ,5
40
+ qase_python_commons-3.1.0b5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (72.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5