I’m using sonar 7.9 commuity edition in Docker and have checked out a sample project: GitHub - LableOrg/java-maven-junit-helloworld: A „Hello World!” sample written in Java that showcases very simple unit and integration tests..
I cloned the project and did the following for my master branch:
mvn clean install mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.login=admin -Dsonar.password=admin
Now I see the coverage (94.6%) and testing in sonarqube. This is fine.
Now I created a branch from the master. I disabled some tests and run analysis for a short living branch.
git checkout -b feature/test # disable some tests mvn clean install mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.login=admin -Dsonar.password=admin -Dsonar.branch.name=feature/test # also tried: mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.login=admin -Dsonar.password=admin -Dsonar.branch.name=feature/test -Dsonar.branch.target=master
Now I see the short living branch in the console. I see the coverage estimated after merge (which is lower than the original, as expected), but I do not see the coverage of the short living brach itself?:
What am I doing wrong?
Thanks!