Skip to content

Commit 4337962

Browse files
committed
fix tests
1 parent cf5a5e1 commit 4337962

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,4 +315,4 @@ coverage.*.cobertura.xml
315315
coverage.*.opencover.xml
316316

317317
FolderProfile.pubxml
318-
/NuGet.config
318+
nuget.config

test/coverlet.integration.determisticbuild/coverlet.integration.determisticbuild.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
<PrivateAssets>all</PrivateAssets>
2525
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2626
</PackageReference>
27-
<PackageReference Include="xunit" Version="2.6.6" />
28-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6" />
29-
<PackageReference Include="System.Buffers" Version="4.5.1" />
27+
<PackageReference Include="xunit" Version="2.9.0" />
28+
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
29+
<!-- <PackageReference Include="System.Buffers" Version="4.5.1" />
3030
<PackageReference Include="System.Memory" Version="4.5.5" />
31-
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="6.0.4" />
31+
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="6.0.4" /> -->
3232
</ItemGroup>
3333
</Project>

test/coverlet.integration.tests/DotnetTool.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public void StandAloneThreshold()
7171
string coverletToolCommandPath = InstallTool(clonedTemplateProject.ProjectRootPath!);
7272
DotnetCli($"build -f {_buildTargetFramework} {clonedTemplateProject.ProjectRootPath}", out string standardOutput, out string standardError);
7373
string publishedTestFile = clonedTemplateProject.GetFiles("*" + ClonedTemplateProject.AssemblyName + ".dll").Single(f => !f.Contains("obj") && !f.Contains("ref"));
74-
Assert.False(RunCommand(coverletToolCommandPath, $"\"{Path.GetDirectoryName(publishedTestFile)}\" --target \"dotnet\" --targetargs \"{publishedTestFile}\" --threshold 80 --output \"{clonedTemplateProject.ProjectRootPath}\"\\", out standardOutput, out standardError));
74+
Assert.True(RunCommand(coverletToolCommandPath, $"\"{Path.GetDirectoryName(publishedTestFile)}\" --target \"dotnet\" --targetargs \"{publishedTestFile}\" --threshold 80 --output \"{clonedTemplateProject.ProjectRootPath}\"\\", out standardOutput, out standardError));
7575
if (!string.IsNullOrEmpty(standardError))
7676
{
7777
_output.WriteLine(standardError);
@@ -92,7 +92,7 @@ public void StandAloneThresholdLine()
9292
string coverletToolCommandPath = InstallTool(clonedTemplateProject.ProjectRootPath!);
9393
DotnetCli($"build -f {_buildTargetFramework} {clonedTemplateProject.ProjectRootPath}", out string standardOutput, out string standardError);
9494
string publishedTestFile = clonedTemplateProject.GetFiles("*" + ClonedTemplateProject.AssemblyName + ".dll").Single(f => !f.Contains("obj") && !f.Contains("ref"));
95-
Assert.False(RunCommand(coverletToolCommandPath, $"\"{Path.GetDirectoryName(publishedTestFile)}\" --target \"dotnet\" --targetargs \"{publishedTestFile}\" --threshold 80 --threshold-type line --output \"{clonedTemplateProject.ProjectRootPath}\"\\", out standardOutput, out standardError));
95+
Assert.True(RunCommand(coverletToolCommandPath, $"\"{Path.GetDirectoryName(publishedTestFile)}\" --target \"dotnet\" --targetargs \"{publishedTestFile}\" --threshold 80 --threshold-type line --output \"{clonedTemplateProject.ProjectRootPath}\"\\", out standardOutput, out standardError));
9696
if (!string.IsNullOrEmpty(standardError))
9797
{
9898
_output.WriteLine(standardError);
@@ -113,7 +113,7 @@ public void StandAloneThresholdLineAndMethod()
113113
string coverletToolCommandPath = InstallTool(clonedTemplateProject.ProjectRootPath!);
114114
DotnetCli($"build -f {_buildTargetFramework} {clonedTemplateProject.ProjectRootPath}", out string standardOutput, out string standardError);
115115
string publishedTestFile = clonedTemplateProject.GetFiles("*" + ClonedTemplateProject.AssemblyName + ".dll").Single(f => !f.Contains("obj") && !f.Contains("ref"));
116-
Assert.False(RunCommand(coverletToolCommandPath, $"\"{Path.GetDirectoryName(publishedTestFile)}\" --target \"dotnet\" --targetargs \"{publishedTestFile}\" --threshold 80 --threshold-type line --threshold-type method --output \"{clonedTemplateProject.ProjectRootPath}\"\\", out standardOutput, out standardError));
116+
Assert.True(RunCommand(coverletToolCommandPath, $"\"{Path.GetDirectoryName(publishedTestFile)}\" --target \"dotnet\" --targetargs \"{publishedTestFile}\" --threshold 80 --threshold-type line --threshold-type method --output \"{clonedTemplateProject.ProjectRootPath}\"\\", out standardOutput, out standardError));
117117
if (!string.IsNullOrEmpty(standardError))
118118
{
119119
_output.WriteLine(standardError);

test/coverlet.tests.utils/TestUtils.cs

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public static BuildConfiguration GetAssemblyBuildConfiguration()
3333

3434
public static string GetAssemblyTargetFramework()
3535
{
36+
37+
#if NET6_0
38+
return "net6.0";
39+
#endif
3640
#if NET7_0
3741
return "net7.0";
3842
#endif

0 commit comments

Comments
 (0)