Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit193a93b

Browse files
test: remove tests that require an ai prompt parameter
1 parentf819477 commit193a93b

File tree

2 files changed

+1
-46
lines changed

2 files changed

+1
-46
lines changed

‎provisioner/terraform/provision_test.go‎

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,29 +1048,6 @@ func TestProvision(t *testing.T) {
10481048
}},
10491049
},
10501050
},
1051-
{
1052-
Name:"ai-task-required-prompt-param",
1053-
Files:map[string]string{
1054-
"main.tf":`terraform {
1055-
required_providers {
1056-
coder = {
1057-
source = "coder/coder"
1058-
version = ">= 2.7.0"
1059-
}
1060-
}
1061-
}
1062-
resource "coder_ai_task" "a" {
1063-
sidebar_app {
1064-
id = "7128be08-8722-44cb-bbe1-b5a391c4d94b" # fake ID, irrelevant here anyway but needed for validation
1065-
}
1066-
}
1067-
`,
1068-
},
1069-
Request:&proto.PlanRequest{},
1070-
Response:&proto.PlanComplete{
1071-
Error:fmt.Sprintf("plan resources: coder_parameter named '%s' is required when 'coder_ai_task' resource is defined",provider.TaskPromptParameterName),
1072-
},
1073-
},
10741051
{
10751052
Name:"ai-task-multiple-allowed-in-plan",
10761053
Files:map[string]string{
@@ -1167,7 +1144,7 @@ func TestProvision(t *testing.T) {
11671144
required_providers {
11681145
coder = {
11691146
source = "coder/coder"
1170-
version = ">= 2.7.0"
1147+
version = "= 2.12.0-pre0"
11711148
}
11721149
}
11731150
}

‎provisioner/terraform/resources_test.go‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import (
1616
"github.com/stretchr/testify/require"
1717
protobuf"google.golang.org/protobuf/proto"
1818

19-
"github.com/coder/terraform-provider-coder/v2/provider"
20-
2119
"cdr.dev/slog"
2220
"cdr.dev/slog/sloggers/slogtest"
2321

@@ -1528,26 +1526,6 @@ func TestAITasks(t *testing.T) {
15281526
t.Parallel()
15291527
ctx,logger:=ctxAndLogger(t)
15301528

1531-
t.Run("Prompt parameter is required",func(t*testing.T) {
1532-
t.Parallel()
1533-
1534-
// nolint:dogsled
1535-
_,filename,_,_:=runtime.Caller(0)
1536-
1537-
dir:=filepath.Join(filepath.Dir(filename),"testdata","resources","ai-tasks-missing-prompt")
1538-
tfPlanRaw,err:=os.ReadFile(filepath.Join(dir,"ai-tasks-missing-prompt.tfplan.json"))
1539-
require.NoError(t,err)
1540-
vartfPlan tfjson.Plan
1541-
err=json.Unmarshal(tfPlanRaw,&tfPlan)
1542-
require.NoError(t,err)
1543-
tfPlanGraph,err:=os.ReadFile(filepath.Join(dir,"ai-tasks-missing-prompt.tfplan.dot"))
1544-
require.NoError(t,err)
1545-
1546-
state,err:=terraform.ConvertState(ctx, []*tfjson.StateModule{tfPlan.PlannedValues.RootModule,tfPlan.PriorState.Values.RootModule},string(tfPlanGraph),logger)
1547-
require.Nil(t,state)
1548-
require.ErrorContains(t,err,fmt.Sprintf("coder_parameter named '%s' is required when 'coder_ai_task' resource is defined",provider.TaskPromptParameterName))
1549-
})
1550-
15511529
t.Run("Multiple tasks can be defined",func(t*testing.T) {
15521530
t.Parallel()
15531531

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp