Keep aggregate smoke tests focused on behavior
This commit is contained in:
@@ -198,9 +198,7 @@ func TestSmokeTestBuilderReceivesConcreteAggregateKinds(t *testing.T) {
|
||||
}
|
||||
var builtKinds []promptkit.SmokeTestKind
|
||||
loadErr := errors.New("engine unavailable")
|
||||
loads := 0
|
||||
suite := WithSmokeTesting(Suite[struct{}, struct{}]{}, func(context.Context, ckconfig.Selection, struct{}, struct{}) (*promptkit.Engine, error) {
|
||||
loads++
|
||||
return nil, loadErr
|
||||
}, func(_ context.Context, request SmokeRequest, _ struct{}, _ struct{}) (promptkit.SmokeTestRequest, error) {
|
||||
builtKinds = append(builtKinds, request.Request.Kind)
|
||||
@@ -208,8 +206,8 @@ func TestSmokeTestBuilderReceivesConcreteAggregateKinds(t *testing.T) {
|
||||
})
|
||||
app := newPromptTestApp(t, Command(suite))
|
||||
outcome := app.Execute(context.Background(), []string{"promptkit", "test", "all"}, commandkit.Streams{Out: io.Discard, Err: io.Discard})
|
||||
if outcome.Kind != commandkit.OutcomeOperational || !errors.Is(outcome.Cause, loadErr) || loads != 4 || !reflect.DeepEqual(builtKinds, wantKinds) {
|
||||
t.Fatalf("aggregate builder lifecycle = %#v, built=%#v loads=%d", outcome, builtKinds, loads)
|
||||
if outcome.Kind != commandkit.OutcomeOperational || !errors.Is(outcome.Cause, loadErr) || !reflect.DeepEqual(builtKinds, wantKinds) {
|
||||
t.Fatalf("aggregate builder lifecycle = %#v, built=%#v", outcome, builtKinds)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user