Skip to content

Commit

Permalink
update error logic
Browse files Browse the repository at this point in the history
  • Loading branch information
BWMac committed May 8, 2024
1 parent 1bac259 commit 9d8118f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/dcqc/suites/suite_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,16 @@ def compute_status(self) -> SuiteStatus:
for test in self.tests:
test_name = test.type
test_status = test.get_status()
# if test errors, always return grey immediately
if test_status == TestStatus.ERROR:
self._status = SuiteStatus.GREY
return self._status
if test_name in self.required_tests:
if test_status == TestStatus.FAIL:
self._status = SuiteStatus.RED
return self._status
else:
if test_status == TestStatus.FAIL:
self._status = SuiteStatus.AMBER
# if required test failed, red takes precedence over amber
if test_status == TestStatus.FAIL and test_name in self.required_tests:
self._status = SuiteStatus.RED
# if test failed not required test, amber
if test_status == TestStatus.FAIL and self._status != SuiteStatus.RED:
self._status = SuiteStatus.AMBER
return self._status

def to_dict(self) -> SerializedObject:
Expand Down

0 comments on commit 9d8118f

Please sign in to comment.