Skip to content

Commit

Permalink
⚠️ Remove the pass from the CheckResult
Browse files Browse the repository at this point in the history
- Remove Pass field from CheckResult

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
  • Loading branch information
naveensrinivasan committed May 12, 2022
1 parent f048164 commit b9f333b
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions checker/check_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@ type (
)

const (
// MaxResultConfidence implies full certainty about a check result.
// TODO(#1393): remove after deprecation.
MaxResultConfidence = 10
// HalfResultConfidence signifies uncertainty about a check's score.
// TODO(#1393): remove after deprecation.
HalfResultConfidence = 5
// MinResultConfidence signifies no confidence in the check result.
// TODO(#1393): remove after deprecation.
MinResultConfidence = 0
// TODO(#1393): remove after deprecation.
migrationThresholdPassValue = 8

// MaxResultScore is the best score that can be given by a check.
MaxResultScore = 10
// MinResultScore is the worst score that can be given by a check.
Expand Down Expand Up @@ -81,7 +69,6 @@ type CheckResult struct {
// TODO(#1393): Remove old structure after deprecation.
Name string
Details []string
Pass bool

// UPGRADEv2: New structure. Omitting unchanged Name field
// for simplicity.
Expand Down Expand Up @@ -165,14 +152,9 @@ func NormalizeReason(reason string, score int) string {
// the check runs without runtime errors and we want to assign a
// specific score.
func CreateResultWithScore(name, reason string, score int) CheckResult {
pass := true
if score < migrationThresholdPassValue {
pass = false
}
return CheckResult{
Name: name,
// Old structure.
Pass: pass,
// New structure.
Version: 2,
Error: nil,
Expand All @@ -187,15 +169,10 @@ func CreateResultWithScore(name, reason string, score int) CheckResult {
// multiple tests and we want to assign a score proportional
// the the number of tests that succeeded.
func CreateProportionalScoreResult(name, reason string, b, t int) CheckResult {
pass := true
score := CreateProportionalScore(b, t)
if score < migrationThresholdPassValue {
pass = false
}
return CheckResult{
Name: name,
// Old structure.
Pass: pass,
// New structure.
Version: 2,
Error: nil,
Expand Down Expand Up @@ -225,7 +202,6 @@ func CreateInconclusiveResult(name, reason string) CheckResult {
return CheckResult{
Name: name,
// Old structure.
Pass: false,
// New structure.
Version: 2,
Score: InconclusiveResultScore,
Expand All @@ -238,7 +214,6 @@ func CreateRuntimeErrorResult(name string, e error) CheckResult {
return CheckResult{
Name: name,
// Old structure.
Pass: false,
// New structure.
Version: 2,
Error: e,
Expand Down

0 comments on commit b9f333b

Please sign in to comment.