Skip to content

Commit

Permalink
Merge pull request #498 from hashicorp/patch-instance-script
Browse files Browse the repository at this point in the history
[Fix] Remove incorrect parameter to read go.mod version, use go-version-file
  • Loading branch information
sebasslash committed Aug 11, 2022
2 parents 965708d + d35984e commit b117a0b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tflocal-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: go.mod
go-version-file: go.mod
check-latest: true
cache: true

Expand Down
40 changes: 20 additions & 20 deletions state_version_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,20 @@ func TestStateVersionsList(t *testing.T) {
require.NoError(t, err)
require.NotEmpty(t, svl.Items)

// We need to strip the upload URL as that is a dynamic link.
svTest1.DownloadURL = ""
svTest2.DownloadURL = ""

// And for the retrieved configuration versions as well.
for _, sv := range svl.Items {
sv.DownloadURL = ""
}

// outputs are populated only once the state has been parsed by TFC
// outputs, providers are populated only once the state has been parsed by TFC
// which can cause the tests to fail if it doesn't happen fast enough.
// download url is ignored since it is a dynamic lin
for idx := range svl.Items {
svl.Items[idx].DownloadURL = ""
svl.Items[idx].Outputs = nil
svl.Items[idx].Providers = nil
}

for _, sv := range []*StateVersion{svTest1, svTest2} {
sv.DownloadURL = ""
sv.Outputs = nil
sv.Providers = nil
}
svTest1.Outputs = nil
svTest2.Outputs = nil

assert.Contains(t, svl.Items, svTest1)
assert.Contains(t, svl.Items, svTest2)
Expand Down Expand Up @@ -393,15 +391,17 @@ func TestStateVersionsCurrent(t *testing.T) {
sv, err := client.StateVersions.ReadCurrent(ctx, wTest1.ID)
require.NoError(t, err)

// Don't compare the DownloadURL because it will be generated twice
// in this test - once at creation of the configuration version, and
// again during the GET.
svTest.DownloadURL, sv.DownloadURL = "", ""
for _, stateVersion := range []*StateVersion{svTest, sv} {
// Don't compare the DownloadURL because it will be generated twice
// in this test - once at creation of the configuration version, and
// again during the GET.
stateVersion.DownloadURL = ""

// outputs are populated only once the state has been parsed by TFC
// which can cause the tests to fail if it doesn't happen fast enough.
svTest.Outputs = nil
sv.Outputs = nil
// outputs, providers are populated only once the state has been parsed by TFC
// which can cause the tests to fail if it doesn't happen fast enough.
stateVersion.Outputs = nil
stateVersion.Providers = nil
}

assert.Equal(t, svTest, sv)
})
Expand Down

0 comments on commit b117a0b

Please sign in to comment.