Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip and fix failing tests on Apple Silicon #739

Merged
merged 1 commit into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package handlers
import (
"fmt"
"path/filepath"
"runtime"
"testing"

"github.com/creachadair/jrpc2/code"
Expand Down Expand Up @@ -116,6 +117,13 @@ func TestLangServer_workspaceExecuteCommand_modules_basic(t *testing.T) {
}

func TestLangServer_workspaceExecuteCommand_modules_multiple(t *testing.T) {
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
// The underlying API is now deprecated anyway
// so it's not worth adapting tests for all platforms.
// We just skip tests on Apple Silicon.
t.Skip("deprecated API")
}

testData, err := filepath.Abs("testdata")
if err != nil {
t.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion internal/terraform/exec/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func newExecutor(t *testing.T) TerraformExecutor {
t.Fatal(err)
}

opts := tfinstall.ExactVersion("0.13.1", installDir)
opts := tfinstall.ExactVersion("1.1.0", installDir)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For posterity 1.0.2 was the first version to support darwin/arm64:
https://releases.hashicorp.com/terraform/1.0.2/

execPath, err := opts.ExecPath(context.Background())
if err != nil {
t.Fatal(err)
Expand Down
7 changes: 7 additions & 0 deletions internal/terraform/module/module_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"log"
"os"
"path/filepath"
"runtime"
"testing"

"github.com/google/go-cmp/cmp"
Expand All @@ -16,6 +17,12 @@ import (
)

func TestModuleManager_ModuleCandidatesByPath(t *testing.T) {
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
// The underlying API is now deprecated anyway
// so it's not worth adapting tests for all platforms.
// We just skip tests on Apple Silicon.
t.Skip("deprecated API")
}
testData, err := filepath.Abs("testdata")
if err != nil {
t.Fatal(err)
Expand Down