Skip to content

Commit 8ddbb6f

Browse files
Bump sdk version, update tests (#771)
Bump sdk version, update tests
1 parent 0cc2548 commit 8ddbb6f

26 files changed

+605
-433
lines changed

Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
1111
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>
1212
<LangVersion>preview</LangVersion>
13+
<RestoreSources>
14+
https://api.nuget.org/v3/index.json;
15+
</RestoreSources>
1316
</PropertyGroup>
1417

1518
<ItemGroup>

Directory.Build.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
<PackageReference Update="xunit" Version="2.4.1" />
2525
<PackageReference Update="xunit.assert" Version="2.4.1" />
2626
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.1"/>
27+
<PackageReference Update="Tmds.ExecFunction" Version="0.3.0" />
2728
</ItemGroup>
2829
</Project>

coverlet.sln

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.collector", "src\c
2323
EndProject
2424
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.collector.tests", "test\coverlet.collector.tests\coverlet.collector.tests.csproj", "{5ED4FA81-8F8C-4211-BA88-7573BD63262E}"
2525
EndProject
26-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.tests.remoteexecutor", "test\coverlet.tests.remoteexecutor\coverlet.tests.remoteexecutor.csproj", "{3E0F9E47-A1D7-4DF5-841D-A633486E2475}"
27-
EndProject
2826
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.tests.projectsample.empty", "test\coverlet.tests.projectsample.empty\coverlet.tests.projectsample.empty.csproj", "{085A3AFB-C086-4E98-86F1-1B481446EC5E}"
2927
EndProject
3028
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{77A15177-8262-488F-AF2B-91B9055715DA}"
@@ -37,7 +35,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
3735
Directory.Build.targets = Directory.Build.targets
3836
global.json = global.json
3937
eng\nightly.ps1 = eng\nightly.ps1
40-
nuget.config = nuget.config
4138
EndProjectSection
4239
EndProject
4340
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.tests.projectsample.excludedbyattribute", "test\coverlet.tests.projectsample.excludedbyattribute\coverlet.tests.projectsample.excludedbyattribute.csproj", "{D6B14F2F-9E7D-4D2C-BAC8-48834F853ED6}"
@@ -46,7 +43,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.integration.tests"
4643
EndProject
4744
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.integration.template", "test\coverlet.integration.template\coverlet.integration.template.csproj", "{F6FE7678-C662-43D3-AC6A-64F6AC5A5935}"
4845
EndProject
49-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "coverlet.core.tests.samples.netstandard", "test\coverlet.core.tests.samples.netstandard\coverlet.core.tests.samples.netstandard.csproj", "{5FF404AD-7C0B-465A-A1E9-558CDC642B0C}"
46+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.core.tests.samples.netstandard", "test\coverlet.core.tests.samples.netstandard\coverlet.core.tests.samples.netstandard.csproj", "{5FF404AD-7C0B-465A-A1E9-558CDC642B0C}"
47+
EndProject
48+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.tests.xunit.extensions", "test\coverlet.tests.xunit.extensions\coverlet.tests.xunit.extensions.csproj", "{F8199E19-FA9A-4559-9101-CAD7028121B4}"
5049
EndProject
5150
Global
5251
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -86,10 +85,6 @@ Global
8685
{5ED4FA81-8F8C-4211-BA88-7573BD63262E}.Debug|Any CPU.Build.0 = Debug|Any CPU
8786
{5ED4FA81-8F8C-4211-BA88-7573BD63262E}.Release|Any CPU.ActiveCfg = Release|Any CPU
8887
{5ED4FA81-8F8C-4211-BA88-7573BD63262E}.Release|Any CPU.Build.0 = Release|Any CPU
89-
{3E0F9E47-A1D7-4DF5-841D-A633486E2475}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
90-
{3E0F9E47-A1D7-4DF5-841D-A633486E2475}.Debug|Any CPU.Build.0 = Debug|Any CPU
91-
{3E0F9E47-A1D7-4DF5-841D-A633486E2475}.Release|Any CPU.ActiveCfg = Release|Any CPU
92-
{3E0F9E47-A1D7-4DF5-841D-A633486E2475}.Release|Any CPU.Build.0 = Release|Any CPU
9388
{085A3AFB-C086-4E98-86F1-1B481446EC5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
9489
{085A3AFB-C086-4E98-86F1-1B481446EC5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
9590
{085A3AFB-C086-4E98-86F1-1B481446EC5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -110,6 +105,10 @@ Global
110105
{5FF404AD-7C0B-465A-A1E9-558CDC642B0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
111106
{5FF404AD-7C0B-465A-A1E9-558CDC642B0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
112107
{5FF404AD-7C0B-465A-A1E9-558CDC642B0C}.Release|Any CPU.Build.0 = Release|Any CPU
108+
{F8199E19-FA9A-4559-9101-CAD7028121B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
109+
{F8199E19-FA9A-4559-9101-CAD7028121B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
110+
{F8199E19-FA9A-4559-9101-CAD7028121B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
111+
{F8199E19-FA9A-4559-9101-CAD7028121B4}.Release|Any CPU.Build.0 = Release|Any CPU
113112
EndGlobalSection
114113
GlobalSection(SolutionProperties) = preSolution
115114
HideSolutionNode = FALSE
@@ -123,12 +122,12 @@ Global
123122
{C68CF6DE-F86C-4BCF-BAB9-7A60C320E1F9} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
124123
{F5B2C45B-274B-43D6-9565-8B50659CFE56} = {E877EBA4-E78B-4F7D-A2D3-1E070FED04CD}
125124
{5ED4FA81-8F8C-4211-BA88-7573BD63262E} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
126-
{3E0F9E47-A1D7-4DF5-841D-A633486E2475} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
127125
{085A3AFB-C086-4E98-86F1-1B481446EC5E} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
128126
{D6B14F2F-9E7D-4D2C-BAC8-48834F853ED6} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
129127
{99B4059C-B25C-4B82-8117-A0E9DC9B0949} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
130128
{F6FE7678-C662-43D3-AC6A-64F6AC5A5935} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
131129
{5FF404AD-7C0B-465A-A1E9-558CDC642B0C} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
130+
{F8199E19-FA9A-4559-9101-CAD7028121B4} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
132131
EndGlobalSection
133132
GlobalSection(ExtensibilityGlobals) = postSolution
134133
SolutionGuid = {9CA57C02-97B0-4C38-A027-EA61E8741F10}

eng/azure-pipelines-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ steps:
66
version: 2.2.402
77
- task: UseDotNet@2
88
inputs:
9-
version: 3.1.100
9+
version: 3.1.200
1010
- powershell:
1111
.\eng\nightly.ps1 -apiKey $env:APIKEY -source $env:SOURCE
1212
ignoreLASTEXITCODE: true

eng/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ steps:
66

77
- task: UseDotNet@2
88
inputs:
9-
version: 3.1.100
9+
version: 3.1.200
1010
displayName: Install .NET Core SDK
1111

1212
- script: dotnet restore
@@ -22,5 +22,5 @@ steps:
2222
displayName: Test
2323
inputs:
2424
command: test
25-
arguments: -c $(BuildConfiguration) --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[coverlet.collector]*%2c[coverlet.core]*%2c[coverlet.msbuild.tasks]*" /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.remoteexecutor]*"
25+
arguments: -c $(BuildConfiguration) --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[coverlet.collector]*%2c[coverlet.core]*%2c[coverlet.msbuild.tasks]*" /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.xunit.extensions]*"
2626
testRunTitle: $(Agent.JobName)

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "3.1.100"
3+
"version": "3.1.*"
44
}
55
}

nuget.config

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/coverlet.core.tests/Coverage/CoverageTests.AsyncAwait.cs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22
using System.Threading.Tasks;
33

44
using Coverlet.Core.Samples.Tests;
5-
using Coverlet.Tests.RemoteExecutor;
5+
using Coverlet.Tests.Xunit.Extensions;
66
using Xunit;
77

88
namespace Coverlet.Core.Tests
99
{
1010
public partial class CoverageTests
1111
{
12-
[Fact]
12+
[ConditionalFact]
13+
[SkipOnOS(OS.MacOS)]
1314
public void AsyncAwait()
1415
{
1516
string path = Path.GetTempFileName();
1617
try
1718
{
18-
RemoteExecutor.Invoke(async pathSerialize =>
19+
FunctionExecutor.Run(async (string[] pathSerialize) =>
1920
{
2021
CoveragePrepareResult coveragePrepareResult = await TestInstrumentationHelper.Run<AsyncAwait>(instance =>
2122
{
@@ -29,9 +30,9 @@ public void AsyncAwait()
2930
res = ((Task<int>)instance.ConfigureAwait()).ConfigureAwait(false).GetAwaiter().GetResult();
3031

3132
return Task.CompletedTask;
32-
}, persistPrepareResultToFile: pathSerialize);
33+
}, persistPrepareResultToFile: pathSerialize[0]);
3334
return 0;
34-
}, path).Dispose();
35+
}, new string[] { path });
3536

3637
TestInstrumentationHelper.GetCoverageResult(path)
3738
.Document("Instrumentation.AsyncAwait.cs")
@@ -66,23 +67,24 @@ public void AsyncAwait()
6667
}
6768
}
6869

69-
[Fact]
70+
[ConditionalFact]
71+
[SkipOnOS(OS.MacOS)]
7072
public void AsyncAwait_Issue_669_1()
7173
{
7274
string path = Path.GetTempFileName();
7375
try
7476
{
75-
RemoteExecutor.Invoke(async pathSerialize =>
77+
FunctionExecutor.Run(async (string[] pathSerialize) =>
7678
{
7779
CoveragePrepareResult coveragePrepareResult = await TestInstrumentationHelper.Run<Issue_669_1>(instance =>
7880
{
7981
((Task)instance.Test()).ConfigureAwait(false).GetAwaiter().GetResult();
8082
return Task.CompletedTask;
8183
},
82-
persistPrepareResultToFile: pathSerialize);
84+
persistPrepareResultToFile: pathSerialize[0]);
8385

8486
return 0;
85-
}, path).Dispose();
87+
}, new string[] { path });
8688

8789
TestInstrumentationHelper.GetCoverageResult(path)
8890
.Document("Instrumentation.AsyncAwait.cs")
@@ -97,23 +99,24 @@ public void AsyncAwait_Issue_669_1()
9799
}
98100
}
99101

100-
[Fact]
102+
[ConditionalFact]
103+
[SkipOnOS(OS.MacOS)]
101104
public void AsyncAwait_Issue_669_2()
102105
{
103106
string path = Path.GetTempFileName();
104107
try
105108
{
106-
RemoteExecutor.Invoke(async pathSerialize =>
109+
FunctionExecutor.Run(async (string[] pathSerialize) =>
107110
{
108111
CoveragePrepareResult coveragePrepareResult = await TestInstrumentationHelper.Run<Issue_669_2>(instance =>
109112
{
110113
((ValueTask<System.Net.Http.HttpResponseMessage>)instance.SendRequest()).ConfigureAwait(false).GetAwaiter().GetResult();
111114
return Task.CompletedTask;
112115
},
113-
persistPrepareResultToFile: pathSerialize);
116+
persistPrepareResultToFile: pathSerialize[0]);
114117

115118
return 0;
116-
}, path).Dispose();
119+
}, new string[] { path });
117120

118121
TestInstrumentationHelper.GetCoverageResult(path)
119122
.Document("Instrumentation.AsyncAwait.cs")

test/coverlet.core.tests/Coverage/CoverageTests.ExcludeFromCoverageAttribute.cs

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
using System;
22
using System.IO;
33
using System.Linq;
4+
using System.Runtime.InteropServices;
45
using System.Threading.Tasks;
56

67
using Coverlet.Core.Abstracts;
78
using Coverlet.Core.Helpers;
89
using Coverlet.Core.Samples.Tests;
9-
using Coverlet.Tests.RemoteExecutor;
10+
using Coverlet.Tests.Xunit.Extensions;
1011
using Moq;
1112
using Xunit;
1213

@@ -33,23 +34,24 @@ public void TestCoverageSkipModule__AssemblyMarkedAsExcludeFromCodeCoverage()
3334
loggerMock.Verify(l => l.LogVerbose(It.IsAny<string>()));
3435
}
3536

36-
[Fact]
37+
[ConditionalFact]
38+
[SkipOnOS(OS.MacOS)]
3739
public void ExcludeFromCodeCoverage_CompilerGeneratedMethodsAndTypes()
3840
{
3941
string path = Path.GetTempFileName();
4042
try
4143
{
42-
RemoteExecutor.Invoke(async pathSerialize =>
44+
FunctionExecutor.Run(async (string[] pathSerialize) =>
4345
{
4446
CoveragePrepareResult coveragePrepareResult = await TestInstrumentationHelper.Run<MethodsWithExcludeFromCodeCoverageAttr>(instance =>
4547
{
4648
((Task<int>)instance.Test("test")).ConfigureAwait(false).GetAwaiter().GetResult();
4749
return Task.CompletedTask;
48-
}, persistPrepareResultToFile: pathSerialize);
50+
}, persistPrepareResultToFile: pathSerialize[0]);
4951

5052
return 0;
5153

52-
}, path).Dispose();
54+
}, new string[] { path });
5355

5456
CoverageResult result = TestInstrumentationHelper.GetCoverageResult(path);
5557

@@ -74,23 +76,24 @@ public void ExcludeFromCodeCoverage_CompilerGeneratedMethodsAndTypes()
7476
}
7577
}
7678

