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

DGS-16859: Run SonarQube report in pipeline #1362

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ tmp-build
.go-version
.vscode/
.trunk/
**/coverage.txt
73 changes: 49 additions & 24 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,35 @@ global_job_config:
env_vars:
- name: LIBRDKAFKA_VERSION
value: v2.6.1
- name: GO_COVERAGE_PROFILE
value: coverage.txt
prologue:
commands:
- checkout
blocks:
- name: "TEMP go tests"
dependencies: [ ]
task:
agent:
machine:
type: s1-prod-ubuntu20-04-amd64-1
prologue:
commands:
- sem-version go 1.21
- export GOPATH=$(go env GOPATH)
- export PATH="$PATH:$GOPATH/bin"
- go install golang.org/x/lint/golint@latest && touch .do_lint
jobs:
- name: "Test"
commands:
- go test -timeout 180s -v -coverprofile=$GO_COVERAGE_PROFILE ./...
epilogue:
always:
commands:
- . publish-test-results
- test-results gen-pipeline-report
- sem-version java 11
- emit-sonarqube-data --run_only_sonar_scan
- name: "go 1.21 OSX bundled librdkafka"
dependencies: [ ]
task:
Expand Down Expand Up @@ -114,27 +139,27 @@ blocks:
- name: EXPECT_LINK_INFO
value: dynamic
commands_file: semaphore_commands.sh
- name: "go 1.21 Windows bundled librdkafka"
dependencies: [ ]
task:
agent:
machine:
type: s1-prod-windows
prologue:
commands:
# Install Go
- "& .\\mk\\setup-go.ps1"
# Set up msys2
- ".\\mk\\mingw-w64\\setup-msys2.ps1"
- $env:PATH = 'C:\msys64\usr\bin;' + $env:PATH
- bash -lc './mk/mingw-w64/msys2-dependencies.sh'
jobs:
- name: "Static Build"
env_vars:
- name: EXPECT_LINK_INFO
value: static
- name: CHERE_INVOKING
value: 'yes'
- name: MSYSTEM
value: UCRT64
commands_file: semaphore_commands.ps1
# - name: "go 1.21 Windows bundled librdkafka"
# dependencies: [ ]
# task:
# agent:
# machine:
# type: s1-prod-windows
# prologue:
# commands:
# # Install Go
# - "& .\\mk\\setup-go.ps1"
# # Set up msys2
# - ".\\mk\\mingw-w64\\setup-msys2.ps1"
# - $env:PATH = 'C:\msys64\usr\bin;' + $env:PATH
# - bash -lc './mk/mingw-w64/msys2-dependencies.sh'
# jobs:
# - name: "Static Build"
# env_vars:
# - name: EXPECT_LINK_INFO
# value: static
# - name: CHERE_INVOKING
# value: 'yes'
# - name: MSYSTEM
# value: UCRT64
# commands_file: semaphore_commands.ps1
2 changes: 1 addition & 1 deletion .semaphore/semaphore_integration_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ for dir in kafka schemaregistry ; do (cd $dir && go test -timeout 180s -v $GO_TA
(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)
(library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
8 changes: 8 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### service-bot sonarqube plugin managed file
sonar.coverage.exclusions=**/test/**/*,**/tests/**/*,**/mock/**/*,**/mocks/**/*,**/*mock*,**/*test*
sonar.cpd.exclusions=**/test/**/*,**/tests/**/*,**/mock/**/*,**/mocks/**/*,**/*mock*,**/*test*
sonar.exclusions=**/*.pb.*,**/mk-include/**/*
sonar.go.coverage.reportPaths=**/coverage.txt
sonar.language=go
sonar.projectKey=confluent-kafka-go
sonar.sources=.