Skip to content

Instrumenting code on every iteration (CI)

msporna edited this page Jan 7, 2019 · 3 revisions

If you wish to get coverage report for each build, on each new merge along with running your tests, then you need to remember couple of things:

  1. newly cloned code must be instrumented again
  2. test coverage session created after that must have a totally new build number assigned.

explanation:

If you instrument a new code, then source file lines will have new guid numbers that are different from what's already stored in DB. If you create a test coverage session with existing build number, you'll get a false build coverage report containing more than 1 set of stats for each file:

That's because coverage session that already exist for build has stats for some file and new session with the same build also, but with different line GUIDs. Normally when generating build report, duplicated line guids are ignored and coverage for file across all builds is shown. In this case, false coverage for file is shown because there aren't any duplicates but new line guids coming from new instrumentation.

To avoid that (build coverage >100%):

simply remember 2 steps from above.