mirror of
https://github.com/coder/coder.git
synced 2026-10-31 10:52:25 +08:00
feat!: hide Coder Tasks behind the enable-ai-tasks flag (#28008)
This commit is contained in:
@@ -1866,6 +1866,10 @@ func DeploymentValues(t testing.TB, mut ...func(*codersdk.DeploymentValues)) *co
|
||||
opts := cfg.Options()
|
||||
err := opts.SetDefaults()
|
||||
require.NoError(t, err)
|
||||
// Tasks ship disabled. Tests exercise the enabled behavior by default so
|
||||
// the Tasks suite keeps running; tests for the disabled path opt out
|
||||
// explicitly via the mutators.
|
||||
cfg.EnableAITasks = true
|
||||
for _, fn := range mut {
|
||||
fn(cfg)
|
||||
}
|
||||
|
||||
@@ -20,7 +20,13 @@ func TestEndpointsDocumented(t *testing.T) {
|
||||
require.NoError(t, err, "can't parse swagger comments")
|
||||
require.NotEmpty(t, swaggerComments, "swagger comments must be present")
|
||||
|
||||
_, _, api := coderdtest.NewWithAPI(t, nil)
|
||||
// Coder Tasks has no swagger annotations because it is withdrawn from the
|
||||
// product, so verify against a deployment where its routes are not
|
||||
// registered.
|
||||
values := coderdtest.DeploymentValues(t)
|
||||
values.EnableAITasks = false
|
||||
|
||||
_, _, api := coderdtest.NewWithAPI(t, &coderdtest.Options{DeploymentValues: values})
|
||||
coderdtest.VerifySwaggerDefinitions(t, api.APIHandler, swaggerComments, coderdtest.WithSwaggerRoutePrefix("/api/v2"))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user