Ncover integration with CC.Net - cruisecontrol.net

I'm using NCover 3.0 .Want to integrate the results into CC.Net .Everything works fine, but the report shown in CC.Net after is not that detailed. I would like to be able to display the uncovered classes, methods and probably the source too.
This is what I have done on the NAnt build script
<ncover
program="${NCoverDir}\NCover.Console.exe"
testRunnerExe="nunit-console.exe"
testRunnerArgs="..\..\Vault\AppServices\VaultApp.sln /config:Release /noshadow"
coverageFile="coverage.xml"
appendTrendTo="coverage.trend" />
<ncoverreporting
program="${NCoverDir}\NCover.Reporting.exe"
projectName="TEST"
sortBy="Name"
maxTopUncoveredToReport="20"
hide="HideFullyCovered"
coverageTrendPath="coverage.trend"
outputPath="Ncovercoverage.xml" >
<coverageDataPaths>
<include name="coverage.xml" />
</coverageDataPaths>
<reports>
<report format="Xml" reportType="SymbolModule" />
</reports>
</ncoverreporting>
I suspect the report format is limited to Symbol module. How can I get a full coverage report as we get in HTML .

Since CC.NET uses an XML report, not an HTML report, you'd have to generate the HTML like you do now in your build script and then provide a link to it from your webdashboard. The cc.net plugin from NCover only works for single-page report xmls. You can't drill into source code, and etc. Making an HTML report and linking to it from your dashboard is the way to go.

Related

Convert Cobertura.xml to html report

Is it possible to convert a cobertura.xml file to an html report or similar, so it can be viewed locally? I already have it pretty-printing in Jenkins but we need it locally too...
The report has been produced using istanbul/nyc, and the code it's producing coverage for is in node.js.
pycobertura (repository) answers your need of converting a Cobertura XML report into an human-friendly HTML page:
pycobertura show --format html --output coverage.html cobertura.xml
Then open coverage.html in your browser to check the report.

Exception when trying to use icons from Asset Catalog in iOS project with Xamarin TabbedPage

