mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 23:28:15 +08:00
build works on windows
This commit is contained in:
14
build.cake
14
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);
|
||||
|
||||
|
Reference in New Issue
Block a user