Skip to content

Exclude Views (AspNetCoreGeneratedDocument) folder from coverage coverlet #1375

@yacine-karim

Description

@yacine-karim

Discussed in #1374

Originally posted by dev0karim0yassine August 26, 2022
Hello everyone

I have this class AspNetCoreGeneratedDocument.Views_Users__AddOrUpdateUser appearring in the code coverage result

Assembly: Solution.Web
Class: AspNetCoreGeneratedDocument.Views_Users__AddOrUpdateUse

When i click on the class to check it, it takes me to the _AddOrUpdateUser View in the view folder

Path: D:\a\1\s\Solution.Web\Views\Users_AddOrUpdateUser.cshtml

I want to exclude this folder using the .runsettings file:

<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
	<DataCollectionRunSettings>
		<DataCollectors>
			<DataCollector friendlyName="XPlat code coverage">
				<Configuration>
					<!-- Globbing filter -->
					<ExcludeByFile>**/Solution.Web/Views/*.cshtml</ExcludeByFile>
					<IncludeTestAssembly>false</IncludeTestAssembly>
					<DeterministicReport>false</DeterministicReport>
				</Configuration>
			</DataCollector>
		</DataCollectors>
	</DataCollectionRunSettings>
</RunSettings>
```</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions