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

add local sonar analysis #32

Conversation

renanfranca
Copy link
Contributor

@renanfranca renanfranca commented Jun 17, 2024

See #24

@renanfranca renanfranca self-assigned this Jun 17, 2024
@renanfranca renanfranca changed the title feat(ci): add local sonar analysis add local sonar analysis Jun 17, 2024
@renanfranca
Copy link
Contributor Author

The CI failure happened because this project had fewer tests than JHipster Lite. Therefore, Sonar isn't ready when the tests finish and try to connect to it.

CI Failure Image

I could simulate this failure on my machine by executing the following script:

docker stop sonar
docker rm sonar
docker rmi sonarqube:10.5.1-community
docker compose -f src/main/docker/sonar.yml up -d
./mvnw clean verify -Dsonar.qualitygate.wait=true sonar:sonar

Simulation Image

I am looking for an elegant solution instead of creating a script to retry or sleep to check if Sonar is up before running the tests.

@renanfranca renanfranca marked this pull request as ready for review June 17, 2024 17:00
@renanfranca
Copy link
Contributor Author

I gave up and added a sleeper 😅😎

@pascalgrimaud pascalgrimaud merged commit 7fdb5a7 into jhipster:main Jun 17, 2024
2 checks passed
@pascalgrimaud
Copy link
Member

Adding a sleep is a simple solution, no need to go further, as it's enough for our use

@renanfranca
Copy link
Contributor Author

Adding a sleep is a simple solution, no need to go further, as it's enough for our use

Thanks for the feedback 😀

@renanfranca renanfranca deleted the 24-add-sonar-analysis-in-github-actions branch June 17, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants