hardpy 0.15.0__py3-none-any.whl → 0.15.2__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.
- hardpy/__init__.py +2 -0
- hardpy/pytest_hardpy/db/schema/v1.py +7 -8
- hardpy/pytest_hardpy/plugin.py +7 -2
- hardpy/pytest_hardpy/pytest_call.py +21 -21
- hardpy/pytest_hardpy/reporter/hook_reporter.py +29 -0
- {hardpy-0.15.0.dist-info → hardpy-0.15.2.dist-info}/METADATA +1 -1
- {hardpy-0.15.0.dist-info → hardpy-0.15.2.dist-info}/RECORD +10 -10
- {hardpy-0.15.0.dist-info → hardpy-0.15.2.dist-info}/WHEEL +0 -0
- {hardpy-0.15.0.dist-info → hardpy-0.15.2.dist-info}/entry_points.txt +0 -0
- {hardpy-0.15.0.dist-info → hardpy-0.15.2.dist-info}/licenses/LICENSE +0 -0
hardpy/__init__.py
CHANGED
|
@@ -49,6 +49,7 @@ from hardpy.pytest_hardpy.utils import (
|
|
|
49
49
|
ComparisonOperation,
|
|
50
50
|
DialogBox,
|
|
51
51
|
DuplicateParameterError,
|
|
52
|
+
Group,
|
|
52
53
|
HTMLComponent,
|
|
53
54
|
ImageComponent,
|
|
54
55
|
Instrument,
|
|
@@ -74,6 +75,7 @@ __all__ = [
|
|
|
74
75
|
"DialogBox",
|
|
75
76
|
"DuplicateParameterError",
|
|
76
77
|
"ErrorCode",
|
|
78
|
+
"Group",
|
|
77
79
|
"HTMLComponent",
|
|
78
80
|
"ImageComponent",
|
|
79
81
|
"Instrument",
|
|
@@ -4,7 +4,6 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from abc import ABC
|
|
6
6
|
from collections.abc import Mapping # noqa: TC003
|
|
7
|
-
from datetime import datetime # noqa: TC003
|
|
8
7
|
from typing import ClassVar
|
|
9
8
|
|
|
10
9
|
from pydantic import BaseModel, ConfigDict, Field
|
|
@@ -79,7 +78,7 @@ class Dut(BaseModel):
|
|
|
79
78
|
part_number: str | None = None
|
|
80
79
|
revision: str | None = None
|
|
81
80
|
sub_units: list[SubUnit] = []
|
|
82
|
-
info: Mapping[str, str | int | float
|
|
81
|
+
info: Mapping[str, str | int | float] = {}
|
|
83
82
|
|
|
84
83
|
|
|
85
84
|
class SubUnit(BaseModel):
|
|
@@ -92,7 +91,7 @@ class SubUnit(BaseModel):
|
|
|
92
91
|
serial_number: str | None = None
|
|
93
92
|
part_number: str | None = None
|
|
94
93
|
revision: str | None = None
|
|
95
|
-
info: Mapping[str, str | int | float
|
|
94
|
+
info: Mapping[str, str | int | float] = {}
|
|
96
95
|
|
|
97
96
|
|
|
98
97
|
class Instrument(BaseModel):
|
|
@@ -104,7 +103,7 @@ class Instrument(BaseModel):
|
|
|
104
103
|
revision: str | None = None
|
|
105
104
|
number: int | None = None
|
|
106
105
|
comment: str | None = None
|
|
107
|
-
info: Mapping[str, str | int | float
|
|
106
|
+
info: Mapping[str, str | int | float] = {}
|
|
108
107
|
|
|
109
108
|
|
|
110
109
|
class TestStand(BaseModel):
|
|
@@ -120,7 +119,7 @@ class TestStand(BaseModel):
|
|
|
120
119
|
number: int | None = None
|
|
121
120
|
drivers: dict = {} # deprecated, remove in v2
|
|
122
121
|
instruments: list[Instrument] = []
|
|
123
|
-
info: Mapping[str, str | int | float
|
|
122
|
+
info: Mapping[str, str | int | float] = {}
|
|
124
123
|
|
|
125
124
|
|
|
126
125
|
class Process(BaseModel):
|
|
@@ -130,7 +129,7 @@ class Process(BaseModel):
|
|
|
130
129
|
|
|
131
130
|
name: str | None = None
|
|
132
131
|
number: int | None = None
|
|
133
|
-
info: Mapping[str, str | int | float
|
|
132
|
+
info: Mapping[str, str | int | float] = {}
|
|
134
133
|
|
|
135
134
|
|
|
136
135
|
class IBaseMeasurement(BaseModel, ABC):
|
|
@@ -149,7 +148,7 @@ class NumericMeasurement(IBaseMeasurement):
|
|
|
149
148
|
|
|
150
149
|
model_config = ConfigDict(extra="forbid")
|
|
151
150
|
|
|
152
|
-
type: MeasurementType = Field(default=MeasurementType.NUMERIC)
|
|
151
|
+
type: MeasurementType = Field(default=MeasurementType.NUMERIC, frozen=True)
|
|
153
152
|
value: int | float
|
|
154
153
|
name: str | None = Field(default=None)
|
|
155
154
|
unit: str | None = Field(default=None)
|
|
@@ -165,7 +164,7 @@ class StringMeasurement(IBaseMeasurement):
|
|
|
165
164
|
|
|
166
165
|
model_config = ConfigDict(extra="forbid")
|
|
167
166
|
|
|
168
|
-
type: MeasurementType = Field(default=MeasurementType.STRING)
|
|
167
|
+
type: MeasurementType = Field(default=MeasurementType.STRING, frozen=True)
|
|
169
168
|
value: str
|
|
170
169
|
name: str | None = Field(default=None)
|
|
171
170
|
casesensitive: bool = Field(default=True)
|
hardpy/pytest_hardpy/plugin.py
CHANGED
|
@@ -320,7 +320,7 @@ class HardpyPlugin:
|
|
|
320
320
|
attempt = node_info.attempt
|
|
321
321
|
module_id = node_info.module_id
|
|
322
322
|
case_id = node_info.case_id
|
|
323
|
-
|
|
323
|
+
caused_dut_failure_id = self._reporter.get_caused_dut_failure_id()
|
|
324
324
|
is_dut_failure = True
|
|
325
325
|
|
|
326
326
|
if node_info.critical:
|
|
@@ -334,6 +334,7 @@ class HardpyPlugin:
|
|
|
334
334
|
self._reporter.set_module_status(module_id, TestStatus.RUN)
|
|
335
335
|
self._reporter.set_case_status(module_id, case_id, TestStatus.RUN)
|
|
336
336
|
self._reporter.set_case_attempt(module_id, case_id, current_attempt)
|
|
337
|
+
self._reporter.clear_case_data(module_id, case_id)
|
|
337
338
|
self._reporter.update_db_by_doc()
|
|
338
339
|
|
|
339
340
|
try:
|
|
@@ -342,6 +343,9 @@ class HardpyPlugin:
|
|
|
342
343
|
self._is_critical_not_passed = False
|
|
343
344
|
is_dut_failure = False
|
|
344
345
|
self._reporter.set_case_status(module_id, case_id, TestStatus.PASSED)
|
|
346
|
+
# clear the error code if there were no failed tests before
|
|
347
|
+
if caused_dut_failure_id is None:
|
|
348
|
+
self._reporter.clear_error_code()
|
|
345
349
|
break
|
|
346
350
|
except AssertionError:
|
|
347
351
|
self._reporter.set_case_status(module_id, case_id, TestStatus.FAILED)
|
|
@@ -349,7 +353,8 @@ class HardpyPlugin:
|
|
|
349
353
|
if current_attempt == attempt:
|
|
350
354
|
break
|
|
351
355
|
|
|
352
|
-
|
|
356
|
+
# set the caused dut failure id only the first time
|
|
357
|
+
if is_dut_failure and caused_dut_failure_id is None:
|
|
353
358
|
self._reporter.set_caused_dut_failure_id(module_id, case_id)
|
|
354
359
|
|
|
355
360
|
# Reporting hooks
|
|
@@ -33,7 +33,6 @@ from hardpy.pytest_hardpy.utils import (
|
|
|
33
33
|
|
|
34
34
|
if TYPE_CHECKING:
|
|
35
35
|
from collections.abc import Mapping
|
|
36
|
-
from datetime import datetime
|
|
37
36
|
|
|
38
37
|
|
|
39
38
|
@dataclass
|
|
@@ -44,10 +43,17 @@ class CurrentTestInfo:
|
|
|
44
43
|
case_id: str
|
|
45
44
|
|
|
46
45
|
|
|
47
|
-
class
|
|
48
|
-
"""
|
|
46
|
+
class ErrorCode:
|
|
47
|
+
"""Save error code and return error message.
|
|
48
|
+
|
|
49
|
+
It must be called from an assert.
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
Args:
|
|
52
|
+
code (int): error code.
|
|
53
|
+
message (str): error message.
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
def __init__(self, code: int, message: str | None = None) -> str | None:
|
|
51
57
|
"""Add error code to document.
|
|
52
58
|
|
|
53
59
|
Args:
|
|
@@ -65,19 +71,13 @@ class ErrorCodeMeta(type):
|
|
|
65
71
|
if reporter.get_field(key) is None:
|
|
66
72
|
reporter.set_doc_value(key, code)
|
|
67
73
|
reporter.update_db_by_doc()
|
|
68
|
-
|
|
69
|
-
return message
|
|
74
|
+
self._message = message
|
|
70
75
|
|
|
76
|
+
def __repr__(self) -> str:
|
|
77
|
+
return self._message
|
|
71
78
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
It must be called from an assert.
|
|
76
|
-
|
|
77
|
-
Args:
|
|
78
|
-
code (int): error code.
|
|
79
|
-
message (str): error message.
|
|
80
|
-
"""
|
|
79
|
+
def __str__(self) -> str | None:
|
|
80
|
+
return self._message
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
def get_current_report() -> ResultRunStore | None:
|
|
@@ -154,7 +154,7 @@ def set_dut_sub_unit(sub_unit: SubUnit) -> int:
|
|
|
154
154
|
return len(sub_units) - 1
|
|
155
155
|
|
|
156
156
|
|
|
157
|
-
def set_dut_info(info: Mapping[str, str | int | float
|
|
157
|
+
def set_dut_info(info: Mapping[str, str | int | float]) -> None:
|
|
158
158
|
"""Set DUT info to document.
|
|
159
159
|
|
|
160
160
|
Args:
|
|
@@ -278,13 +278,13 @@ def set_stand_name(name: str) -> None:
|
|
|
278
278
|
reporter.update_db_by_doc()
|
|
279
279
|
|
|
280
280
|
|
|
281
|
-
def set_stand_info(info: Mapping[str, str | int | float
|
|
281
|
+
def set_stand_info(info: Mapping[str, str | int | float]) -> None:
|
|
282
282
|
"""Add test stand info to document.
|
|
283
283
|
|
|
284
284
|
Args:
|
|
285
|
-
info (Mapping[str, str | int | float
|
|
286
|
-
where keys are strings and values can be strings, integers, floats
|
|
287
|
-
"""
|
|
285
|
+
info (Mapping[str, str | int | float ]): test stand info as a mapping
|
|
286
|
+
where keys are strings and values can be strings, integers, floats objects
|
|
287
|
+
"""
|
|
288
288
|
reporter = RunnerReporter()
|
|
289
289
|
for stand_key, stand_value in info.items():
|
|
290
290
|
key = reporter.generate_key(DF.TEST_STAND, DF.INFO, stand_key)
|
|
@@ -524,7 +524,7 @@ def set_process_number(number: int) -> None:
|
|
|
524
524
|
reporter.update_db_by_doc()
|
|
525
525
|
|
|
526
526
|
|
|
527
|
-
def set_process_info(info: Mapping[str, str | int | float
|
|
527
|
+
def set_process_info(info: Mapping[str, str | int | float]) -> None:
|
|
528
528
|
"""Set process info to document.
|
|
529
529
|
|
|
530
530
|
Args:
|
|
@@ -261,6 +261,35 @@ class HookReporter(BaseReporter):
|
|
|
261
261
|
key = self.generate_key(DF.CAUSED_DUT_FAILURE_ID)
|
|
262
262
|
return self._statestore.get_field(key)
|
|
263
263
|
|
|
264
|
+
def clear_case_data(self, module_id: str, case_id: str) -> None:
|
|
265
|
+
"""Clear test case data.
|
|
266
|
+
|
|
267
|
+
Args:
|
|
268
|
+
module_id (str): module id
|
|
269
|
+
case_id (str): case id
|
|
270
|
+
"""
|
|
271
|
+
# fmt: off
|
|
272
|
+
key = self.generate_key(DF.MODULES, module_id, DF.CASES, case_id, DF.ARTIFACT)
|
|
273
|
+
self.set_doc_value(key, {})
|
|
274
|
+
|
|
275
|
+
key = self.generate_key(DF.MODULES, module_id, DF.CASES, case_id, DF.MSG)
|
|
276
|
+
self.set_doc_value(key, None)
|
|
277
|
+
|
|
278
|
+
key = self.generate_key(DF.MODULES, module_id, DF.CASES, case_id, DF.ASSERTION_MSG) # noqa: E501
|
|
279
|
+
self.set_doc_value(key, None)
|
|
280
|
+
|
|
281
|
+
key = self.generate_key(DF.MODULES, module_id, DF.CASES, case_id, DF.MEASUREMENTS) # noqa: E501
|
|
282
|
+
self.set_doc_value(key, [])
|
|
283
|
+
|
|
284
|
+
key = self.generate_key(DF.MODULES, module_id, DF.CASES, case_id, DF.CHART)
|
|
285
|
+
self.set_doc_value(key, None)
|
|
286
|
+
# fmt: on
|
|
287
|
+
|
|
288
|
+
def clear_error_code(self) -> None:
|
|
289
|
+
"""Clear error code."""
|
|
290
|
+
key = self.generate_key(DF.ERROR_CODE)
|
|
291
|
+
self.set_doc_value(key, None)
|
|
292
|
+
|
|
264
293
|
def update_node_order(self, nodes: dict) -> None:
|
|
265
294
|
"""Update node order.
|
|
266
295
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
hardpy/__init__.py,sha256=
|
|
1
|
+
hardpy/__init__.py,sha256=GF5YV1Di7IEfXXJDg3BDto-qapcvy4Wum9dH-X78Qn8,2890
|
|
2
2
|
hardpy/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
hardpy/cli/cli.py,sha256=-KS8qggaCGz0Hcdd4TLJPwKpVSDfubSp5t5cWuXoMUc,9434
|
|
4
4
|
hardpy/cli/template.py,sha256=44phTqeKgFch5xdAJmDQ-za1mM1_z60izRVbmCQHU-8,6225
|
|
@@ -45,8 +45,8 @@ hardpy/hardpy_panel/frontend/dist/locales/ja/translation.json,sha256=xSDe9TN1f3g
|
|
|
45
45
|
hardpy/hardpy_panel/frontend/dist/locales/ru/translation.json,sha256=Zo_5GhOFIwOnpQITD5x2Q7CYTI9Pdpvv844_ieW56jY,2609
|
|
46
46
|
hardpy/hardpy_panel/frontend/dist/locales/zh/translation.json,sha256=uxYSv8eXTMDewPvbFZSh21ZP0Wy4mx32XbbVkzXzlls,1790
|
|
47
47
|
hardpy/pytest_hardpy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
|
-
hardpy/pytest_hardpy/plugin.py,sha256=
|
|
49
|
-
hardpy/pytest_hardpy/pytest_call.py,sha256=
|
|
48
|
+
hardpy/pytest_hardpy/plugin.py,sha256=1NHo2SRhJaZ6ElFUuy8qwpUM3mXqSYmG82lwJMxd9yE,21405
|
|
49
|
+
hardpy/pytest_hardpy/pytest_call.py,sha256=2bMDkcNyaADLocxnFS3ykYQG7bqeNWwxf_LukmcI25M,21515
|
|
50
50
|
hardpy/pytest_hardpy/pytest_wrapper.py,sha256=0tG725R3qhLI6t6zi0-OL17FCwt3YI-mwrBjWe4U9A4,4694
|
|
51
51
|
hardpy/pytest_hardpy/db/__init__.py,sha256=G6y13JPh8HaH2O9E3_LTH_bTUVSgiezQFjDGaNIljec,557
|
|
52
52
|
hardpy/pytest_hardpy/db/base_connector.py,sha256=5a476F5LwvFUfQ4Yc0Q6biacULDrCk8UHPlpc6n0NRQ,1111
|
|
@@ -56,10 +56,10 @@ hardpy/pytest_hardpy/db/const.py,sha256=E_A0IKGeS3qyPX4fTfUE5ksARsrTKSVWqUkdmh8S
|
|
|
56
56
|
hardpy/pytest_hardpy/db/runstore.py,sha256=tCXWo2AW0er3lbDcCqYbYxOBbINMZNtfnnjlIJpXmIA,949
|
|
57
57
|
hardpy/pytest_hardpy/db/statestore.py,sha256=0sv4AqzwW_J34O-cb7aN3zmgULIVtZRi_qg4XvC2_L0,586
|
|
58
58
|
hardpy/pytest_hardpy/db/schema/__init__.py,sha256=1S73W3PLQt8gX5Y33nbX1JdwLvnrtlKH4cElID3pwuc,263
|
|
59
|
-
hardpy/pytest_hardpy/db/schema/v1.py,sha256=
|
|
59
|
+
hardpy/pytest_hardpy/db/schema/v1.py,sha256=nHqAMBJgS7eUq0yy95ymSyYGsKdIDiISMJ816iWqjwg,6264
|
|
60
60
|
hardpy/pytest_hardpy/reporter/__init__.py,sha256=rztpM2HlLUpMOvad0JHbZU4Mk8PDDQyCFXLhpLktGQI,322
|
|
61
61
|
hardpy/pytest_hardpy/reporter/base.py,sha256=KRkc5a7yk9ZsQ92gnBdHhJEXSSQiTWbEMSMzRMpJDFY,2915
|
|
62
|
-
hardpy/pytest_hardpy/reporter/hook_reporter.py,sha256=
|
|
62
|
+
hardpy/pytest_hardpy/reporter/hook_reporter.py,sha256=IAseKoQcZWlgS3NLYNnBOC5aGsJUgzyZLqljpd8Tfsg,15672
|
|
63
63
|
hardpy/pytest_hardpy/reporter/runner_reporter.py,sha256=YsK8wrLIulsixePG6WNfC4MagpKfhP5j0CUaXkcfeL0,790
|
|
64
64
|
hardpy/pytest_hardpy/result/__init__.py,sha256=2afpuEuOcxYfIEOwWzsGZe960iQaPVCmsbYujijQg1s,592
|
|
65
65
|
hardpy/pytest_hardpy/result/couchdb_config.py,sha256=ujxyJYM2pdZzi3GZ2Zysbz2_ZeTRN5sQc8AGuzRJm_0,3243
|
|
@@ -79,8 +79,8 @@ hardpy/pytest_hardpy/utils/node_info.py,sha256=DaW566WvsyWR66CThuZ38UoHwQa-pu-4W
|
|
|
79
79
|
hardpy/pytest_hardpy/utils/progress_calculator.py,sha256=TPl2gG0ZSvMe8otPythhF9hkD6fa6-mJAhy9yI83-yE,1071
|
|
80
80
|
hardpy/pytest_hardpy/utils/singleton.py,sha256=tjUGs48o_vBeVpRsEBZEOTCoCUikpIFmQ1c3rsfymso,948
|
|
81
81
|
hardpy/pytest_hardpy/utils/stand_type.py,sha256=p3AFtgMt-sn8QXRp60YM-xo2mEjZHUhYr_Mxhz1WyP0,7438
|
|
82
|
-
hardpy-0.15.
|
|
83
|
-
hardpy-0.15.
|
|
84
|
-
hardpy-0.15.
|
|
85
|
-
hardpy-0.15.
|
|
86
|
-
hardpy-0.15.
|
|
82
|
+
hardpy-0.15.2.dist-info/METADATA,sha256=GBBbXqU0xCEBbO9ohWiZcC1iEBBKk_Pb9puxIE48Vyc,4058
|
|
83
|
+
hardpy-0.15.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
84
|
+
hardpy-0.15.2.dist-info/entry_points.txt,sha256=nL2sMkKMScNaOE0IPkYnu9Yr-BUswZvGSrwY-SxHY3E,102
|
|
85
|
+
hardpy-0.15.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
86
|
+
hardpy-0.15.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|