mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
test: isolate passive chatd internal tests (#26369)
Make `newInternalTestServer` use option functions for logger, clock, and worker startup, and make it passive by default so internal chatd tests only opt into background execution when they need a real worker. Use the passive server path in `TestAwaitSubagentCompletion` for the state-driven subtests, keep `ContextCanceled` explicitly active for real provider cancellation coverage, and keep the fail-fast default AI provider base URL so accidental provider calls still fail immediately. Closes CODAGT-586 Closes https://github.com/coder/internal/issues/1549
This commit is contained in:
@@ -218,12 +218,13 @@ func AIProvider(t testing.TB, db database.Store, seed database.AIProvider, munge
|
||||
displayName = sql.NullString{String: name, Valid: true}
|
||||
}
|
||||
params := database.InsertAIProviderParams{
|
||||
ID: id,
|
||||
Type: provType,
|
||||
Name: name,
|
||||
DisplayName: displayName,
|
||||
Enabled: takeFirst(seed.Enabled, true),
|
||||
BaseUrl: takeFirst(seed.BaseUrl, "https://api.example.com/"),
|
||||
ID: id,
|
||||
Type: provType,
|
||||
Name: name,
|
||||
DisplayName: displayName,
|
||||
Enabled: takeFirst(seed.Enabled, true),
|
||||
// Use an unsupported scheme so leaked test provider calls fail immediately without retries.
|
||||
BaseUrl: takeFirst(seed.BaseUrl, "invalid://test.invalid/"),
|
||||
Settings: seed.Settings,
|
||||
SettingsKeyID: seed.SettingsKeyID,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user