[sonar-dev] org.sonar.plugins.csharp.core.CSharpUnitTestResultsProvider not importing test duration

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[sonar-dev] org.sonar.plugins.csharp.core.CSharpUnitTestResultsProvider not importing test duration

petr.toman

Hello,

 

It seems that the cs/vs plugins don’t import test duration data from the testresult.trx files created by MSTest.

This is what I see in the project metrics in SonarQube:

Unit tests

  

1,817

Unit tests success (%)

  

100.0%

Unit tests duration

 

 

The log from the Sonar Runner:

[07:37:03] :  [Step 4/4] SonarQube Runner 2.4

[07:37:03] :  [Step 4/4] Java 1.7.0_75 Oracle Corporation (64-bit)

[07:37:03] :  [Step 4/4] Windows Server 2008 R2 6.1 amd64

[07:37:03] :  [Step 4/4] SONAR_RUNNER_OPTS=-Xmx512m -XX:MaxPermSize=256m

[07:37:03] :  [Step 4/4] INFO: SonarQube Server 5.0.1

[07:37:32] :  [Step 4/4] 07:37:32.984 INFO  - Sensor [hidden email] done: 3223 ms

[07:37:32] :  [Step 4/4] 07:37:32.984 INFO  - Sensor [hidden email]...

[07:37:32] :  [Step 4/4] 07:37:32.984 INFO  - Sensor [hidden email] done: 0 ms

 

We have sonar-csharp-plugin-3.3.jar and sonar-visual-studio-plugin-1.2.jar installed.

 

Is this intentional (i.e. something not yet supported) or is it a bug?

 

The summary data are available in the .trx file in:

·         /TestRun/ResultSummary/@total

·         /TestRun/ResultSummary/@passed

and for individual tests:

·         /TestRun/Results/UnitTestResult/@duration

·         /TestRun/Results/UnitTestResult/@outcome

So, it looks like only the summary data is imported?

 

Best regards

Petr

_______________________________________________

This message is for information purposes only, it is not a recommendation, advice, offer or solicitation to buy or sell a product or service nor an official confirmation of any transaction. It is directed at persons who are professionals and is not intended for retail customer use. Intended for recipient only. This message is subject to the terms at: www.barclays.com/emaildisclaimer.

For important disclosures, please see: www.barclays.com/salesandtradingdisclaimer regarding market commentary from Barclays Sales and/or Trading, who are active market participants; and in respect of Barclays Research, including disclosures relating to specific issuers, please see http://publicresearch.barclays.com.

_______________________________________________

Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] org.sonar.plugins.csharp.core.CSharpUnitTestResultsProvider not importing test duration

Dinesh Bolkensteyn-2
Hello,

This is not yet supported - feel free to provide a pull request if this is something you'd like to contribute.

I've created the following ticket for it: http://jira.codehaus.org/browse/SONARNTEST-21


Kind regards,


On Fri, Apr 24, 2015 at 1:48 PM, <[hidden email]> wrote:

Hello,

 

It seems that the cs/vs plugins don’t import test duration data from the testresult.trx files created by MSTest.

This is what I see in the project metrics in SonarQube:

Unit tests

  

1,817

Unit tests success (%)

  

100.0%

Unit tests duration

 

 

The log from the Sonar Runner:

[07:37:03] :  [Step 4/4] SonarQube Runner 2.4

[07:37:03] :  [Step 4/4] Java 1.7.0_75 Oracle Corporation (64-bit)

[07:37:03] :  [Step 4/4] Windows Server 2008 R2 6.1 amd64

[07:37:03] :  [Step 4/4] SONAR_RUNNER_OPTS=-Xmx512m -XX:MaxPermSize=256m

[07:37:03] :  [Step 4/4] INFO: SonarQube Server 5.0.1

[07:37:32] :  [Step 4/4] 07:37:32.984 INFO  - Sensor [hidden email] done: 3223 ms

[07:37:32] :  [Step 4/4] 07:37:32.984 INFO  - Sensor [hidden email]...

[07:37:32] :  [Step 4/4] 07:37:32.984 INFO  - Sensor [hidden email] done: 0 ms

 

We have sonar-csharp-plugin-3.3.jar and sonar-visual-studio-plugin-1.2.jar installed.

 

Is this intentional (i.e. something not yet supported) or is it a bug?

 

The summary data are available in the .trx file in:

·         /TestRun/ResultSummary/@total

·         /TestRun/ResultSummary/@passed

and for individual tests:

·         /TestRun/Results/UnitTestResult/@duration

·         /TestRun/Results/UnitTestResult/@outcome

So, it looks like only the summary data is imported?

 

Best regards

Petr

_______________________________________________

This message is for information purposes only, it is not a recommendation, advice, offer or solicitation to buy or sell a product or service nor an official confirmation of any transaction. It is directed at persons who are professionals and is not intended for retail customer use. Intended for recipient only. This message is subject to the terms at: www.barclays.com/emaildisclaimer.

For important disclosures, please see: www.barclays.com/salesandtradingdisclaimer regarding market commentary from Barclays Sales and/or Trading, who are active market participants; and in respect of Barclays Research, including disclosures relating to specific issuers, please see http://publicresearch.barclays.com.

_______________________________________________