File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 44 "context"
55 "os"
66
7- "github.com/google/uuid"
87 "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
98 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
109 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
@@ -31,7 +30,7 @@ func aiTaskResource() *schema.Resource {
3130 if idStr := os .Getenv ("CODER_TASK_ID" ); idStr != "" {
3231 resourceData .SetId (idStr )
3332 } else {
34- resourceData . SetId ( uuid . NewString () )
33+ return diag . Errorf ( "CODER_TASK_ID must be set" )
3534 }
3635
3736 if prompt := os .Getenv ("CODER_TASK_PROMPT" ); prompt != "" {
Original file line number Diff line number Diff line change @@ -10,9 +10,11 @@ import (
1010)
1111
1212func TestAITask (t * testing.T ) {
13+ t .Setenv ("CODER_TASK_ID" , "7d8d4c2e-fb57-44f9-a183-22509819c2e7" )
14+ t .Setenv ("CODER_TASK_PROMPT" , "some task prompt" )
15+
1316 t .Run ("OK" , func (t * testing.T ) {
14- t .Setenv ("CODER_TASK_ID" , "7d8d4c2e-fb57-44f9-a183-22509819c2e7" )
15- t .Setenv ("CODER_TASK_PROMPT" , "some task prompt" )
17+ t .Parallel ()
1618
1719 resource .Test (t , resource.TestCase {
1820 ProviderFactories : coderFactory (),
You can’t perform that action at this time.
0 commit comments