Skip to content

I can not exclude all but some specific classes after generate report #553

Description

@justinduynguyen

I use this Fcc with coverlet
coverlet.runsettings

<RunSettings>
  <RunConfiguration>
    <!-- Use all cores for parallel test execution -->
    <MaxCpuCount>0</MaxCpuCount>
  </RunConfiguration>
  <DataCollectionRunSettings>
    <DataCollectors>
      <DataCollector friendlyName="XPlat Code Coverage">
        <Configuration>
          <!-- Keep Cobertura since the script expects coverage.cobertura.xml -->
          <Format>cobertura</Format>
          <!-- Instrument only the target class by name to reduce overhead -->
          <!-- Coverlet filter syntax: [assembly-filter]type-filter; use wildcards -->
          <!-- Using [Client]*DSLL10101* matches any type containing 'DSLL10101' in Client assembly -->
          <Include>
            [Client]namespaceA.classnameA*,
            [Client]namespaceB.classnameB*
          </Include>
          <!-- Do not instrument test assemblies for performance -->
          <IncludeTestAssembly>false</IncludeTestAssembly>
          <!-- Speed optimization: count a line as covered on first hit -->
          <SingleHit>true</SingleHit>
        </Configuration>
      </DataCollector>
    </DataCollectors>
  </DataCollectionRunSettings>
</RunSettings>

finecodecoverage-settings.xml

<FineCodeCoverage>
  <Enabled>True</Enabled>
  <RunMsCodeCoverage>No</RunMsCodeCoverage>
  <FCCSolutionOutputDirectoryName>Client.Test\fcc-output</FCCSolutionOutputDirectoryName>
  <RunSettingsOnly>True</RunSettingsOnly>
  <Include>
            [Client]namespaceA.classnameA*
            [Client]namespaceB.classnameB*
  </Include>
  <IncludeTestAssembly>False</IncludeTestAssembly>
  <IncludeReferencedProjects>False</IncludeReferencedProjects>
  <Hide0Coverage>True</Hide0Coverage>
  <Hide0Coverable>True</Hide0Coverable>
</FineCodeCoverage>

after run test explorer the it showed all classes in Client assembly.
I only need to generate coverage report for 2 specific classes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions