Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-33492

Not picking up multiple code coverage files

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • mstest-plugin
    • None
    • MSTest plugin 0.19. Visual Studio 2015 Update 1, Emma pplugin 1.29

    Description

      I have 5 test projects in my solution. I'm building my test results and code coverage with the script below.

      $projectFolders = ls Sources\*.Test* | % { $_.Name }
      foreach ($projectName in $projectFolders)
      {
        vstest.console.exe "Sources\$projectName\bin\Dev\$projectName.dll" /Logger:trx /EnableCodeCoverage /Platform:x64
      }
      $trxFiles = ls TestResults -Recurse -Include *.trx
      foreach ($trxFile in $trxFiles)
      {
        $testdataFolder = $trxFile.FullName -replace '.trx$',''
        $coverageFile = ls $testdataFolder -Recurse -Include *.coverage
        if ($coverageFile.Count -gt 0)
        {
          $outFolder = join-path $testdataFolder Out
          mkdir $outFolder | out-null
          mv $trxFile.FullName $outFolder
          C:\Util\CoverageConverter\CoverageConverter.exe $coverageFile.FullName (join-path $outFolder vstest.coveragexml)
        }
      }
      

      This creates 5 folders in TestResults named like glompix_MACHINENAME 2016-03-11 17_38_57\Out\. You can see the glompix_MACHINENAME_etc.trx, vstest.coveragexml, and emma\coverage.xml files.

      However, only part of my solution shows up in code coverage. If I target a single project, it works like a charm. It seems the results aren't being merged correctly.

      Attachments

        Activity

          To me, 'Merging code coverage data' is a responsibility of the CodeCoverageConverter.

          nilleb Ivo Bellin Salarin added a comment - To me, 'Merging code coverage data' is a responsibility of the CodeCoverageConverter.

          The asked feature is out of the plugin scope.

          For license and copyright reasons, I cannot include the CoverageConverter as it is, so the mstest-plugin won't ever be able to merge multiple code coverage reports.

          Changing the CoverageConverter approach in order to let it load VisualStudio assemblies at runtime could be a game changer, but it's definitely not possible for me (since I haven't anymore a Windows system where to develop .net code). If you're that interested in the feature, I accept donations (A Windows development host and a Visual Studio License should cost about 6k€).

          nilleb Ivo Bellin Salarin added a comment - The asked feature is out of the plugin scope. For license and copyright reasons, I cannot include the CoverageConverter as it is, so the mstest-plugin won't ever be able to merge multiple code coverage reports. Changing the CoverageConverter approach in order to let it load VisualStudio assemblies at runtime could be a game changer, but it's definitely not possible for me (since I haven't anymore a Windows system where to develop .net code). If you're that interested in the feature, I accept donations (A Windows development host and a Visual Studio License should cost about 6k€).

          People

            nilleb Ivo Bellin Salarin
            glompix Stuart Branham
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: