How to generate report for Code Coverage in Hybris - jacoco

How can the unit test results of a hybris project be captured to jacoco.exec.
i am using h1808 version. Please share step by step procedure.

I hope, you should be able to set it up with the help of https://wiki.hybris.com/display/forum/running+Sonar+and+JaCoCo+on+hybris

Related

Code coverage results do not match in local visual studio and TFS build server

recently i created unit test methods for my project solution. when i do code analysis to find out code coverage, it shows 82% code coverage.
But when i checked in my code on TFS, on build server code analysis report shows code coverage as 58%.
Please can someone let me know if they encountered this issue or any possible solution?
In the TFS build definition, did you specify a .runsetting file or Test Filter criteria for code coverage analysis or just choose the "CodeCoverageEnabled" setting?
If you set the filter or .runsettings, that should be the reason why the code coverage results are different. Please see below articles for details.
Configure unit tests by using a .runsettings file
Customizing Code Coverage Analysis
So, If you want to do a comparison, you should be under the same conditions. The filter will exclude those test methods which do not meet the criteria. So not all tests are run, and the code coverage result is not same with developers.
You could delete the filter criteria and test again.
More other reasons to cause the difference please see :Troubleshooting Code Coverage

Visual Studio Team Services isn't Displaying Published Unit Tests

We have been using Visual Studio Team Services for about 2 years now with great success. It seems that in recent months something happened to the display of unit test metrics/results. I used to see drill down information for the tests that were published but now that has disappeared. In addition I now see this strange JSON text where unit test information used to be. I've searched high and low for an answer to this and came up empty. Any help would be appreciated.
I can get the same behavior as you when publish the test result via MSTest or VSTest.Console. I have help you submit a feedback on MS Connect Page, you can track it here: Published test result does not show in Build Summary Report.
And for now, you can use the "Publish Test Result" task in vNext build to publish the test result, it can get the test result displayed in build summary.
After switching away from XAML builds to the new build system this problem was resolved. Now a simple Unit test step was added with the appropriate properties setup and it worked like a champ.

Looking for a way where with each commit it can be identify which Unit test case is broken

I am looking for a solution where with my every CI build on jenkins i can find with which commit how many and which Unit test cases are broken.
So far i have tried Build Failure Analyzer
But this is not sufficient to get the accurate result.
I am trying the Jacoco-Comparison-Tool. For this there is no Jenkins integration. I am still trying to get a way for this.
Is there any other tools or anything else that can help me to get the UT error/failure reports?
If your project has tests (Unit tests or non-Unit tests), then using JMeter Plugin in Jenkins you can see per build, what all tests passed/failed. https://wiki.jenkins-ci.org/download/attachments/36601991/jmeterV3.jpg?version=1&modificationDate=1260240983000
In Jenkins there's a Test Results Analyzer plugin which also provides some sort of comparison side by side (at class/package level) for N no. of builds with nice charts but it's basically top level info (i.e. it just shows whether this/that test passed/failed in Green/Red color).
There are other plugins (XUnit plugin) that you can try. Also, if you are using SonarQube (analyzing and publishing your tests/results) one can see what happened between two builds (whether the builds failed/passed and to what %).

Running multiple unit test projects in Jenkins only records second set of results

I have searched for a while and can't find an answer on here for the first time ever.
I have a solution which contains multiple C# projects. Two of these projects are unit test projects. I am building this solution with Jenkins, attempting to run all the unit tests, then packaging it for an internal NuGet server.
The issue I am having is that I am running the tests for one unit test project after the other, I think this is causing the second set of tests to save their results over the first set because I can see in the console output that both sets of tests ran and passed, however the Test Results in Jenkins only shows the second set of tests.
I am running these with a windows batch command using nunit-console like this:
nunit-console.exe MyFirstProject.UnitTests/bin/Debug/MyFirstProject.UnitTests.dll
nunit-console.exe MySecondProject.UnitTests/bin/Debug/MySecondProject.UnitTests.dll
Is there a better way I can run these so that all test results are recorded?
Thanks!
Figured it out. For anyone who runs into this it's quite simple, you just have to put both (or however many) assemblies in the same command like this:
nunit-console.exe MyFirstProject.UnitTests/bin/Debug/MyFirstProject.UnitTests.dll MySecondProject.UnitTests/bin/Debug/MySecondProject.UnitTests.dll
Now all my test results show up!
As an addition to anyone else who has this type of issue:
To get one report from two groups of tests run from the same assembly, define two Windows Batch Command build steps, each with its own category and result file :
"%nunit%\nunit-console.exe" "%WORKSPACE%\MyTests.sln" /include:TestCategory1 /xml=nunit-result1.xml
and
"%nunit%\nunit-console.exe" "%WORKSPACE%\MyTests.sln" /include:TestCategory2 /xml=nunit-result2.xml
Add a Post Build action to Publish the NUnit Test result report and define the XML filename as *.xml.
The Nunit plugin will concatenate the different test results into one result that can be viewed and emailed.
This way will also solve the OP's question.

Lua Api unit test

Is there are any existing unit tests for lua Api? I've been searching for like an hour and all I found is this link - http://www.inf.puc-rio.br/~roberto/lua/lua5.1-tests.tar.gz
does somebody know some tests except this?
Unit testing is about testing your code during development, not in production. Typically you start by preparing the testing environment, writing some code that calls production code and check expected results with actual results.
http://lua-users.org/wiki/UnitTesting
Hope this helps :)
See lua-TestMore.
No, those are the only ones that exist.