Skip to content

Commit

Permalink
Adding booleans
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayakmsft committed Dec 4, 2023
1 parent 83dbe10 commit cb485ff
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/CoveragePublisher/CoverageProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.Pipelines.CoveragePublisher.Model;
Expand Down Expand Up @@ -46,8 +47,13 @@ public async Task ParseAndPublishCoverage(PublisherConfiguration config, Cancell
TraceLogger.Debug("Publishing file json coverage is supported.");

var fileCoverage = parser.GetFileCoverageInfos();

if(config.CoverageFiles.Count>=0)

bool hasCoverageFiles = config.CoverageFiles.Any(file => Path.GetExtension(file) == ".coverage");
bool hasCovXFiles = config.CoverageFiles.Any(file => Path.GetExtension(file) == ".covx");
bool hasCovBFiles = config.CoverageFiles.Any(file => Path.GetExtension(file) == ".covb");


if (hasCoverageFiles || hasCovBFiles || hasCovXFiles)
{
fileCoverage = parser.GetFileCoverageInfos(token);
}
Expand Down

0 comments on commit cb485ff

Please sign in to comment.