Skip to content

Commit

Permalink
Ensure jobs tests check for error
Browse files Browse the repository at this point in the history
If the tests doesn't use ApplyNoError or explicitly check the error then
it will always succeed.

Also fix the table trigger test which misused the HCL syntax and used
API v2.1 which is not the default.
  • Loading branch information
alexmos-db committed Jun 11, 2024
1 parent 91bb2cd commit 611d594
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions jobs/resource_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ func TestResourceJobCreate_ControlRunState_ContinuousCreate(t *testing.T) {
max_concurrent_runs = 1
name = "Test"
`,
}.Apply(t)
}.ApplyNoError(t)
}

func TestResourceJobCreate_Trigger_TableUpdateCreate(t *testing.T) {
Expand All @@ -1330,7 +1330,7 @@ func TestResourceJobCreate_Trigger_TableUpdateCreate(t *testing.T) {
Fixtures: []qa.HTTPFixture{
{
Method: "POST",
Resource: "/api/2.1/jobs/create",
Resource: "/api/2.0/jobs/create",
ExpectedRequest: JobSettings{
MaxConcurrentRuns: 1,
Name: "Test",
Expand All @@ -1348,7 +1348,7 @@ func TestResourceJobCreate_Trigger_TableUpdateCreate(t *testing.T) {
},
{
Method: "GET",
Resource: "/api/2.1/jobs/get?job_id=789",
Resource: "/api/2.0/jobs/get?job_id=789",
Response: Job{
JobID: 789,
Settings: &JobSettings{
Expand All @@ -1369,17 +1369,17 @@ func TestResourceJobCreate_Trigger_TableUpdateCreate(t *testing.T) {
trigger {
pause_status = "UNPAUSED"
table_update {
table_names = {
table_names = [
"catalog.schema.table1",
"catalog.schema.table2"
}
]
condition = "ALL_UPDATED"
}
}
max_concurrent_runs = 1
name = "Test"
`,
}.Apply(t)
}.ApplyNoError(t)
}

func TestResourceJobUpdate_ControlRunState_ContinuousUpdateRunNow(t *testing.T) {
Expand Down Expand Up @@ -1574,7 +1574,7 @@ func TestResourceJobCreate_ControlRunState_ContinuousUpdateCancel(t *testing.T)
max_concurrent_runs = 1
name = "Test"
`,
}.Apply(t)
}.ApplyNoError(t)
}

func TestResourceJobCreateSingleNode(t *testing.T) {
Expand Down

0 comments on commit 611d594

Please sign in to comment.