How to get Coveralls code coverage for a Swift project - swift

I have code coverage reporting set up on Travis-CI with the help of a ruby script it once wrote.
See for example: https://travis-ci.org/Cocoanetics/DTCoreText at the bottom of the log.
I have started a new open source project Kvitto and set it up on Travis-CI here: https://travis-ci.org/Cocoanetics/Kvitto
I need help how to get coverage to appear on Coveralls here: https://coveralls.io/github/Cocoanetics/Kvitto - right now there is no coverage info for anything.
I am building with a build configuration "Coverage" where I have set up both the legacy as well as the new style... do I need to adapt the ruby script (link) in a way to collect the .gcda files correctly?

Related

Azure devops cant open the code coverage file

Hi guys i have a problem with my code coverage of my azure pipeline. When the CI gets trigged for the master branch the agent has a job to test the .net core. When i use this test i have to configure the route and also enable the code coverage. After the CI has been done it ended succesfully and i can download a file with the code coverage. The problem i have is i cant open this file, not with visual studio or anything else. Aynone that knows how i can fix this problem and maby i didnt configure it right?
Picture of my settings:
picture of the file
picture of the error https://i.stack.imgur.com/fxqdI.png
Seems you are using the wrong configuration. I'm afraid --collect"Code coverage" will not work.
You could add a .NET core test task and add /p:CollectCoverage=true argument then use report generate task for adding code coverage reports.
More detail steps, please refer below tutorials:
ASP.NET Core code coverage reports on Azure DevOps
Azure DevOps, unit testing and code coverage with .Net Core
To generate code coverage please follow this steps
Restore nuget packages
Build the app
Run unit tests (You need to add nuegte package to test projects -> coverlet.collector to use 'XPlat Code Coverage')
Install report generator
Run report generator
Publish code coverage

Control code coverage attachments in Azure DevOps

In a multi-stage, yaml configured CI pipeline that builds in Windows and Linux via matrix strategy I'm generating:
A .cobertura.xml file in Linux os, used to produce an aggregated report via ReportsGenerator that is accesible from coverage tab in AzureDevops. I'm explicitly using PublishCodeCoverageResults in this os.
A .coverage file in Windows os, to feed SonarCloud with coverage data. I'm not using PublishCodeCoverageResults in this os.
My issue is that .coverage file overrides the expected report in coverage tab, allowing me to download it rather than seeing the report. How can I avoid that? Is there any way to get rid of that attachment to properly show the report?
If I don't run the Windows part, the report is shown as expected.
If I do it, I get this rather than the report.
I've tried removing .coverage files at the end of the pipeline, but the 'attachment' in coverage tab stays there.
As far I understood you want to have download avialble instead of displaying code coverage like this:
But your code coverage is also available as an artifact:
So you can still download it:
Does it help you somehow?
Answered here:
This is not a bug and the behavior is as designed as the .coverage
report is given precedence over other reports.
My guidance would be to stop publishing the test run as part of the
dotnet task in windows. There is an option to do so.
Copy the trx and coverage files out to separate locations. Upload the
trx file using the publish test results task but make sure the
coverage file is not available for this publish.

How to enable the code coverage view on VSTS?

My team uses VSTS with hosted agents and a Visual Studio Test build task to run all tests and produce code coverage. However the tab Code coverage remains empty afterwards, only showing a link to download the *.coverage file.
I actually expect the code coverage results to be shown, with tables and graphs which projects are tested and it's respective coverage.
We are using the Visual Studio Test build task to test net461 assemblies with the Code Coverage enabled checked.
Somewhat related are both this and this issue, but not entirely, because we are just using MSTest Framework with built-in Visual Studio Test build task, which (I understand) should also automatically publish the code coverage results.
Am I missing something to get this Code coverage view working? Thanks!!
In Code coverage Tab, you need to use Publish Code Coverage Results task to show tables and graphs there.
While for Publish Code Coverage Results task, it only supports Code Coverage data in Jacoco or Cobertura formats. So the result of the *.coverage file can not be shown by tables and graphs in Code coverage Tab.
More details, you can refer the blog Browse Code Coverage reports and the issue How to publish the code coverage result with a .coverage file.

gcovr - cobertura

With gcovr I am able to generate code coverge report(coverage.xml) for my IOS application.How will I use cobertura plugin to convert the coverage.xml to cobertura html report?
Any help appreciated!
I use the lcov tool suite to generate HTML reports like these. . . The build-script to do this is here.
Nice feature: After every build from the build server, the results are uploaded to the Github page.
I was thinking of making a tool to auto-install the script in Xcode. There's an app you can use to view coverage results, but I was after something that:
Can be run from cmd-line. This makes it compatible with CI build-servers as well as easy to verify results locally.
lcov can easily be installed via MacPorts or home-brew.

NQunit.NUnit getting started guide

does anybody know of a good tutorial for getting started with NQUnit.NUnit.
I've installed it to my test project via nuget and am unsure what the blank.js and async.js files are all about, should I rename these to match my files under test or do I just add my asyncronous and syncronous tests to the respective files.
ta!
Find the answer in the following link:
NQUnit: JavaScript testing within .NET / CI