Skip to content

Commit

Permalink
wip: TargetPool failing test for HTTPS HC
Browse files Browse the repository at this point in the history
Test that we can reference our new `google_compute_https_health_check`
resource. This currently fails for two reasons.

1. It seems that we're not able to provide more than one health check in the
   same request:

    --- FAIL: TestAccComputeTargetPool_health_checks (4.37s)
            testing.go:135: Step 0 error: Error applying: 1 error(s) occurred:

                    * 1 error(s) occurred:

                    * 1 error(s) occurred:

                    * Error creating TargetPool: googleapi: Error 413: Value for field 'resource.healthChecks' is too large, fieldSizeTooLarge

2. If we comment out the HTTP health check then it produces an error because
   the HTTPS health check comes from a different API version.

    --- FAIL: TestAccComputeTargetPool_health_checks (4.63s)
            testing.go:135: Step 0 error: Error applying: 1 error(s) occurred:

                    * 1 error(s) occurred:

                    * 1 error(s) occurred:

                    * Error creating TargetPool: googleapi: Error 400: Invalid value for field 'healthChecks': 'https://www.googleapis.com/compute/beta/projects/skilful-card-92510/global/healthChecks/foobar'.  URL version does not match the API version., invalid

I wonder whether it would be easier on both accounts to add each health
check individually.
  • Loading branch information
dcarley committed Jul 14, 2015
1 parent 2c9efd5 commit b33fc3f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions builtin/providers/google/resource_compute_target_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ func TestAccComputeTargetPool_health_checks(t *testing.T) {
testAccCheckComputeTargetPoolExists(
"google_compute_target_pool.foobar", &targetPool),
testAccCheckComputeTargetPoolHealthChecks(
[]string{"google_compute_http_health_check.foobar"}, &targetPool),
[]string{
"google_compute_http_health_check.foobar",
"google_compute_https_health_check.foobar",
}, &targetPool),
),
},
},
Expand Down Expand Up @@ -137,8 +140,15 @@ resource "google_compute_http_health_check" "foobar" {
name = "foobar"
description = "Resource created for Terraform acceptance testing"
}
resource "google_compute_https_health_check" "foobar" {
name = "foobar"
description = "Resource created for Terraform acceptance testing"
}
resource "google_compute_target_pool" "foobar" {
name = "terraform-test"
description = "Resource created for Terraform acceptance testing"
health_checks = [ "${google_compute_http_health_check.foobar.self_link}" ]
health_checks = [
"${google_compute_http_health_check.foobar.self_link}",
"${google_compute_https_health_check.foobar.self_link}",
]
}`

1 comment on commit b33fc3f

@sparkprime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's probably a limitation that you can only have 1 per target pool. I don't think that would be too severe in practice though.

Please sign in to comment.