Extracting information of a specific run

Extracting information of a specific run

Given that we have a trending feature in NCE, I was wondering if we can extract the details of a specific NCover run?


RE: Extracting information of a specific run

How would you like that run extracted? Are you looking for the specs of the file so you can determine how to parse it so that you can obtain a run back?

What type of data are you looking for in a run?

Thanks

Joe Feser


RE: Extracting information of a specific run

The specs of the file is a good place to get hands dirty. Please let me know more info on that. The trend file looks to be a database of some kind.

However, I was looking forward to having a complete lowdown on the numbers that were already collected for a specific run, so that I can set NCE to that particular state and view it.


RE: Extracting information of a specific run

NCover Explorer doesn't expose a way to navigate to the coverage state for a particular run within a trend file, but if you have coverage files from a previous run you will still be able to open them and see coverage.

Could you describe though in more detail what you're trying to do/why you're trying to do it, because I'm not sure if I understand it entirely, and there might be an alternative way to do it.


RE: Extracting information of a specific run

I run NCE about 10 times a day for a particular assembly to target writing tests. Each time I would probably hit more lines of code.

Of course, If also means that everytime I run I overwrite my coverage files and these files can't be saved because of the huge data it generates.

Now, for example, it is possible that I refactor the product code being profiled between 5th and the 9th runs and I see at the 10th run, that the coverage has actually dipped because of various reasons like buggy code, removal of dead code, etc.,

So I will now reset the product code to what was at the 5th run. So, if the 5th run had a coverage of, say, 75%, which is currently 25%, Can I reset the state of NCover to the 5th run.

This could save me valuable time of running the coverage for the same piece of code again. [i.e, If I'm going to run it the 11th time, the coverage I expect would be the same as that of 5th, so why not just reset to the 5th directly?]

Every few minutes people in my team save because of this will go a long way to improve the productivity of my project.


RE: Extracting information of a specific run

If you were to reset the code, you would roll back source control, you would recheck in the file. In source control the 5th and 10th version of the file would be the same instance.

Once you set the file back, you would rerun coverage and it would represent what has happened in source control.

If this is all on your local machine and it was never checked in, then you would not need to worry about the dip since it never affected the overall build.

Does this make sense?

I can give you the steps needed to create a new trend file, which would remove step 6-9 if you still need it.

Joe Feser


RE: Extracting information of a specific run

Resetting the trend is only one part of which, I will be glad to accept the steps to change it.

The other part is getting back my original coverage xml file of the 5th run which now stands overwritten. I would still like to use these for merges.


RE: Extracting information of a specific run

The only way you be able to do that is to save the coverage file.

The trend file is a rolled up calculated datastore of your coverage file. It does not contain the data needed to highlight. It stores the rolled up information.

Joe Feser


RE: Extracting information of a specific run

Thanks anyway! We've been doing that (found that out the hard way)

I would still have loved if the trend file could have the complete history (and not a rolled up history) of the runs.

It's probably not a big deal to save the files, anyway! But, I love tools that always improve up on and introduce smarter ways of working!

Can I at least get a way into reading the trend files? If yes, I can script my way around this problem!


RE: Extracting information of a specific run

The trend format isn't supported externally, but if you're willing to (potentially) re-write your script after every NCover release, the format is documented here:

http://docs.ncover.com/kb/ncover-trend-and-report-file-definition/


RE: Extracting information of a specific run

The format described in the above link is that of reporting, in-depth. This talks of only the XML Coverage part and not in-depth into the trending.

What I was looking forward is a way to get my hands into the trend file, which by the way, is some kind of a SqlLite binary file.

Is there a way that this binary information is made available in the XML coverage file?


RE: Extracting information of a specific run

ah. my apologies. I momentarily forgot we'd converted to the binary format in 3.2. hmm. I'll send you a support case.