I create a Xamarin Forms project in VS 2017 and started by adding a TabbedPage with three tabs. I then added the icons to the Android (in Resources/drawable) and iOS (Asset Catalogs/Icons) projects.
When I start the project on Android it works fine, but on iOS I get an exception that the UIImage cannot be loaded because initWithCOntentsOfFile returned nil. Which is actually correct, because that's not the correct method to use to access Assets. But it's the TabbedPage calling the method, so I cannot do anything about it.
The TabbetPage looks pretty basic.
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:GreenThumb"
x:Class="GreenThumb.MainPage">
<NavigationPage Title="Today" Icon="current.png">
<x:Arguments>
<local:Current />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Overview" Icon="overview.png">
<x:Arguments>
<local:Overview />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Settings" Icon="settings.png">
<x:Arguments>
<local:Settings />
</x:Arguments>
</NavigationPage>
</TabbedPage>
And the Asset Catalog looks like this:
This problem seems to be pretty old, but I haven't found any solutions aside some very dirty hacks.
Is there a clean solution out there? Or do I just have to add all my images in the Resources folder instead of Asset Catalogs?
I struggled in the past on this issue. It seems that icons for tabbed pages are not working in iOS if placed in the .xcassets.
I moved those .png files inside the Resources folder and that made the magic.
I suppose it's a kind of bug on Xamarin.
The same error was occurring to me, and I was putting the images on the .xcassets on iOS.
When I placed the images on the Resources folder, they appeared normally on my TabbedPage.
In the official Xamarin documentation about images, they say to put the images in the Resources folder.
iOS - Place images in the Resources folder with Build Action:
BundleResource. Retina versions of the image should also be supplied -
two and three times the resolution with a #2x or #3x suffixes on the
filename before the file extension (eg. myimage#2x.png).
I place all my images in the .xcassets folder, they apparently work well, but it seems not to work on every case.

How to Customize Cucumber reports with Boostrap css?

I have tried to customize cucumber reports but I am not getting a clear picture of where to change the CSS according to our needs. Any help will be appreciated.
You can put the custom CSS anywhere (best to keep in /support along with your formatter.rb), and then build the HTML page using cucumber's HTML builder referencing your CSS or you could have a pre-built HTML template and use it with the builder. Have a look at https://github.com/raldred/cucumber_textmate/ to get a general idea.

Why does my Sharepoint WebPart deploy (nominally), but is still not available for adding to a page/form?

I've created and "deployed" my latest Web Part (Visual Studio grins from ear-to-ear, and tells me, "Deploy succeeded").
But when I go to our Sharepoint site, and my "sandbox" page, and Edit it, I do not see the WebPart. As the Elements file shows, it should be available from the "Financial Affairs Forms" category:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
<Module Name="PostTravelExpenseWebPart" List="113" Url="_catalogs/wp">
<File Path="PostTravelExpenseWebPart\PostTravelExpenseWebPart.webpart" Url="PostTravelExpenseWebPart.webpart" Type="GhostableInLibrary" >
<Property Name="Group" Value="Financial Affairs Forms" />
</File>
</Module>
</Elements>
However, that category is devoid of the "PostTravelExpenseWebPart" I expect (or at least hope) to see there:
What might I be omitting?
UPDATE
I even went so far as to, while in Edit mode on the Web Page, expand the "Upload a Web Part" section below "Categories" after selecting one of the "Add a Web Part" links. I didn't know exactly what to upload (when browsing for a file, the File Dialog doesn't clue you in on what file extension it expects), so I, on a flayer, tried uploading PostTravelExpense.ascx
It accepted it without balking, but I do not see it anywhere (nor do I know why just the *.ascx file would be enough, but again, which file does it expect?) It doesn't allow me to upload the entire project folder.
UPDATE 2
In response to the comment below, note that The project's Assembly Deployment Target" property is set to GlobalAssembyCache
By comparing a working project with this one, I was finally able to get it to deploy without the "A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe." add-time error msg.
What I had to do was check every place in the working project where the primary namespace was referenced, and make sure that the corresponding namespace in the previously-unworking project was referenced in those same places
This required not only changing some of the files visible in Visual Studio's Solution Explorer treeview, but also two that I only was able to load into the editor by searching for strings they contained, specifically:
The ***.spdata** file, which I loaded up by searching for "SafeControl"
**Assembly.Info**, which I loaded up by searching for "AssemblyTitle"
That sure was a lot of hand-wringing and head-banging and pitiful whin[g]ing for something that one would think would automatically be taken care of by the IDE - when a namespace changes, make all the necessary changes, or at least notify the coder and offer to do so! Or, barring that, at the very least give him a better clue than "A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe." when the WebPart to be plopped onto the page proves unploppable.

How to generate pdf from docbook 5.0

