Skip to content

Commit

Permalink
0.15 beta testing (#119)
Browse files Browse the repository at this point in the history
* 0.15 beta testing

* increase test timeout

* bump latest 0.15 to stable release

* Fix tfinstall version test

Co-authored-by: Radek Simko <radek.simko@gmail.com>
  • Loading branch information
kmoe and radeksimko authored Apr 19, 2021
1 parent 24faa0c commit 40ffca1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ commands:
- run: go build ./...
go_test:
steps:
- run: go test -v ./...
- run:
no_output_timeout: 15m
command: go test -timeout=15m -v ./...

jobs:
# combined due to slowness of Go install
Expand Down
1 change: 1 addition & 0 deletions tfexec/internal/e2etest/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func runTest(t *testing.T, fixtureName string, cb func(t *testing.T, tfVersion *
testutil.Latest012,
testutil.Latest013,
testutil.Latest014,
testutil.Latest015,
}
if override := os.Getenv("TFEXEC_E2ETEST_VERSIONS"); override != "" {
versions = strings.Split(override, ",")
Expand Down
1 change: 1 addition & 0 deletions tfexec/internal/testutil/tfcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const (
Latest012 = "0.12.30"
Latest013 = "0.13.6"
Latest014 = "0.14.4"
Latest015 = "0.15.0"
)

const appendUserAgent = "tfexec-testutil"
Expand Down
18 changes: 12 additions & 6 deletions tfinstall/latest_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package tfinstall

import (
"context"
"encoding/json"
"io/ioutil"
"os"
"os/exec"
"strings"
"testing"

"github.com/hashicorp/go-version"
Expand All @@ -27,22 +27,28 @@ func TestLatestVersion(t *testing.T) {
t.Fatal(err)
}

cmd := exec.Command(tfpath, "version")
cmd := exec.Command(tfpath, "version", "-json")

out, err := cmd.Output()
if err != nil {
t.Fatal(err)
}

lowerBoundVersion, err := version.NewVersion("0.12.27")
lowerBoundVersion, err := version.NewVersion("0.15.0")
if err != nil {
t.Fatal(err)
}

outVersion := strings.Trim(string(out), "\n")
outVersion = strings.TrimLeft(outVersion, "Terraform v")
type versionOutput struct {
TerraformVersion string `json:"terraform_version"`
}
vOut := versionOutput{}
err = json.Unmarshal(out, &vOut)
if err != nil {
t.Fatal(err)
}

actualVersion, err := version.NewVersion(outVersion)
actualVersion, err := version.NewVersion(vOut.TerraformVersion)
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 40ffca1

Please sign in to comment.