diff --git a/.gitignore b/.gitignore index b190c8407..61590db08 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ tmp-build .go-version .vscode/ .trunk/ +**/coverage.txt diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 2b6cacf73..bc895d082 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -7,10 +7,36 @@ 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: + - tail $GO_COVERAGE_PROFILE + - . 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: @@ -114,27 +140,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 diff --git a/.semaphore/semaphore_integration_commands.sh b/.semaphore/semaphore_integration_commands.sh index 4c57b6c47..22b88f92e 100644 --- a/.semaphore/semaphore_integration_commands.sh +++ b/.semaphore/semaphore_integration_commands.sh @@ -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) \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..330a45001 --- /dev/null +++ b/sonar-project.properties @@ -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=.