Daniel Alder
Daniel Alder

Reputation: 5382

SonarQube: see details of failed tests

In SonarQube 5.6.6, I can see on http://example.com/component_measures/metric/test_failures/list?id=myproject that my unit test results were successfully imported. This is indicated by

Unit Test Failures: 1

which I produced by a fake failing test.

I also see the filename of the failing test class in a long list, and I see the number of failed tests (again: 1).

But I can't find any more information: which method, stack trace, stdout/err, just everything which is also included in the build/reports/test/index.html files generated by gradle? Clicking to the list entry points me to the code and coverage view, but I can't find any indicator, which test failed.

Am I doing something wrong in the frontend, is it a configuration problem, or am I looking for a feature which doesn't exist in SonarQube?

This is how it looks currently:

http://example.com/component_measures/domain/Coverage: Here I see that one test failed:

Sonar Measures-Coverage

http://example.com/component_measures/metric/test_success_density/list: I can see which file it is:

Sonar Unit Test Errors

But clicking on the line above only points me to the source file. Below the test which "failed". There is no indication that this test failed. And I can't find any way to see stack trace or the name of the failed test method:

Sonar Code View

Btw: The page of the first screenshot show Information about unit tests. But if the failing test is an integration test, I don't even see these numbers

Update

Something like this is probably what I'm looking for: enter image description here (found on https://deors.wordpress.com/2014/07/04/individual-test-coverage-sonarqube-jacoco/)

I never saw such a view on my installation, don't know how to get it and if it is implemented in the current version.

Upvotes: 5

Views: 8562

Answers (1)

Vaibhav Jain
Vaibhav Jain

Reputation: 2417

Unfortunately Test execution details is a deprecated feature Sonar Qube 5.6

If you install older version such as Sonar Qube 4.x, we will get following screen which provides test case result details.

enter image description here

But this screen itself has been removed. Ref # https://jira.sonarsource.com/browse/SONARCS-657

Basically the issue is Unit test case details report requires links back to source code files. But now the unit test cases are only linked to assemblies.

Upvotes: 1

Related Questions