Use dotCover report on same build

Hi,

I'm trying to add dotCover coverage to NDepend report on TeamCity.

I know how to do it with two builds:
- One builds my code and generate the coverage report using dotCover. It creates artifacts for DLLs, PDBs and dotCover report.
- The other one has artifact dependencies getting DLLs, PDBs and dotCover snapshot from first one and parses dotCover report to NDepend expected format and run the NDepend static code analysis.
You can see this configuration deeply here.

The problem arrive when I want to do it all in the same build:
Is there any way to get the dotCover report on the same build (obiously on a next step) before generating the artifact?
As far as I know, TeamCity stores dotCover files on %system.teamcity.build.tempDir%/coverage4288420968195245133zip\dotCover.snapshot.
I can take %system.teamcity.build.tempDir% parameter but not next path folder because it seems to be a random name.
So, if I could know full path, I could add a build step between dotCover step and NDepend steps copiyng the file I need to my workingFolder %system.teamcity.build.checkoutDir%.

Any idea to solve this?
Is it possible to do it?

Thanks in advance.

4 comments
Comment actions Permalink

Hi,

The recommended solution is to use different build configurations with dependencies. Why it does not fit in your case?
We have a related feature request to new parameter - path to temp file and also a feature request to support NDepend, please watch/vote for them.

As current workaround you can add a Command Line build step after your Coverage have completed with script, which will copy needed files from %system.teamcity.build.tempDir% to %system.teamcity.build.checkoutDir%.

0
Comment actions Permalink

Hi Alina and first of all thanks for your fast response.

I've just vote for feature request to include a parameter to the temp folder.

Support NDepend feature request is great. More over, a comment of Laurent Kempé links us to the same post I link above.

The current workaround you propose me is the same I explain on my original post. Maybe I didn't explain my self clearly enough, so I exlain again the problem of this workaround:
%system.teamcity.build.tempDir% leave me one folder before the full path to the dotCover.snapshot file, the one that I want to use.
I wouldn't like do an script step scannning all %system.teamcity.build.tempDir% subfolders looking for the last edited dotCover.snapshot file.
Is there any better or more elegant way to get the desired file?

0
Comment actions Permalink

Hi,

Unfortunately we cannot provide better workaround now.

0

Please sign in to leave a comment.