Add opt-in PromptKit namespaces
This commit is contained in:
@@ -18,6 +18,8 @@ type SmokeRequest struct {
|
||||
Selection ckconfig.Selection
|
||||
// Request contains the native smoke-test operation and its selected inputs.
|
||||
Request promptkit.SmokeTestRequest
|
||||
// Namespaces selects the native engine view; nil preserves the loader view.
|
||||
Namespaces *promptkit.Namespaces
|
||||
}
|
||||
|
||||
// WithSmokeTesting attaches PromptKit-backed smoke testing to suite while
|
||||
@@ -65,6 +67,11 @@ func WithSmokeTesting[I, S any](
|
||||
return commandkit.Acquired[*promptkit.SmokeTestReport]{Diagnostics: messages.diagnostics, Explanation: messages.explanation}, fmt.Errorf("PromptKit smoke test before native operation: %w", err)
|
||||
}
|
||||
|
||||
engine, err = namespacedEngine(engine, request.Namespaces)
|
||||
if err != nil {
|
||||
messages = messages.withOperationError(err)
|
||||
return commandkit.Acquired[*promptkit.SmokeTestReport]{Diagnostics: messages.diagnostics, Explanation: messages.explanation}, err
|
||||
}
|
||||
report, err := engine.SmokeTest(ctx, concreteRequest)
|
||||
messages = messages.withOperationError(err)
|
||||
return commandkit.Acquired[*promptkit.SmokeTestReport]{Value: report, Diagnostics: messages.diagnostics, Explanation: messages.explanation}, err
|
||||
|
||||
Reference in New Issue
Block a user