Preserve empty smoke error messages in aggregate reports
This commit is contained in:
@@ -163,6 +163,7 @@ func TestSmokeAggregateYAMLRetainsOrderErrorAndNativeReportKind(t *testing.T) {
|
||||
encoded, err := encodeSmokeResults([]smokeResult{
|
||||
{Kind: promptkit.SmokeTestTextInference, Report: report, Err: operationErr},
|
||||
{Kind: promptkit.SmokeTestAuthentication},
|
||||
{Kind: promptkit.SmokeTestStructuredOutput, Report: report, Err: errors.New("")},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -172,7 +173,7 @@ func TestSmokeAggregateYAMLRetainsOrderErrorAndNativeReportKind(t *testing.T) {
|
||||
t.Fatalf("decode aggregate report: %v\n%s", err, encoded)
|
||||
}
|
||||
tests, ok := document["tests"].([]any)
|
||||
if !ok || len(tests) != 2 {
|
||||
if !ok || len(tests) != 3 {
|
||||
t.Fatalf("aggregate entries = %#v", document)
|
||||
}
|
||||
first := tests[0].(map[string]any)
|
||||
@@ -190,6 +191,10 @@ func TestSmokeAggregateYAMLRetainsOrderErrorAndNativeReportKind(t *testing.T) {
|
||||
if _, exists := second["error"]; exists {
|
||||
t.Fatalf("nil error should be omitted: %#v", second)
|
||||
}
|
||||
third := tests[2].(map[string]any)
|
||||
if message, exists := third["error"]; !exists || message != "" {
|
||||
t.Fatalf("empty error message should remain present: %#v", third)
|
||||
}
|
||||
}
|
||||
|
||||
func containsSmokeKey(value any, want string) bool {
|
||||
|
||||
Reference in New Issue
Block a user