Skip to content

Commit add0738

Browse files
fix: tests
1 parent 0f35ab5 commit add0738

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

docs/resources/ai_task.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Use this resource to define Coder tasks.
2222

2323
### Read-Only
2424

25+
- `enabled` (Boolean) The field is true if the template is being provisioned as a task.
2526
- `id` (String) A unique identifier for this resource.
2627
- `prompt` (String) The prompt text provided to the task by Coder.
2728

integration/coder-ai-task/main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ resource "coder_ai_task" "task" {
4141
locals {
4242
# NOTE: these must all be strings in the output
4343
output = {
44-
"ai_task.id" = coder_ai_task.task.id
45-
"ai_task.app_id" = coder_ai_task.task.app_id
46-
"ai_task.prompt" = coder_ai_task.task.prompt
47-
"app.id" = coder_app.ai_interface.id
44+
"ai_task.id" = coder_ai_task.task.id
45+
"ai_task.app_id" = coder_ai_task.task.app_id
46+
"ai_task.prompt" = coder_ai_task.task.prompt
47+
"ai_task.enabled" = tostring(coder_ai_task.task.enabled)
48+
"app.id" = coder_app.ai_interface.id
4849
}
4950
}
5051

integration/integration_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,11 @@ func TestIntegration(t *testing.T) {
215215
name: "coder-ai-task",
216216
minVersion: "v2.26.0",
217217
expectedOutput: map[string]string{
218-
"ai_task.id": `^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$`,
219-
"ai_task.prompt": "default",
220-
"ai_task.app_id": `^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$`,
221-
"app.id": `^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$`,
218+
"ai_task.id": `^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$`,
219+
"ai_task.prompt": "",
220+
"ai_task.enabled": "false",
221+
"ai_task.app_id": `^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$`,
222+
"app.id": `^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$`,
222223
},
223224
},
224225
} {

0 commit comments

Comments
 (0)