How to access dotcover stapshot file during configuration is running
Hello,
I'm trying to setup configuration with steps below:
Build Step 1. Build solution
Build Step 2. Run MSBuild with <NUnitTeamCity> targets; .Net coverage toos = "JetBrains dotCover"
Build Step 3. build html report basing on dot cover snapshot
Build Step 4. Submit coverage html report to sonar qube
Now I see that snaphot becomes available in artifacts when all build steps are complete (so I can't use it in build steps).
Also I see file dotCover9018573931974877943Zip that seems to be a one that I need. But as far as filename is random, I can't use it without hacks (like creating custom script to rename it according to some mask). Also, this way seems to be incorrect and could stop work at any time.
The question is: Is there any documented ways to access dotcover snapshot on Build Step #3?
Please sign in to leave a comment.
You can't access to publishing artifacts within configuration
>Build Step 3. build html report basing on dot cover snapshot
This step will be done by TeamCity itself. Report will be available in TC UI after build finish,
>Build Step 4. Submit coverage html report to sonar qube
As a workaround this step could be extracted to a separate configuration. Build chain with two mentioned configuration could be introduced after that.
Newly created configuration should has snaphot and artifact dependency on initial one in order to make it all work.
Or you can call dotCover.exe from a build script and publish result to sonar from the same script. in this case you can specify path for merged dotCover snapshot explicitly.
Feel free to ask any additional questions if exist.
Evgeniy, thanks for the details.
>This step will be done by TeamCity itself. Report will be available in TC UI after build finish,
This was done with dotCover tool with params /Output:"dotCover.html" /ReportType:HTML. We don't need to have it in TC UI, need to get a separate HTML file in order to pass it to SonarQube
> This step should be extracted to a separate configuration. Build chain with two mentioned configuration could be introduced after that.
Newly created configuration should has snaphot and artifact dependency on initial one in order to make it all work.
Actually we already created a chain as you mentioned above and could use snapshot data from artifacts
The question is: is it possible to have an access to snapshot data without creating a chain of configurations? We want to have a single configuration that performs all steps.
It is possible via writing custom script and passing a path to snapshot from one task to another within that script.
Looks interesting. Could you please provide a sample of script how to create it and how it could be used?
I didn't face with an approach of using custom scripts while investigating this issues.
Also as far as we noticed this snapshot has a random name. How should we have an access if it's impossible to 'hardcode' in our scripts. Is there a rule how to get its name?
Moreover, we concerned about running (if we create it somehow) the script on future releases. Will it be supported on them?
I mean you can implement whole multi-steps build procedure as a script (PowerShell, MSBuild, NAnt, etc.) and ask TeamCity to execute it,
In your script you will be able to use any name for snapshot / html report file / etc.
If I understand correct, you propose to run dotCover.exe with test-runner (in our case is nUnit) by commandline like
dotCover.exe cover /TargetArguments:"nunit.exe test.dll" /Output:snapshotfile.dat
Did I understand correct?
The main problem in this case is that we refuse using build-in nunit runner, that makes visible temporary test-run results in run-time (while configuration run is not finished). That causes an usability gap for configuration users.