diff --git a/build.cake b/build.cake index 50dfd5c4..6dda8a40 100644 --- a/build.cake +++ b/build.cake @@ -18,7 +18,7 @@ var artifactsDir = Directory("artifacts"); // unit testing var artifactsForUnitTestsDir = artifactsDir + Directory("UnitTests"); var unitTestAssemblies = @"./test/Ocelot.UnitTests/Ocelot.UnitTests.csproj"; -var minCodeCoverage = 80d; +var minCodeCoverage = 0.80d; var coverallsRepoToken = "OCELOT_COVERALLS_TOKEN"; var coverallsRepo = "https://coveralls.io/github/ThreeMammals/Ocelot"; @@ -180,15 +180,15 @@ Task("RunUnitTests") { Configuration = compileConfig, ResultsDirectory = artifactsForUnitTestsDir, - ArgumentCustomization = args => args - // this create the code coverage report - .Append("--settings test/Ocelot.UnitTests/UnitTests.runsettings") + ArgumentCustomization = args => args + // this create the code coverage report + .Append("--collect:\"XPlat Code Coverage\"") }; EnsureDirectoryExists(artifactsForUnitTestsDir); DotNetCoreTest(unitTestAssemblies, testSettings); - var coverageSummaryFile = GetSubDirectories(artifactsForUnitTestsDir).First().CombineWithFilePath(File("coverage.opencover.xml")); + var coverageSummaryFile = GetSubDirectories(artifactsForUnitTestsDir).First().CombineWithFilePath(File("coverage.cobertura.xml")); Information(coverageSummaryFile); Information(artifactsForUnitTestsDir); @@ -215,8 +215,8 @@ Task("RunUnitTests") Information("We are not running on the build server so we won't publish the coverage report to coveralls.io"); } - var sequenceCoverage = XmlPeek(coverageSummaryFile, "//CoverageSession/Summary/@sequenceCoverage"); - var branchCoverage = XmlPeek(coverageSummaryFile, "//CoverageSession/Summary/@branchCoverage"); + var sequenceCoverage = XmlPeek(coverageSummaryFile, "//coverage/@line-rate"); + var branchCoverage = XmlPeek(coverageSummaryFile, "//coverage/@line-rate"); Information("Sequence Coverage: " + sequenceCoverage); diff --git a/test/Ocelot.UnitTests/Ocelot.UnitTests.csproj b/test/Ocelot.UnitTests/Ocelot.UnitTests.csproj index 35aa633d..a9ba3bfc 100644 --- a/test/Ocelot.UnitTests/Ocelot.UnitTests.csproj +++ b/test/Ocelot.UnitTests/Ocelot.UnitTests.csproj @@ -89,7 +89,7 @@ - + all runtime; build; native; contentfiles; analyzers