Skip to content

Commit

Permalink
make testAccBinaryAuthorizationPolicyFull beta only again
Browse files Browse the repository at this point in the history
  • Loading branch information
drebes authored and modular-magician committed Aug 6, 2019
1 parent c87f8c4 commit 8eb668f
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func TestAccBinaryAuthorizationPolicy_basic(t *testing.T) {
})
}

<% unless version == 'ga' -%>
func TestAccBinaryAuthorizationPolicy_full(t *testing.T) {
t.Parallel()

Expand All @@ -53,7 +54,7 @@ func TestAccBinaryAuthorizationPolicy_full(t *testing.T) {
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccBinaryAuthorizationPolicyFull(pid, pname, org, billingId, note, attestor, "DISABLE"),
Config: testAccBinaryAuthorizationPolicyFull(pid, pname, org, billingId, note, attestor, "ENABLE"),
},
{
ResourceName: "google_binary_authorization_policy.policy",
Expand Down Expand Up @@ -124,15 +125,15 @@ func TestAccBinaryAuthorizationPolicy_update(t *testing.T) {
ImportStateVerify: true,
},
{
Config: testAccBinaryAuthorizationPolicyFull(pid, pname, org, billingId, note, attestor, "DISABLE"),
Config: testAccBinaryAuthorizationPolicyFull(pid, pname, org, billingId, note, attestor, "ENABLE"),
},
{
ResourceName: "google_binary_authorization_policy.policy",
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccBinaryAuthorizationPolicyFull(pid, pname, org, billingId, note, attestor, "ENABLE"),
Config: testAccBinaryAuthorizationPolicyFull(pid, pname, org, billingId, note, attestor, "DISABLE"),
},
{
ResourceName: "google_binary_authorization_policy.policy",
Expand All @@ -156,7 +157,12 @@ func TestAccBinaryAuthorizationPolicy_update(t *testing.T) {
},
})
}
<% else -%>

// Because Container Analysis is still in beta, we can't run any of the tests that call that
// resource without vendoring in the full beta provider.

<% end -%>
func testAccCheckBinaryAuthorizationPolicyDefault(pid string) resource.TestCheckFunc {
return func(s *terraform.State) error {
config := testAccProvider.Meta().(*Config)
Expand Down Expand Up @@ -212,6 +218,7 @@ resource "google_binary_authorization_policy" "policy" {
`, pid, pname, org, billing)
}

<% unless version == 'ga' -%>
func testAccBinaryAuthorizationPolicyFull(pid, pname, org, billing, note, attestor, gpmode string) string {
return fmt.Sprintf(`
// Use a separate project since each project can only have one policy
Expand Down Expand Up @@ -271,7 +278,7 @@ resource "google_binary_authorization_policy" "policy" {
require_attestations_by = ["${google_binary_authorization_attestor.attestor.name}"]
}

global_policy_evaluation mode = "%s"
global_policy_evaluation_mode = "%s"
}
`, pid, pname, org, billing, note, attestor, gpmode)
}
Expand Down Expand Up @@ -337,3 +344,5 @@ resource "google_binary_authorization_policy" "policy" {
}
`, pid, pname, org, billing, note, attestor)
}

<% end -%>

0 comments on commit 8eb668f

Please sign in to comment.