Skip to content

Commit 8a5689e

Browse files
committed
fix CreateDeterministicTestPropsFile and use first PropertyGroup
1 parent 6ef6111 commit 8a5689e

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<!-- Import coverlet version-->
33
<Import Project="$(MSBuildThisFileDirectory)\DeterministicTest.props" Condition="Exists('$(MSBuildThisFileDirectory)\DeterministicTest.props')" />
4-
<!-- Define default values if props file doesn't exist -->
5-
<PropertyGroup Condition="!Exists('DeterministicTest.props')">
6-
<coverletCollectorsVersion>6.0.4</coverletCollectorsVersion>
7-
<coverletMsbuildVersion>6.0.4</coverletMsbuildVersion>
8-
</PropertyGroup>
9-
4+
105
<PropertyGroup>
116
<TargetFramework>net8.0</TargetFramework>
127
<IsPackable>false</IsPackable>
@@ -19,6 +14,12 @@
1914
</RestoreSources>
2015
</PropertyGroup>
2116

17+
<!-- Define default values if props file doesn't exist -->
18+
<PropertyGroup Condition="!Exists('DeterministicTest.props')">
19+
<coverletCollectorsVersion>6.0.4</coverletCollectorsVersion>
20+
<coverletMsbuildVersion>6.0.4</coverletMsbuildVersion>
21+
</PropertyGroup>
22+
2223
<ItemGroup>
2324
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" />
2425
<PackageReference Include="coverlet.msbuild" Version="$(coverletMsbuildVersion)">

test/coverlet.integration.tests/DeterministicBuild.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private void CreateDeterministicTestPropsFile()
4848
new XElement("coverletMsbuildVersion", GetPackageVersion("*msbuild*.nupkg")),
4949
new XElement("coverletCollectorsVersion", GetPackageVersion("*collector*.nupkg")))));
5050
_testProjectTfm = XElement.Load(Path.Combine(_testProjectPath, "coverlet.integration.determisticbuild.csproj"))!.
51-
Descendants("PropertyGroup")!.Single().Element("TargetFramework")!.Value;
51+
Descendants("PropertyGroup")!.First().Element("TargetFramework")!.Value;
5252

5353
deterministicTestProps.Save(propsFile);
5454
}

0 commit comments

Comments
 (0)