qase-python-commons 3.5.3__tar.gz → 3.5.5__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.5.3 → qase_python_commons-3.5.5}/PKG-INFO +1 -1
  2. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/pyproject.toml +1 -1
  3. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/config.py +12 -0
  4. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/config/testops.py +5 -0
  5. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/result.py +2 -2
  6. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/run.py +3 -0
  7. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/step.py +2 -2
  8. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/reporters/testops.py +26 -7
  9. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase_python_commons.egg-info/PKG-INFO +1 -1
  10. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/README.md +0 -0
  11. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/setup.cfg +0 -0
  12. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/__init__.py +0 -0
  13. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/client/api_v1_client.py +0 -0
  14. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/client/api_v2_client.py +0 -0
  15. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/client/base_api_client.py +0 -0
  16. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/exceptions/reporter.py +0 -0
  17. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/loader.py +0 -0
  18. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/logger.py +0 -0
  19. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/__init__.py +0 -0
  20. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/attachment.py +0 -0
  21. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/basemodel.py +0 -0
  22. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/config/api.py +0 -0
  23. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/config/batch.py +0 -0
  24. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/config/connection.py +0 -0
  25. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/config/framework.py +0 -0
  26. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/config/plan.py +0 -0
  27. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/config/qaseconfig.py +0 -0
  28. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/config/report.py +0 -0
  29. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/config/run.py +0 -0
  30. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/relation.py +0 -0
  31. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/models/runtime.py +0 -0
  32. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/profilers/__init__.py +0 -0
  33. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/profilers/db.py +0 -0
  34. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/profilers/network.py +0 -0
  35. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/profilers/sleep.py +0 -0
  36. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/reporters/__init__.py +0 -0
  37. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/reporters/core.py +0 -0
  38. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/reporters/report.py +0 -0
  39. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/util/__init__.py +0 -0
  40. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/util/host_data.py +0 -0
  41. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/utils.py +0 -0
  42. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase/commons/validators/base.py +0 -0
  43. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase_python_commons.egg-info/SOURCES.txt +0 -0
  44. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase_python_commons.egg-info/dependency_links.txt +0 -0
  45. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/src/qase_python_commons.egg-info/requires.txt +0 -0
  46. {qase_python_commons-3.5.3 → qase_python_commons-3.5.5}/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.5.3
3
+ Version: 3.5.5
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.5.3"
7
+ version = "3.5.5"
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"}]
@@ -142,6 +142,14 @@ class ConfigManager:
142
142
  self.config.testops.configurations.set_create_if_not_exists(
143
143
  configurations.get("createIfNotExists"))
144
144
 
145
+ if testops.get("statusFilter"):
146
+ status_filter = testops.get("statusFilter")
147
+ if isinstance(status_filter, list):
148
+ self.config.testops.set_status_filter(status_filter)
149
+ elif isinstance(status_filter, str):
150
+ # Parse comma-separated string
151
+ self.config.testops.set_status_filter([s.strip() for s in status_filter.split(',')])
152
+
145
153
  if config.get("report"):
146
154
  report = config.get("report")
147
155
 
@@ -262,6 +270,10 @@ class ConfigManager:
262
270
  if key == 'QASE_TESTOPS_CONFIGURATIONS_CREATE_IF_NOT_EXISTS':
263
271
  self.config.testops.configurations.set_create_if_not_exists(value)
264
272
 
273
+ if key == 'QASE_TESTOPS_STATUS_FILTER':
274
+ # Parse comma-separated string
275
+ self.config.testops.set_status_filter([s.strip() for s in value.split(',')])
276
+
265
277
  if key == 'QASE_REPORT_DRIVER':
266
278
  self.config.report.set_driver(value)
267
279
 
@@ -48,6 +48,7 @@ class TestopsConfig(BaseModel):
48
48
  plan: PlanConfig = None
49
49
  batch: BatchConfig = None
50
50
  configurations: ConfigurationsConfig = None
51
+ status_filter: List[str] = None
51
52
 
52
53
  def __init__(self):
53
54
  self.api = ApiConfig()
@@ -56,9 +57,13 @@ class TestopsConfig(BaseModel):
56
57
  self.plan = PlanConfig()
