Allow to set root directory for ExcludeAssembliesWithoutSources heuristic or other way to exclude internal nuget dependencies on shared CI nodes. #1668
Currently we are running coverlet in self hosted CI runners and these runners cache other builds as well. This causes coverlet to go up the directory tree to find a bunch of old builds that match some of the assemblies. I'd like to be able to pass the current root so any file outside of that will just be ignored.
I'd like to inject the $(Build.SourcesDirectory) as a root so everything outside that is recognized as a "Third-Party" assembly. Alternatively, it'd be sweet if this worked by reading the csproj files and excluding all <packagereference> items.
Or maybe parse a .deps.json file and exclude everything that has .libraries[].type=='package'.
The main issue is that we have some very large projects that are dependencies and are tested separately and the report generation for the thousands of types takes forever.
EDIT: I potentially overlooked IncludeDirectories/IncludeDirectory, oops, I'll try running a quick test suite.
UPDATE: -p:IncludeDirectory="$(Build.SourcesDirectory)" does not seem to work to filter out anything outside of this directory.
Currently we are running coverlet in self hosted CI runners and these runners cache other builds as well. This causes coverlet to go up the directory tree to find a bunch of old builds that match some of the assemblies. I'd like to be able to pass the current root so any file outside of that will just be ignored.
We currently run the tests like so:
with runsettings liek this:
I'd like to inject the
$(Build.SourcesDirectory)
as a root so everything outside that is recognized as a "Third-Party" assembly. Alternatively, it'd be sweet if this worked by reading the csproj files and excluding all<packagereference>
items.Or maybe parse a
.deps.json
file and exclude everything that has.libraries[].type=='package'
.The main issue is that we have some very large projects that are dependencies and are tested separately and the report generation for the thousands of types takes forever.
EDIT: I potentially overlooked IncludeDirectories/IncludeDirectory, oops, I'll try running a quick test suite.
UPDATE:
-p:IncludeDirectory="$(Build.SourcesDirectory)"
does not seem to work to filter out anything outside of this directory.