Show progress for each preflight profile
This commit is contained in:
@@ -79,7 +79,7 @@ func TestVerifyStructuredOutputContinuesAndStopsOnCancellation(t *testing.T) {
|
||||
return positiveSmokeReport(), nil
|
||||
}
|
||||
})
|
||||
results, err := VerifyStructuredOutput(ctx, engine, []string{"first", "second", "third"})
|
||||
results, err := VerifyStructuredOutput(ctx, engine, []string{"first", "second", "third"}, nil)
|
||||
if !slices.Equal(calls, []string{"first", "second"}) || len(results) != 2 || results[1].Report == nil || !errors.Is(err, failure) || !errors.Is(err, context.Canceled) {
|
||||
t.Fatalf("calls=%v results=%+v error=%v", calls, results, err)
|
||||
}
|
||||
@@ -111,8 +111,22 @@ func TestVerifyStructuredOutputUsesNativeEngine(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
results, err := VerifyStructuredOutput(context.Background(), runtime.Engine, []string{"fixture"})
|
||||
results, err := VerifyStructuredOutput(context.Background(), runtime.Engine, []string{"fixture"}, nil)
|
||||
if err != nil || calls != 1 || len(results) != 1 || results[0].Status != VerificationSuccess {
|
||||
t.Fatalf("calls=%d results=%+v err=%v", calls, results, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVerificationIdentifiesProfileBeforeDispatch(t *testing.T) {
|
||||
var current string
|
||||
engine := smokeFunc(func(_ context.Context, req pk.SmokeTestRequest) (*pk.SmokeTestReport, error) {
|
||||
if current != req.ProfileID {
|
||||
t.Fatalf("progress %q before dispatch %q", current, req.ProfileID)
|
||||
}
|
||||
return positiveSmokeReport(), nil
|
||||
})
|
||||
_, err := VerifyStructuredOutput(context.Background(), engine, []string{"one", "two"}, func(id string) { current = id })
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user