is it possible to run coverage on a process that is started by integration tests?

I'm trying to get code coverage of integration tests ran by nunit,

the tests run my server as an executable with Process.Start
and i want to be able to get coverage report in TeamCity.

It's seems that dotCover is not able to attach to the process started by the tests and get 0% coverage.
Is there a way to do something similar?

Thanks.

5 comments

Hello Doron,

Sorry for the delay!
By default dotCover gets coverage info from the main process being profiled and from all its child processes. So I guess that your scenario must work well. Please make sure that there are correct pdb-files in the directory from which you start your child process.

Best regards.

0

Hey Ekaterina,

It actualy doesn't work for me,

I read somewhere in the communiy that if you kill the process, Snapshots are not created.

I my integration tests I start the process and also kill it later on, how can i get it to work and create snapshots?

Thanks.

0

Hello Doron,

I'm extremely sorry for the delay!
Unfortunately now there is no way to get a snapshot from a process that was killed. This issue is on our roadmap, but not for the nearest release.
Sorry for the inconvinience!

Best regards.

0

Is there possibly a dotCover API that can be used to signal to the analyzer that the child process will be shut down shortly?

0

Hello Matthew,

Unfortunately now dotCover doesn't have an API that could be used to perform this task.

0

Please sign in to leave a comment.