Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ blocks:
task:
agent:
machine:
type: s1-prod-macos-13-5-arm64
type: s1-macos-15-arm64-8
prologue:
commands:
- sem-version go 1.21
Expand Down
9 changes: 5 additions & 4 deletions .semaphore/semaphore_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ if [ "$EXPECT_LINK_INFO" = "dynamic" ]; then export GO_TAGS="-tags dynamic" && c
for dir in kafka examples ; do (cd $dir && go install $GO_TAGS ./...) ; done
if [[ -f .do_lint ]]; then golint -set_exit_status ./examples/... ./kafka/... ./kafkatest/... ./soaktest/... ./schemaregistry/...; fi
for dir in kafka schemaregistry ; do (cd $dir && go test -coverprofile="$coverage_profile" -timeout 180s -v $GO_TAGS ./...) ; done
go-kafkacat --help
library-version
(library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)

# If we're on newer macOS, avoid running binaries that are not code-signed, rather, use go run.
# Running go-kafkacat with `go run` needs some `go get` commands, so just check existence instead.
if [[ $(command -v codesign) ]]; then which go-kafkacat; go run $GO_TAGS examples/library-version/library-version.go; (go run $GO_TAGS examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi

(gocovmerge $(find . -type f -iname "*coverage.txt") > ${coverage_profile}) || (echo "Failed to merge coverage files" && exit 0)
artifact push workflow ${coverage_profile} || true
artifact push workflow ${coverage_profile} || true
9 changes: 5 additions & 4 deletions .semaphore/semaphore_integration_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ for dir in kafka examples ; do (cd $dir && go install $GO_TAGS ./...) ; done
if [[ -f .do_lint ]]; then golint -set_exit_status ./examples/... ./kafka/... ./kafkatest/... ./soaktest/... ./schemaregistry/...; fi
for dir in kafka schemaregistry ; do (cd $dir && go test -coverprofile="$coverage_profile" -timeout 180s -v $GO_TAGS ./...) ; done
(cd kafka && go test -v $GO_TAGS -timeout 3600s -run ^TestIntegration$ -docker.needed=true ; cd ..)
go-kafkacat --help
library-version
(library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)

# If we're on newer macOS, avoid running binaries that are not code-signed, rather, use go run.
# Running go-kafkacat with `go run` needs some `go get` commands, so just check existence instead.
if [[ $(command -v codesign) ]]; then which go-kafkacat; go run $GO_TAGS examples/library-version/library-version.go; (go run $GO_TAGS examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

The command go run examples/library-version/library-version.go is executed twice in the same line, which is inefficient. Consider storing the output in a variable and reusing it.

Suggested change
if [[ $(command -v codesign) ]]; then which go-kafkacat; go run $GO_TAGS examples/library-version/library-version.go; (go run $GO_TAGS examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi
if [[ $(command -v codesign) ]]; then which go-kafkacat; output=$(go run $GO_TAGS examples/library-version/library-version.go); echo "$output"; (echo "$output" | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi

Copilot uses AI. Check for mistakes.

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