From 62600351d97fcfc76edc4cd14f241a01ca5851a9 Mon Sep 17 00:00:00 2001 From: Keran Yang Date: Tue, 12 Sep 2023 17:16:16 -0400 Subject: [PATCH] fix: make CI unit tests pass (#82) Signed-off-by: Keran Yang --- .github/workflows/ci.yaml | 18 ++++++++++++++++++ pkg/info/server_info_test.go | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index aad64817..17e62b2a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,5 +23,23 @@ jobs: - name: Get dependencies run: go mod download + - name: Install protoc + run: | + set -eux -o pipefail + PROTOC_VERSION=3.19.4 + PROTOC_ZIP=protoc-$PROTOC_VERSION-linux-x86_64.zip + curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP + sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc + sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*' + sudo chmod +x /usr/local/bin/protoc + sudo find /usr/local/include -type f | xargs sudo chmod a+r + sudo find /usr/local/include -type d | xargs sudo chmod a+rx + rm -f $PROTOC_ZIP + ls /usr/local/include/google/protobuf/ + + - name: Install mockgen + run: | + go install github.com/golang/mock/mockgen@v1.6.0 + - name: Test run: make all diff --git a/pkg/info/server_info_test.go b/pkg/info/server_info_test.go index f3a7e808..c30a7b65 100644 --- a/pkg/info/server_info_test.go +++ b/pkg/info/server_info_test.go @@ -52,7 +52,7 @@ func Test_WaitUntilReady(t *testing.T) { } func Test_Read_Write(t *testing.T) { - filepath := os.TempDir() + "server-info" + filepath := os.TempDir() + "/server-info" defer os.Remove(filepath) info := &ServerInfo{ Protocol: TCP,