77-
[Fact]
79+
[ConditionalFact]
80+
[SkipOnOS(OS.MacOS)]
7881
public void ExcludeFromCodeCoverage_CompilerGeneratedMethodsAndTypes_NestedMembers()
7982
{
8083
string path = Path.GetTempFileName();
8184
try
8285
{
83-
RemoteExecutor.Invoke(async pathSerialize =>
86+
FunctionExecutor.Run(async (string[] pathSerialize) =>
8487
{
8588
CoveragePrepareResult coveragePrepareResult = await TestInstrumentationHelper.Run<MethodsWithExcludeFromCodeCoverageAttr_NestedStateMachines>(instance =>
8689
{
8790
instance.Test();
8891
return Task.CompletedTask;
89-
}, persistPrepareResultToFile: pathSerialize);
92+
}, persistPrepareResultToFile: pathSerialize[0]);
9093

9194
return 0;
9295

93-
}, path).Dispose();
96+
}, new string[] { path });
9497

9598
CoverageResult result = TestInstrumentationHelper.GetCoverageResult(path);
9699

@@ -104,23 +107,24 @@ public void ExcludeFromCodeCoverage_CompilerGeneratedMethodsAndTypes_NestedMembe
104107
}
105108
}
106109

107-
[Fact]
110+
[ConditionalFact]
111+
[SkipOnOS(OS.MacOS)]
108112
public void ExcludeFromCodeCoverageCompilerGeneratedMethodsAndTypes_Issue670()
109113
{
110114
string path = Path.GetTempFileName();
111115
try
112116
{
113-
RemoteExecutor.Invoke(async pathSerialize =>
117+
FunctionExecutor.Run(async (string[] pathSerialize) =>
114118
{
115119
CoveragePrepareResult coveragePrepareResult = await TestInstrumentationHelper.Run<MethodsWithExcludeFromCodeCoverageAttr_Issue670>(instance =>
116120
{
117121
instance.Test("test");
118122
return Task.CompletedTask;
119-
}, persistPrepareResultToFile: pathSerialize);
123+
}, persistPrepareResultToFile: pathSerialize[0]);
120124

121125
return 0;
122126

123-
}, path).Dispose();
127+
}, new string[] { path });
124128

