Skip to content

Commit

Permalink
chore: update tests for new osx paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Mar 11, 2021
1 parent 5f21f62 commit 93e2b42
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion v3/installer/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ func (i *Installer) getLibDstForPackage(pkg string) (string, error) {
}

var setOSXInstallName = func(file string, lib string) error {
cmd := exec.Command("install_name_tool", "-id", fmt.Sprintf("../../libs/%s.dylib", lib), file)
cmd := exec.Command("install_name_tool", "-id", fmt.Sprintf("/opt/pact/%s.dylib", lib), file)
// cmd := exec.Command("install_name_tool", "-id", fmt.Sprintf("../../libs/%s.dylib", lib), file)
stdoutStderr, err := cmd.CombinedOutput()

if err != nil {
Expand Down
12 changes: 7 additions & 5 deletions v3/installer/installer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestInstallerDownloader(t *testing.T) {
{
name: "mock server - linux x86",
pkg: mockServerPackage,
want: "https://github.com/pact-foundation/pact-reference/releases/download/libpact_mock_server_ffi-v0.0.14/libpact_mock_server_ffi-linux-x86_64.so.gz",
want: "https://github.com/pact-foundation/pact-reference/releases/download/libpact_mock_server_ffi-v0.0.15/libpact_mock_server_ffi-linux-x86_64.so.gz",
test: Installer{
os: linux,
arch: x86_64,
Expand All @@ -34,7 +34,7 @@ func TestInstallerDownloader(t *testing.T) {
{
name: "mock server - osx x86",
pkg: mockServerPackage,
want: "https://github.com/pact-foundation/pact-reference/releases/download/libpact_mock_server_ffi-v0.0.14/libpact_mock_server_ffi-osx-x86_64.dylib.gz",
want: "https://github.com/pact-foundation/pact-reference/releases/download/libpact_mock_server_ffi-v0.0.15/libpact_mock_server_ffi-osx-x86_64.dylib.gz",
test: Installer{
os: osx,
arch: x86_64,
Expand All @@ -43,7 +43,7 @@ func TestInstallerDownloader(t *testing.T) {
{
name: "mock server - linux x86",
pkg: mockServerPackage,
want: "https://github.com/pact-foundation/pact-reference/releases/download/libpact_mock_server_ffi-v0.0.14/libpact_mock_server_ffi-windows-x86_64.dll.gz",
want: "https://github.com/pact-foundation/pact-reference/releases/download/libpact_mock_server_ffi-v0.0.15/libpact_mock_server_ffi-windows-x86_64.dll.gz",
test: Installer{
os: windows,
arch: x86_64,
Expand Down Expand Up @@ -90,14 +90,16 @@ func TestInstallerDownloader(t *testing.T) {
},
mockServerPackage: {
libName: "libpact_mock_server_ffi",
version: "0.0.14",
semverRange: ">= 0.0.14, < 1.0.0",
version: "0.0.15",
semverRange: ">= 0.0.15, < 1.0.0",
testCommand: func() string {
return "0.0.13"
},
},
}

// TODO:

})

t.Run("errors if installed versions are out of date", func(t *testing.T) {
Expand Down

0 comments on commit 93e2b42

Please sign in to comment.