Preserve smoke observer failures independently of readiness
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user