From 0f5a38b3841376f58b75a0a03a1ecad6144dc5bd Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Fri, 3 Apr 2020 13:50:08 -0400 Subject: [PATCH] internal: Fix init provider lockfile test The fake installable package meta used a ZIP archive which gave different checksums between macOS and Linux targets. This commit removes the target from the contents of this archive, and updates the golden hash value in the test to match. This test should now pass on both platforms. --- command/init_test.go | 2 +- internal/getproviders/mock_source.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/command/init_test.go b/command/init_test.go index 5cec800f9..006fb902e 100644 --- a/command/init_test.go +++ b/command/init_test.go @@ -1153,7 +1153,7 @@ func TestInit_providerLockFile(t *testing.T) { wantLockFile := strings.TrimSpace(` { "registry.terraform.io/hashicorp/test": { - "hash": "h1:4RzJudhcE4CkEwtVNRqdMKumSXu6bj8fkFTbPaX5G14=", + "hash": "h1:wlbEC2mChQZ2hhgUhl6SeVLPP7fMqOFUZAQhQ9GIIno=", "version": "1.2.3" } } diff --git a/internal/getproviders/mock_source.go b/internal/getproviders/mock_source.go index edf89e0df..3c2e80e70 100644 --- a/internal/getproviders/mock_source.go +++ b/internal/getproviders/mock_source.go @@ -162,7 +162,7 @@ func FakeInstallablePackageMeta(provider addrs.Provider, version Version, target if err != nil { return PackageMeta{}, close, fmt.Errorf("failed to add %s to mock zip file: %s", execFilename, err) } - fmt.Fprintf(fw, "This is a fake provider package for %s %s %s, not a real provider.\n", provider, version, target) + fmt.Fprintf(fw, "This is a fake provider package for %s %s, not a real provider.\n", provider, version) err = zw.Close() if err != nil { return PackageMeta{}, close, fmt.Errorf("failed to close the mock zip file: %s", err)