Skip to content

Commit e6ce775

Browse files
committed
tests: make tests fail when baseline not found
When baseline is not available, performance tests pass without any errors. This commit makes tests fail in such situation. It lets us know which performance baselines are missing. Signed-off-by: Takahiro Itazuri <[email protected]>
1 parent 2437ee3 commit e6ce775

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/framework/stats/criteria.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ def name(self):
5454
@property
5555
def target(self):
5656
"""Return criteria target."""
57+
if self._baseline is None:
58+
raise CriteriaException("Baseline data not defined.")
59+
5760
target = self._baseline.get("target")
5861
if target is None:
5962
raise CriteriaException("Baseline target not defined.")
@@ -122,6 +125,9 @@ def __init__(self, baseline: dict):
122125
@property
123126
def delta(self):
124127
"""Return the `delta` field of the baseline."""
128+
if self._baseline is None:
129+
raise CriteriaException("Baseline data not defined.")
130+
125131
delta = self._baseline.get("delta")
126132
if delta is None:
127133
raise CriteriaException("Baseline delta not defined.")

0 commit comments

Comments
 (0)