TeamCity autogenerated index file
TeamCity autogenerated index file
So I've setup our project to use the NUnit with NCover build step in TeamCity 6.5.2. My parameters were the default which match your screenshots published on the help docs here, so it has: //or FullCoverageReport:Html:{teamcity.report.path}
The build overview has some summary coverage information, which is fine, but when I click on the "Code Coverage" tab, there is a message at the top followed by a list of files:
"This is an autogenerated index file (there was no index.html found in the generated report)."
Now if you look in the build artifacts, the index.html is in there, but TeamCity for some reason doesn't see it/want to use it.
This is all using out-of-the-box settings with TeamCity and NCover. Obviously I had hoped things might "just work".
Anyone know what is broken and more importantly how to fix it? Or do I go back to running unit tests and code coverage from an MSBuild file, and integrate those reports manually through the TeamCity plugin route?
RE: TeamCity autogenerated index file
Hi kiwidude,
This index.html message is from Team City, since the output folder must be set to {teamcity.report.path}, but you can create custom report tabs for your project and specify the NCover reports you want to display.
If you go to "Edit Project Settings," then click on "Report Tabs" and "Create new report tab," you'll be prompted to set up a report with the following fields:
Tab Title: Your Report
Get artifacts from: Your Project
Base path: coverage.zip
Start page: fullcoveragereport.html
The full coverage report rolls up everything, but you can use any of the reports listed on the Code Coverage tab.
Hope this helps!
NCover Support
RE: TeamCity autogenerated index file
Hi rhinson,
Thanks for the response.
So if I understand you correctly, the "Code Coverage" tab listing all those reports is the intended behaviour out of the box with TeamCity?
I have looked at the report tab, but that only gives you stuff when you click on the overall project, whereas I want to see stuff when you drill into the specific build. For instance, see this screenshot from the TeamCity wiki: http://confluence.jetbrains.net/download/attachments/37238107/ncoverresults.png
Is it possible to get that appearing in the "Code Coverage" tab by default?
RE: TeamCity autogenerated index file
Kiwi,
I understand what you mean re: Code Coverage tab. I'm trying to test some report scenarios, but having unrelated build agent issues on my TeamCity server.
In the meantime, have you tried this?
http://devnet.jetbrains.net/thread/287519
NCover Support
RE: TeamCity autogenerated index file
Hi rhinson,
I think I've got my head around the issues a bit better.
Out of the box, with TeamCity 6.5.3 at least which I use, TeamCity seems to be configured for it's code coverage tab to expect a file called "index.html" to be in the "coverage.zip" build artifact. You can edit this "expectation" in Administration-> ServerConfiguration-> Report Tabs. Or do as I did and edit the main-config.xml file directly. If you change "index.html" to "fullcoveragereport.html" to match the NCover root report name, then you get a "more useful" default report view.
If you just want to see one of that static module/namespace/class type reports (like in that wiki link above), then you need to change your //or arguments for running the report for your ncover reporting options. What you can do as I eventually worked out is do multiple lines of reports to get multiple artifacts generated from the one build step, and then configure multiple report tabs in the main-config.xml file pointing to the relevant "root" file.
I guess your other option (assuming you were after a single static report, not the full coverage complex one) would be to use a command line argument for ncover reporting to ensure your output report name is called index.html, and then the out of box configuration would work.
I posted my findings on the TeamCity forums to get any confirmation that my assumptions about this being the "right" way to do things is correct or not - no replies as yet but at least it seems to work. I'm still finding my way around TeamCity so it is quite possible there is an easier way to do this... http://devnet.jetbrains.net/thread/311366?tstart=0
It is just a little unfortunate that the default report example they show to configure on the TeamCity build step screen does not match up with anything appearing as you would hope on the code coverage tab. Not your fault, but hopefully someone googling comes across this to avoid the hours of banging my head I did. ;-)
RE: TeamCity autogenerated index file
Kiwi,
Kudos on getting this to work the way you wanted. I agree that the TC example creates expectations that are not out-of-the-box, but the info you've provided is bound to help others avoid your suffering.
I certainly plan to make good use of it in updating our TC integration docs.
Many thanks!
RH