I've written a docbook 5.0 document with the header:
<?xml version="1.0" encoding="UTF-8"?>
<book version="5.0" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
and docbook2pdf on Ubuntu 9.10 prints many error messages and doesn't do any pdf document. The errors are:
openjade:test.xml:2:0:E: prolog can't be omitted unless CONCUR NO and LINK EXPLICIT NO and either IMPLYDEF ELEMENT YES or IMPLYDEF DOCTYPE YES
openjade:test.xml:2:0:E: no document type declaration; will parse without validation
openjade:/usr/share/sgml/docbook/stylesheet/dsssl/modular/print/dbtitle.dsl:18:5:E: flow objects at the root must be all of class scroll or all of class page-sequence or simple-page-sequence
openjade:/usr/share/sgml/docbook/stylesheet/dsssl/modular/print/dbbibl.dsl:704:4:E: flow objects at the root must be all of class scroll or all of class page-sequence or simple-page-sequence
docbook2pdf for document in the docbook 4.5 format with normal header like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
works quite OK.
Is there any way to generate pdf from docbook 5.0?
I see three options (available in Debian/Ubuntu) to generate pdf from docbook:
jade, which provides the docbook2pdf command the asker used. jade is ancient and works with SGML, which predates XML and does not support Unicode; it also lacks support for docbook 5.
the docbook-xsl stylesheets which go through XSL-FO. docbook-xsl is for docbook 4.5, docbook-xsl-ns is for docbook5. Use fop to go from XSL-FO to PDF. Pipeline: docbook5 —(xsl)—> xml.fo —(fop)—> pdf . Commands involved: xsltproc, fop.
dblatex, which is primarily targeting docbook4.5 but has been updated for some of docbook5.
xmlto can drive the last two, although it currently defaults to docbook-xsl and not docbook-xsl-ns.
A quick Docbook5 user guide
Prerequisites
sudo aptitude install docbook5 docbook-xsl-ns xsltproc fop xmlto libxml2-utils xmlstarlet
Validation
xmlstarlet val --err --xsd /usr/share/xml/docbook/schema/xsd/5.0/docbook.xsd book.xml
PDF output
xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/fo/docbook.xsl book.xml > book.fo
fop -fo book.fo -pdf book.pdf
Apart from the header you gave, did you try a smaller example, like this one from the DocBook 5.0: The Definitive Guide ?
<?xml version="1.0" encoding="UTF-8"?>
<book xmlns='http://docbook.org/ns/docbook'>
<title>An Example Book</title>
<titleabbrev>Example</titleabbrev>
<info>
<legalnotice><para>No notice is required.</para></legalnotice>
<author><personname>
<firstname>Norman</firstname><surname>Walsh</surname>
</personname></author>
</info>
<dedication>
<para>
This book is dedicated to you.
</para>
</dedication>
<preface>
<title>Foreword</title>
<para>
Some content is always required.
</para>
</preface>
<chapter>
<title>A Chapter</title>
<para>
Content is required in chapters too.
</para>
</chapter>
<appendix>
<title>Optional Appendix</title>
<para>
Appendixes are optional.
</para>
</appendix>
</book>
Just rendered it to a PDF through one of my Maven environments. Can you give a small example (or a few separated onces) containing some content, which makes the use of all the additional name spaces necessary.
In case the above example does not work, and you are interested in how I have setup my environment read Making DocBook content available in a Maven project site. Just replace the example with the above DocBook 5.0 example. Only the docbkx-maven-plugin is of interest, in relation to this question. (PS: Some basic knowledge of Java and Maven2 is required for this.)
Publican
You can use Publican to publish your DocBook XML in PDF, html, and html-single formats. Publican is used by Red Hat as part of its internal documentation toolchain, and is an open source application hosted by the Fedora project. The tool uses "brands" to achieve a modularity in applying styles to the content being published. This preset manner simusing a wide variety of CMS or documentation tools.
JBoss Documentation Guide
A good example of the tool in action is the JBoss Press Gang documentation, which is itself a great resource the gives documentation community guidance on the use of DocBook XML in JBoss documentation. The html and PDF versions were generated with Publican.
There are significant differences between Docbook 4.5 and 5.0. And those differences can prevent your document from being transformed.
If you want to check the validity of your 5.0 document, you can use the following command line tool:
it's a java tool, so you need to have a recent java runtime environment.
the tool is Jing. You can download it from thaiopensource web site:
http://www.thaiopensource.com/relaxng/jing.html
you will also need the relax ng file for docbook 5.0. It is provided with the docbook 5 distribution.
run the validation test with the following command line:
java -jar path_to_Jing/jing.jar -t -i path_to_docbook5/docbook.rng document.xml
If there are some failures, they should be returned this way: Error at URL "file:...../document.xml", line number 211, column number 59: bad value for attribute "id" from namespace "http://www.w3.org/XML/1998/namespace"
Elapsed time 968+166=1134 milliseconds
http://docbookpublishing.com supports DocBook 5.0 documents. It is an online service for DocBook to PDF formatting. You can also submit your DocBook documents via the REST API.
Go to Eclipse and install DocBook Editing and Processing for Eclipse (DEP4E) plugin. You can find it by going into marketplace and search for docbook there. This plugin will create an example docbook and can publish in html, pdf, and even ebook.
Or check out the DEP4E web site, read the Quick Starter Guide section 3. Getting Started, to get an idea of it's possibilities.
wordpress post to docbook style posts:
http://hashfold.com/techfold/wordpress-how-to-generate-docbook-style-posts/

Resources