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

Sonarqube integration #2938

Merged
merged 8 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ steps:
provider: "gcp"
artifact_paths:
- build/*.xml
- build/coverage.out

- label: ":sonarqube: Continuous Code Inspection"
env:
VAULT_SONAR_TOKEN_PATH: "kv/ci-shared/platform-ingest/elastic/fleet-server/sonar-analyze-token"
agents:
image: "docker.elastic.co/cloud-ci/sonarqube/buildkite-scanner:latest"
command:
- "buildkite-agent artifact download build/coverage.out ."
- "/scan-source-code.sh"
depends_on:
- "unit-test"
Comment on lines +46 to +55
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be running in all branches and PRs or just PRs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All branches. We also need to analyse main


- label: ":smartbear-testexecute: Run integration tests"
key: int-test
Expand Down
51 changes: 0 additions & 51 deletions .github/workflows/build.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ test-release: ## - Check that all release binaries are created

.PHONY: test-unit
test-unit: prepare-test-context ## - Run unit tests only
set -o pipefail; go test ${GO_TEST_FLAG} -v -race ./... | tee build/test-unit.out
set -o pipefail; go test ${GO_TEST_FLAG} -v -race -coverprofile=build/coverage.out ./... | tee build/test-unit.out

.PHONY: benchmark
benchmark: prepare-test-context install-benchstat ## - Run benchmark tests only
Expand Down
7 changes: 3 additions & 4 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
sonar.organization=elastic-1
sonar.projectKey=elastic_fleet-server
sonar.host.url=https://sonarcloud.io
sonar.projectKey=elastic_fleet-server_AYpL8BsVaV3I-igkX4hx
sonar.host.url=https://sonar.elastic.dev

sonar.sources=.
sonar.exclusions=**/*_test.go, .git/**, dev-tools/**, /magefile.go, changelog/**, testing/**, **/*.gen.go
sonar.tests=.
sonar.test.inclusions=**/*_test.go

sonar.go.tests.reportPaths=build/test-unit.out.xml
sonar.go.coverage.reportPaths=**/build/TEST-*.cov
sonar.go.coverage.reportPaths=**/build/coverage.out
sonar.go.exclusions=**/vendor/**,**/*_mock.go

sonar.sourceEncoding=UTF-8
Expand Down
Loading