125129
CoverageResult result = TestInstrumentationHelper.GetCoverageResult(path);
126130

@@ -134,22 +138,23 @@ public void ExcludeFromCodeCoverageCompilerGeneratedMethodsAndTypes_Issue670()
134138
}
135139
}
136140

137-
[Fact]
141+
[ConditionalFact]
142+
[SkipOnOS(OS.MacOS)]
138143
public void ExcludeFromCodeCoverageNextedTypes()
139144
{
140145
string path = Path.GetTempFileName();
141146
try
142147
{
143-
RemoteExecutor.Invoke(async pathSerialize =>
148+
FunctionExecutor.Run(async (string[] pathSerialize) =>
144149
{
145150
CoveragePrepareResult coveragePrepareResult = await TestInstrumentationHelper.Run<ExcludeFromCoverageAttrFilterClass1>(instance =>
146151
{
147152
Assert.Equal(42, instance.Run());
148153
return Task.CompletedTask;
149-
}, persistPrepareResultToFile: pathSerialize);
154+
}, persistPrepareResultToFile: pathSerialize[0]);
150155

151156
return 0;
152-
}, path).Dispose();
157+
}, new string[] { path });
153158

154159
TestInstrumentationHelper.GetCoverageResult(path)
155160
.Document("Instrumentation.ExcludeFromCoverage.cs")

0 commit comments

Comments
 (0)