57
58
  self.configurations = ConfigurationsConfig()
58
59
  self.defect = False
60
+ self.status_filter = []
59
61
 
60
62
  def set_project(self, project: str):
61
63
  self.project = project
62
64
 
63
65
  def set_defect(self, defect):
64
66
  self.defect = QaseUtils.parse_bool(defect)
67
+
68
+ def set_status_filter(self, status_filter: List[str]):
69
+ self.status_filter = status_filter
@@ -33,10 +33,10 @@ class Execution(BaseModel):
33
33
  self.thread = thread
34
34
 
35
35
  def set_status(self, status: Optional[str]):
36
- if status in ['passed', 'failed', 'skipped', 'untested']:
36
+ if status in ['passed', 'failed', 'skipped', 'untested', 'invalid']:
37
37
  self.status = status
38
38
  else:
39
- raise ValueError('Step status must be one of: passed, failed, skipped, untested')
39
+ raise ValueError('Step status must be one of: passed, failed, skipped, untested, invalid')
40
40
 
41
41
  def get_status(self):
42
42
  return self.status
@@ -24,6 +24,7 @@ class RunStats(BaseModel):
24
24
  self.failed = 0
25
25
  self.skipped = 0
26
26
  self.broken = 0
27
+ self.invalid = 0
27
28
  self.muted = 0
28
29
  self.total = 0
29
30
 
@@ -37,6 +38,8 @@ class RunStats(BaseModel):
37
38
  self.skipped += 1
38
39
  elif status == "broken":
39
40
  self.broken += 1
41
+ elif status == "invalid":
42
+ self.invalid += 1
40
43
  self.total += 1
41
44
  if result.get('muted', False):
42
45
  self.muted += 1
@@ -82,10 +82,10 @@ class StepExecution(BaseModel):
82
82
  self.attachments = []
83
83
 
84
84
  def set_status(self, status: Optional[str]):
85
- if status in ['passed', 'failed', 'skipped', 'blocked', 'untested']:
85
+ if status in ['passed', 'failed', 'skipped', 'blocked', 'untested', 'invalid']:
86
86
  self.status = status
87
87
  else:
88
- raise ValueError('Step status must be one of: passed, failed, skipped, blocked, untested')
88
+ raise ValueError('Step status must be one of: passed, failed, skipped, blocked, untested, invalid')
89
89
 
90
90
  def complete(self):
91
91
  self.end_time = time.time()
@@ -86,15 +86,34 @@ class QaseTestOps:
86
86
 
87
87
  def _send_results(self) -> None:
88
88
  if self.results:
89
- # Acquire semaphore before starting the send operation
90
- self.send_semaphore.acquire()
91
- self.count_running_threads += 1
89
+ # Filter results by status if status_filter is configured
92
90
  results_to_send = self.results.copy()
91
+
92
+ if self.config.testops.status_filter and len(self.config.testops.status_filter) > 0:
93
+ filtered_results = []
94
+ for result in results_to_send:
95
+ result_status = result.get_status()
96
+ if result_status and result_status not in self.config.testops.status_filter:
97
+ filtered_results.append(result)
98
+ else:
99
+ self.logger.log_debug(f"Filtering out result '{result.title}' with status '{result_status}'")
100
+
101
+ results_to_send = filtered_results
102
+ self.logger.log_debug(f"Filtered {len(self.results) - len(results_to_send)} results by status filter")
103
+
104
+ if results_to_send:
105
+ # Acquire semaphore before starting the send operation
106
+ self.send_semaphore.acquire()
107
+ self.count_running_threads += 1
108
+
109
+ # Start a new thread for sending results
110
+ send_thread = threading.Thread(target=self._send_results_threaded, args=(results_to_send,))
111
+ send_thread.start()
112
+ else:
113
+ self.logger.log("No results to send after filtering", "info")
114
+
115
+ # Clear results regardless of filtering
93
116
  self.results = []
94
-
95
- # Start a new thread for sending results
96
- send_thread = threading.Thread(target=self._send_results_threaded, args=(results_to_send,))
97
- send_thread.start()
98
117
  else:
99
118
  self.logger.log("No results to send", "info")
100
119
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qase-python-commons
3
- Version: 3.5.3
3
+ Version: 3.5.5
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