mirror of
				https://github.com/nsnail/Ocelot.git
				synced 2025-11-04 18:30:48 +08:00 
			
		
		
		
	Not sure how I missed the acceptance test xunit update on the last commit. And, improve logging around test coverage.
This commit is contained in:
		@@ -18,6 +18,7 @@ var artifactsForUnitTestsDir = artifactsDir + Directory("UnitTests");
 | 
			
		||||
var unitTestAssemblies = @"./test/Ocelot.UnitTests/Ocelot.UnitTests.csproj";
 | 
			
		||||
var minCodeCoverage = 75d;
 | 
			
		||||
var coverallsRepoToken = "coveralls-repo-token-ocelot";
 | 
			
		||||
var coverallsRepo = "https://coveralls.io/github/TomPallister/Ocelot";
 | 
			
		||||
 | 
			
		||||
// acceptance testing
 | 
			
		||||
var artifactsForAcceptanceTestsDir = artifactsDir + Directory("AcceptanceTests");
 | 
			
		||||
@@ -155,7 +156,7 @@ Task("RunUnitTests")
 | 
			
		||||
					throw new Exception(string.Format("Coveralls repo token not found. Set environment variable '{0}'", coverallsRepoToken));
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				Information("Uploading test coverage to coveralls.io");
 | 
			
		||||
				Information(string.Format("Uploading test coverage to {0}", coverallsRepo));
 | 
			
		||||
				CoverallsNet(coverageSummaryFile, CoverallsNetReportType.OpenCover, new CoverallsNetSettings()
 | 
			
		||||
				{
 | 
			
		||||
					RepoToken = repoToken
 | 
			
		||||
@@ -173,7 +174,8 @@ Task("RunUnitTests")
 | 
			
		||||
		
 | 
			
		||||
			if(double.Parse(sequenceCoverage) < minCodeCoverage)
 | 
			
		||||
			{
 | 
			
		||||
				throw new Exception(string.Format("Code coverage fell below the threshold of {0}%", minCodeCoverage));
 | 
			
		||||
				var whereToCheck = !AppVeyor.IsRunningOnAppVeyor ? coverallsRepo : artifactsForUnitTestsDir;
 | 
			
		||||
				throw new Exception(string.Format("Code coverage fell below the threshold of {0}%. You can find the code coverage report at {1}", minCodeCoverage, whereToCheck));
 | 
			
		||||
			};
 | 
			
		||||
		
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@
 | 
			
		||||
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
 | 
			
		||||
    <PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta1-build1309" />
 | 
			
		||||
    <PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta2-build1317" />
 | 
			
		||||
    <PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.1" />
 | 
			
		||||
    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.1" />
 | 
			
		||||
    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.1.1" />
 | 
			
		||||
@@ -51,7 +51,7 @@
 | 
			
		||||
    <PackageReference Include="TestStack.BDDfy" Version="4.3.2" />
 | 
			
		||||
    <PackageReference Include="Consul" Version="0.7.2.1" />
 | 
			
		||||
    <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="1.1.1" />
 | 
			
		||||
    <PackageReference Include="xunit" Version="2.3.0-beta1-build3642" />
 | 
			
		||||
    <PackageReference Include="xunit" Version="2.3.0-beta2-build3683" />
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
 | 
			
		||||
</Project>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user