Skip to content

Commit 84b6fd7

Browse files
authored
Merge pull request vllm-project#676 from vllm-project/test/fail-on-zero-accuracy
[CI/Build] Fail e2e tests when accuracy is 0%
2 parents 6a4ebf4 + 9d97da1 commit 84b6fd7

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

e2e/testcases/domain_classify.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ func testDomainClassify(ctx context.Context, client *kubernetes.Clientset, opts
9292
correctTests, totalTests, accuracy)
9393
}
9494

95+
// Return error if accuracy is 0%
96+
if correctTests == 0 {
97+
return fmt.Errorf("domain classification test failed: 0%% accuracy (0/%d correct)", totalTests)
98+
}
99+
95100
return nil
96101
}
97102

e2e/testcases/jailbreak_detection.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ func testJailbreakDetection(ctx context.Context, client *kubernetes.Clientset, o
103103
correctTests, totalTests, detectionRate)
104104
}
105105

106+
// Return error if detection rate is 0%
107+
if correctTests == 0 {
108+
return fmt.Errorf("jailbreak detection test failed: 0%% accuracy (0/%d correct)", totalTests)
109+
}
110+
106111
return nil
107112
}
108113

e2e/testcases/pii_detection.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ func testPIIDetection(ctx context.Context, client *kubernetes.Clientset, opts pk
103103
correctTests, totalTests, detectionRate)
104104
}
105105

106+
// Return error if detection rate is 0%
107+
if correctTests == 0 {
108+
return fmt.Errorf("PII detection test failed: 0%% accuracy (0/%d correct)", totalTests)
109+
}
110+
106111
return nil
107112
}
108113

0 commit comments

Comments
 (0)