Skip to content

Commit 682d447

Browse files
committed
Add different path for macOS
1 parent bf50d27 commit 682d447

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

.semaphore/semaphore_commands.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ if [ "$EXPECT_LINK_INFO" = "dynamic" ]; then export GO_TAGS="-tags dynamic" && c
44
for dir in kafka examples ; do (cd $dir && go install $GO_TAGS ./...) ; done
55
if [[ -f .do_lint ]]; then golint -set_exit_status ./examples/... ./kafka/... ./kafkatest/... ./soaktest/... ./schemaregistry/...; fi
66
for dir in kafka schemaregistry ; do (cd $dir && go test -coverprofile="$coverage_profile" -timeout 180s -v $GO_TAGS ./...) ; done
7-
if [[ $(command codesign) ]]; then codesign -f -s - $(which go-kafkacat); fi
8-
go-kafkacat --help
9-
library-version
10-
(library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
7+
8+
# If we're on newer macOS, avoid running binaries that are not code-signed, rather, use go run.
9+
# Running go-kafkacat with `go run` needs some `go get` commands, so just check existence instead.
10+
if [[ $(command codesign) ]]; then
11+
command go-kafkacat
12+
go run examples/library-version/library-version.go
13+
(go run examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
14+
else
15+
go-kafkacat --help
16+
library-version
17+
(library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
18+
fi
1119

1220
(gocovmerge $(find . -type f -iname "*coverage.txt") > ${coverage_profile}) || (echo "Failed to merge coverage files" && exit 0)
13-
artifact push workflow ${coverage_profile} || true
21+
artifact push workflow ${coverage_profile} || true

.semaphore/semaphore_integration_commands.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ for dir in kafka examples ; do (cd $dir && go install $GO_TAGS ./...) ; done
55
if [[ -f .do_lint ]]; then golint -set_exit_status ./examples/... ./kafka/... ./kafkatest/... ./soaktest/... ./schemaregistry/...; fi
66
for dir in kafka schemaregistry ; do (cd $dir && go test -coverprofile="$coverage_profile" -timeout 180s -v $GO_TAGS ./...) ; done
77
(cd kafka && go test -v $GO_TAGS -timeout 3600s -run ^TestIntegration$ -docker.needed=true ; cd ..)
8-
if [[ $(command codesign) ]]; then codesign -f -s - $(which go-kafkacat); fi
9-
go-kafkacat --help
10-
library-version
11-
(library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
8+
9+
# If we're on newer macOS, avoid running binaries that are not code-signed, rather, use go run.
10+
# Running go-kafkacat with `go run` needs some `go get` commands, so just check existence instead.
11+
if [[ $(command codesign) ]]; then
12+
command go-kafkacat
13+
go run examples/library-version/library-version.go
14+
(go run examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
15+
else
16+
go-kafkacat --help
17+
library-version
18+
(library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
19+
fi
1220

1321
(gocovmerge $(find . -type f -iname "*coverage.txt") > ${coverage_profile}) || (echo "Failed to merge coverage files" && exit 0)
14-
artifact push workflow ${coverage_profile} || true
22+
artifact push workflow ${coverage_profile} || true

0 commit comments

Comments
 (0)