Merge pull request #6242 from wli3/fix-msi-gg
Fix msi non-deterministic ComponentId
This commit is contained in:
commit
2f3fb6ea5e
8 changed files with 182 additions and 40 deletions
49
test/core-sdk-tasks.Tests/CalculateTemplateVerionsTests.cs
Normal file
49
test/core-sdk-tasks.Tests/CalculateTemplateVerionsTests.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
using FluentAssertions;
|
||||
using Xunit;
|
||||
using Microsoft.DotNet.Cli.Build;
|
||||
|
||||
namespace EndToEnd
|
||||
{
|
||||
public class CalculateTemplateVersionsTests
|
||||
{
|
||||
[Fact]
|
||||
public void WhenAspNetCoreTemplateMajorVersionLowerthan3ItCanCalculateTemplateVersionsInStableBuilds()
|
||||
{
|
||||
var result = CalculateTemplateVersions.Calculate("3.1.0", "014885", "dev");
|
||||
|
||||
result.Should()
|
||||
.Be(("3.1.1.014885", "3.1.1", "3.1"),
|
||||
"the patch is 1 higher than aspnetTemplateVersion " +
|
||||
"due to https://github.com/dotnet/core-sdk/issues/6243");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhenAspNetCoreTemplateMajorVersionLowerthan3ItCanCalculateTemplateVersionsInNonStableBuilds()
|
||||
{
|
||||
var result = CalculateTemplateVersions.Calculate("3.0.0-alpha.1.20071.6", "014885", "dev");
|
||||
|
||||
result.Should()
|
||||
.Be(("3.0.1.014885", "3.0.1-dev", "3.0"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhenAspNetCoreTemplateMajorVersionHigherthan3ItCanCalculateTemplateVersionsInStableBuilds()
|
||||
{
|
||||
var result = CalculateTemplateVersions.Calculate("5.1.0", "014885", "dev");
|
||||
|
||||
result.Should()
|
||||
.Be(("5.1.0.014885", "5.1.0", "5.1"),
|
||||
"the patch align with AspNetCoreTemplateMajorVersion again, " +
|
||||
"since there is no non-deterministic existing ComponentId under Major version 5.");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhenAspNetCoreTemplateMajorVersionHigherthan3ItCanCalculateTemplateVersionsInNonStableBuilds()
|
||||
{
|
||||
var result = CalculateTemplateVersions.Calculate("5.0.0-alpha.1.20071.6", "014885", "dev");
|
||||
|
||||
result.Should()
|
||||
.Be(("5.0.0.014885", "5.0.0-dev", "5.0"));
|
||||
}
|
||||
}
|
||||
}
|
14
test/core-sdk-tasks.Tests/core-sdk-tasks.Tests.csproj
Normal file
14
test/core-sdk-tasks.Tests/core-sdk-tasks.Tests.csproj
Normal file
|
@ -0,0 +1,14 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>$(CoreSdkTargetFramework);net472</TargetFrameworks>
|
||||
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">$(CoreSdkTargetFramework)</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FluentAssertions" Version="4.18.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\core-sdk-tasks\core-sdk-tasks.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
Add table
Add a link
Reference in a new issue