Skip to content

Commit 42923c6

Browse files
trouzeclaude
andcommitted
fix: set matching triggers in job_type transition test configs
The API infers job_type from triggers rather than honoring the explicit field alone. Set schedule=true for scheduled jobs and on_merge=true for merge jobs so the API returns the expected job_type value. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 2087eef commit 42923c6

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

pkg/framework/objects/job/resource_acceptance_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,15 @@ func TestAccDbtCloudJobResourceJobTypeCIRequiresReplacement(t *testing.T) {
11061106
}
11071107

11081108
func testAccDbtCloudJobResourceJobTypeTransitionConfig(jobName, projectName, environmentName, jobType string) string {
1109+
// The API infers job_type from triggers, so we must set matching triggers.
1110+
scheduleTrigger := "false"
1111+
onMergeTrigger := "false"
1112+
switch jobType {
1113+
case "scheduled":
1114+
scheduleTrigger = "true"
1115+
case "merge":
1116+
onMergeTrigger = "true"
1117+
}
11091118
return fmt.Sprintf(`
11101119
resource "dbtcloud_project" "test_job_project" {
11111120
name = "%s"
@@ -1126,11 +1135,12 @@ resource "dbtcloud_job" "test_job" {
11261135
triggers = {
11271136
"github_webhook" : false,
11281137
"git_provider_webhook": false,
1129-
"schedule" : false,
1138+
"schedule" : %s,
1139+
"on_merge" : %s,
11301140
}
11311141
job_type = "%s"
11321142
}
1133-
`, projectName, environmentName, acctest_config.DBT_CLOUD_VERSION, jobName, jobType)
1143+
`, projectName, environmentName, acctest_config.DBT_CLOUD_VERSION, jobName, scheduleTrigger, onMergeTrigger, jobType)
11341144
}
11351145

11361146
func testAccDbtCloudJobResourceJobTypeCIConfig(jobName, projectName, environmentName string) string {

0 commit comments

Comments
 (0)