Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions e2e/testcases/domain_classify.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ func testDomainClassify(ctx context.Context, client *kubernetes.Clientset, opts
correctTests, totalTests, accuracy)
}

// Return error if accuracy is 0%
if correctTests == 0 {
return fmt.Errorf("domain classification test failed: 0%% accuracy (0/%d correct)", totalTests)
}

return nil
}

Expand Down
5 changes: 5 additions & 0 deletions e2e/testcases/jailbreak_detection.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ func testJailbreakDetection(ctx context.Context, client *kubernetes.Clientset, o
correctTests, totalTests, detectionRate)
}

// Return error if detection rate is 0%
if correctTests == 0 {
return fmt.Errorf("jailbreak detection test failed: 0%% accuracy (0/%d correct)", totalTests)
}

return nil
}

Expand Down
5 changes: 5 additions & 0 deletions e2e/testcases/pii_detection.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ func testPIIDetection(ctx context.Context, client *kubernetes.Clientset, opts pk
correctTests, totalTests, detectionRate)
}

// Return error if detection rate is 0%
if correctTests == 0 {
return fmt.Errorf("PII detection test failed: 0%% accuracy (0/%d correct)", totalTests)
}

return nil
}

Expand Down
Loading