Skip to content

Commit

Permalink
testing: using tcp instead socket on grpc server (fixes fail tests on…
Browse files Browse the repository at this point in the history
… macos)
  • Loading branch information
morpheu committed Sep 2, 2024
1 parent f5952b4 commit 6831043
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/build/grpc_build_v1/build_service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions pkg/build/grpc_build_v1/build_service_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions pkg/build/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"fmt"
"io"
"net"
"path/filepath"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -299,7 +298,7 @@ func TestBuild(t *testing.T) {
func setupServer(t *testing.T, bs pb.BuildServer) string {
t.Helper()

l, err := net.Listen("unix", filepath.Join(t.TempDir(), "server.sock"))
l, err := net.Listen("tcp", "127.0.0.1:0")
require.NoError(t, err)

s := grpc.NewServer()
Expand All @@ -312,7 +311,7 @@ func setupServer(t *testing.T, bs pb.BuildServer) string {
require.NoError(t, nerr)
}()

return filepath.Join("unix://", l.Addr().String())
return l.Addr().String()
}

func setupClient(t *testing.T, address string) pb.BuildClient {
Expand Down

0 comments on commit 6831043

Please sign in to comment.