Skip to content

Commit

Permalink
Snowflake throws an error now if you don't have a predecessor or sche…
Browse files Browse the repository at this point in the history
…dule on a task (#241)
  • Loading branch information
chriskuchin committed Aug 11, 2020
1 parent af48558 commit 97d9a47
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions pkg/resources/task_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ var (
When: "TRUE",
Enabled: true,
SessionParams: false,
Schedule: "5 MINUTE",
},
}

Expand All @@ -118,11 +119,12 @@ var (
},

SoloTask: &TaskSettings{
Name: soloname,
Schema: "PUBLIC",
SQL: "SELECT *",
When: "FALSE",
Enabled: true,
Name: soloname,
Schema: "PUBLIC",
SQL: "SELECT *",
When: "FALSE",
Enabled: true,
Schedule: "15 MINUTE",
},
}

Expand Down Expand Up @@ -152,13 +154,12 @@ var (
When: "TRUE",
Enabled: true,
SessionParams: true,
Schedule: "5 MINUTE",
},
}
)

func Test_AccTask(t *testing.T) {
t.Skip("broken by a change to snowflake. see example https://travis-ci.com/github/chanzuckerberg/terraform-provider-snowflake/jobs/367972245#L676")

resource.Test(t, resource.TestCase{
Providers: providers(),
Steps: []resource.TestStep{
Expand Down Expand Up @@ -282,6 +283,9 @@ resource "snowflake_task" "solo_task" {
sql_statement = "{{ .SoloTask.SQL }}"
enabled = {{ .SoloTask.Enabled }}
when = "{{ .SoloTask.When }}"
{{ if .SoloTask.Schedule }}
schedule = "{{ .SoloTask.Schedule }}"
{{- end }}
{{ if .SoloTask.SessionParams}}
session_parameters = {
TIMESTAMP_INPUT_FORMAT = "YYYY-MM-DD HH24",
Expand Down

0 comments on commit 97d9a47

Please sign in to comment.