Skip to content

Commit 700afe4

Browse files
committed
Improve test times by pre-installing Terraform
1 parent 65f378c commit 700afe4

File tree

5 files changed

+8
-17
lines changed

5 files changed

+8
-17
lines changed

.github/workflows/coder.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ jobs:
148148
149149
- run: go install gotest.tools/gotestsum@latest
150150

151+
- uses: hashicorp/setup-terraform@v1
152+
with:
153+
terraform_version: 1.1.2
154+
151155
- name: Test with Mock Database
152156
run:
153157
gotestsum --jsonfile="gotests.json" --packages="./..." --

coderd/userpassword/userpassword_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This test runs slowly on MacOS instance, and really
2+
// only needs to run on Linux anyways.
3+
//go:build linux
4+
15
package userpassword_test
26

37
import (

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ require (
1313
github.com/golang-migrate/migrate/v4 v4.15.1
1414
github.com/google/uuid v1.3.0
1515
github.com/hashicorp/go-version v1.4.0
16-
github.com/hashicorp/hc-install v0.3.1
1716
github.com/hashicorp/terraform-config-inspect v0.0.0-20211115214459-90acf1ca460f
1817
github.com/hashicorp/terraform-exec v0.15.0
1918
github.com/justinas/nosurf v1.1.1
@@ -64,7 +63,6 @@ require (
6463
github.com/google/go-cmp v0.5.7 // indirect
6564
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
6665
github.com/hashicorp/errwrap v1.1.0 // indirect
67-
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
6866
github.com/hashicorp/go-multierror v1.1.1 // indirect
6967
github.com/hashicorp/hcl v1.0.0 // indirect
7068
github.com/hashicorp/hcl/v2 v2.11.1 // indirect

go.sum

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,8 +693,6 @@ github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09
693693
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
694694
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
695695
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
696-
github.com/hashicorp/hc-install v0.3.1 h1:VIjllE6KyAI1A244G8kTaHXy+TL5/XYzvrtFi8po/Yk=
697-
github.com/hashicorp/hc-install v0.3.1/go.mod h1:3LCdWcCDS1gaHC9mhHCGbkYfoY6vdsKohGjugbZdZak=
698696
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
699697
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
700698
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
@@ -1309,7 +1307,6 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh
13091307
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
13101308
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
13111309
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
1312-
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
13131310
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
13141311
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
13151312
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=

provisioner/terraform/provision_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,16 @@ import (
99
"path/filepath"
1010
"testing"
1111

12-
"github.com/hashicorp/go-version"
1312
"github.com/stretchr/testify/require"
1413
"storj.io/drpc/drpcconn"
1514

1615
"github.com/coder/coder/provisionersdk"
1716
"github.com/coder/coder/provisionersdk/proto"
18-
19-
"github.com/hashicorp/hc-install/product"
20-
"github.com/hashicorp/hc-install/releases"
2117
)
2218

2319
func TestProvision(t *testing.T) {
2420
t.Parallel()
2521

26-
installer := &releases.ExactVersion{
27-
Product: product.Terraform,
28-
Version: version.Must(version.NewVersion("1.1.2")),
29-
}
30-
execPath, err := installer.Install(context.Background())
31-
require.NoError(t, err)
32-
3322
client, server := provisionersdk.TransportPipe()
3423
ctx, cancelFunc := context.WithCancel(context.Background())
3524
t.Cleanup(func() {
@@ -42,7 +31,6 @@ func TestProvision(t *testing.T) {
4231
ServeOptions: &provisionersdk.ServeOptions{
4332
Transport: server,
4433
},
45-
BinaryPath: execPath,
4634
})
4735
require.NoError(t, err)
4836
}()

0 commit comments

Comments
 (0)