From d7ed4b0605accf15ba3f2a42f3578bf71e11e2d5 Mon Sep 17 00:00:00 2001 From: Kristin Laemmert Date: Wed, 25 Sep 2019 14:55:26 -0400 Subject: [PATCH] tools/terraform-bundle: update e2e tests with current tf and provider versions The terraform version was hard-coded to 0.10.2, and the provider versions supported the older provider protocol version 4. --- .../terraform-bundle/e2etest/package_test.go | 37 ++++++++++--------- .../testdata/empty/terraform-bundle.hcl | 2 +- .../many-providers/terraform-bundle.hcl | 10 ++--- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/tools/terraform-bundle/e2etest/package_test.go b/tools/terraform-bundle/e2etest/package_test.go index fa920cabf..771f4acef 100644 --- a/tools/terraform-bundle/e2etest/package_test.go +++ b/tools/terraform-bundle/e2etest/package_test.go @@ -31,10 +31,10 @@ func TestPackage_empty(t *testing.T) { t.Errorf("unexpected stderr output:\n%s", stderr) } - if !strings.Contains(stdout, "Fetching Terraform 0.10.1 core package...") { + if !strings.Contains(stdout, "Fetching Terraform 0.12.0 core package...") { t.Errorf("success message is missing from output:\n%s", stdout) } - if !strings.Contains(stdout, "Creating terraform_0.10.1-bundle") { + if !strings.Contains(stdout, "Creating terraform_0.12.0-bundle") { t.Errorf("success message is missing from output:\n%s", stdout) } if !strings.Contains(stdout, "All done!") { @@ -65,36 +65,37 @@ func TestPackage_manyProviders(t *testing.T) { t.Errorf("unexpected stderr output:\n%s", stderr) } - if !strings.Contains(stdout, "Checking for available provider plugins on ") { - t.Errorf("success message is missing from output:\n%s", stdout) - } - // Here we have to check each provider separately // because it's internally held in a map (i.e. not guaranteed order) - if !strings.Contains(stdout, `- Resolving "aws" provider (~> 0.1)... -- Downloading plugin for provider "aws" (0.1.4)...`) { + if !strings.Contains(stdout, `- Resolving "aws" provider (~> 2.26.0)... +- Checking for provider plugin on https://releases.hashicorp.com... +- Downloading plugin for provider "aws" (hashicorp/aws) 2.26.0...`) { t.Errorf("success message is missing from output:\n%s", stdout) } - if !strings.Contains(stdout, `- Resolving "kubernetes" provider (0.1.0)... -- Downloading plugin for provider "kubernetes" (0.1.0)... -- Resolving "kubernetes" provider (0.1.1)... -- Downloading plugin for provider "kubernetes" (0.1.1)... -- Resolving "kubernetes" provider (0.1.2)... -- Downloading plugin for provider "kubernetes" (0.1.2)...`) { + if !strings.Contains(stdout, `- Resolving "kubernetes" provider (1.8.0)... +- Checking for provider plugin on https://releases.hashicorp.com... +- Downloading plugin for provider "kubernetes" (hashicorp/kubernetes) 1.8.0... +- Resolving "kubernetes" provider (1.8.1)... +- Checking for provider plugin on https://releases.hashicorp.com... +- Downloading plugin for provider "kubernetes" (hashicorp/kubernetes) 1.8.1... +- Resolving "kubernetes" provider (1.9.0)... +- Checking for provider plugin on https://releases.hashicorp.com... +- Downloading plugin for provider "kubernetes" (hashicorp/kubernetes) 1.9.0...`) { t.Errorf("success message is missing from output:\n%s", stdout) } - if !strings.Contains(stdout, `- Resolving "null" provider (0.1.0)... -- Downloading plugin for provider "null" (0.1.0)...`) { + if !strings.Contains(stdout, `- Resolving "null" provider (2.1.0)... +- Checking for provider plugin on https://releases.hashicorp.com... +- Downloading plugin for provider "null" (hashicorp/null) 2.1.0...`) { t.Errorf("success message is missing from output:\n%s", stdout) } - if !strings.Contains(stdout, "Fetching Terraform 0.10.1 core package...") { + if !strings.Contains(stdout, "Fetching Terraform 0.12.0 core package...") { t.Errorf("success message is missing from output:\n%s", stdout) } - if !strings.Contains(stdout, "Creating terraform_0.10.1-bundle") { + if !strings.Contains(stdout, "Creating terraform_0.12.0-bundle") { t.Errorf("success message is missing from output:\n%s", stdout) } if !strings.Contains(stdout, "All done!") { diff --git a/tools/terraform-bundle/e2etest/testdata/empty/terraform-bundle.hcl b/tools/terraform-bundle/e2etest/testdata/empty/terraform-bundle.hcl index 5350cab4a..328017f8a 100644 --- a/tools/terraform-bundle/e2etest/testdata/empty/terraform-bundle.hcl +++ b/tools/terraform-bundle/e2etest/testdata/empty/terraform-bundle.hcl @@ -1,3 +1,3 @@ terraform { - version = "0.10.1" + version = "0.12.0" } diff --git a/tools/terraform-bundle/e2etest/testdata/many-providers/terraform-bundle.hcl b/tools/terraform-bundle/e2etest/testdata/many-providers/terraform-bundle.hcl index 05ddc8b5f..edc77794d 100644 --- a/tools/terraform-bundle/e2etest/testdata/many-providers/terraform-bundle.hcl +++ b/tools/terraform-bundle/e2etest/testdata/many-providers/terraform-bundle.hcl @@ -1,9 +1,9 @@ terraform { - version = "0.10.1" + version = "0.12.0" } providers { - aws = ["~> 0.1"] - kubernetes = ["0.1.0", "0.1.1", "0.1.2"] - null = ["0.1.0"] -} \ No newline at end of file + aws = ["~> 2.26.0"] + kubernetes = ["1.8.0", "1.8.1", "1.9.0"] + null = ["2.1.0"] +}