Skip to content

Commit

Permalink
Handle unknown results (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
lubux authored Nov 8, 2024
1 parent 5f27dd5 commit c8c394e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compare_with_baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,16 @@ def to_string(self):
NEUTRAL = "Neutral"
SUCCESS = "Success"
FAILURE = "Failure"
UNKNOWN = "Unknown"


def compare_results(baseline_result, target_result):
target_score = target_result["score"]
baseline_score = baseline_result["score"]
if baseline_score == target_score:
return ResultChange.UNCHANGED
elif target_score == UNKNOWN:
return ResultChange.REGRESSION
elif target_score == FAILURE or (target_score == NEUTRAL and baseline_score == SUCCESS):
return ResultChange.REGRESSION
elif target_score == SUCCESS or (target_score == NEUTRAL and baseline_score == FAILURE):
Expand Down

0 comments on commit c8c394e

Please sign in to comment.