Skip to content

Commit

Permalink
basic test passing
Browse files Browse the repository at this point in the history
  • Loading branch information
bcreddy-gcp committed Jan 30, 2025
1 parent 474f419 commit 0fdc4dd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "google_storage_bucket_object" "notebook" {
}

resource "google_colab_schedule" "{{$.PrimaryResourceId}}" {
display_name = "{{index $.Vars "displayName"}}"
display_name = "{{index $.Vars "display_name"}}"
location = "{{index $.TestEnvVars "location"}}"
max_concurrent_run_count = 2
cron = "TZ=America/Los_Angeles * * * * *"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ resource "google_dataform_repository" "dataform_repository" {
}

resource "google_colab_schedule" "{{$.PrimaryResourceId}}" {
display_name = "{{index $.Vars "displayName"}}"
display_name = "{{index $.Vars "display_name"}}"
location = "{{index $.TestEnvVars "location"}}"
allow_queueing = true
max_concurrent_run_count = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "google_storage_bucket_object" "notebook" {
}

resource "google_colab_schedule" "{{$.PrimaryResourceId}}" {
display_name = "{{index $.Vars "displayName"}}"
display_name = "{{index $.Vars "display_name"}}"
location = "{{index $.TestEnvVars "location"}}"
max_concurrent_run_count = 2
cron = "TZ=America/Los_Angeles * * * * *"
Expand Down
4 changes: 4 additions & 0 deletions mmv1/templates/terraform/post_create/colab_schedule.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ if err := d.Set("name", name); err != nil {
return fmt.Errorf("Error setting name: %s", err)
}

parts := strings.Split(longName, "/")
parts[1] = project
updatedLongName := strings.Join(parts, "/")
d.SetId(updatedLongName)

if p, ok := d.GetOk("desired_state"); ok && p.(string) == "PAUSED" {
_, err := modifyScheduleState(config, d, project, billingProject, userAgent, "pause")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"time"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/hashicorp/terraform-plugin-testing/plancheck"

"github.com/hashicorp/terraform-provider-google/google/acctest"
"github.com/hashicorp/terraform-provider-google/google/envvar"
Expand Down

0 comments on commit 0fdc4dd

Please sign in to comment.