Preserve smoke observer failures independently of readiness

This commit is contained in:
2026-11-28 16:10:49 +00:00
parent 33e8309322
commit f4951b9bde
5 changed files with 60 additions and 6 deletions

View File

@@ -34,16 +34,13 @@ func RunSmokeChecksObserved(ctx context.Context, engine *promptkit.Engine, targe
return nil, err
}
var observations []SmokeObservation
total := 2*len(targets.Access) + len(targets.Profiles)
run := func(kind promptkit.SmokeTestKind, profile, backend string, bindings []BindingScope) error {
report, err := engine.SmokeTest(ctx, promptkit.SmokeTestRequest{Kind: kind, ProfileID: profile, Execution: execution, TransientRetries: retries})
observation := SmokeObservation{Kind: kind, ProfileID: profile, BackendID: backend, Bindings: bindings, Report: report}
observation.Applicable, observation.Err = evaluateSmoke(kind, report, err)
observations = append(observations, observation)
if observe != nil {
if observeErr := observe(observation); observeErr != nil && observation.Err == nil && len(observations) < total {
return observeErr
}
return errors.Join(observation.Err, observe(observation))
}
return observation.Err
}