Fix test issues

This commit is contained in:
Nick Guerrera 2018-07-27 15:01:22 -07:00
parent 934ae35aa1
commit d6d0130942
6 changed files with 40 additions and 29 deletions

View file

@ -6,6 +6,7 @@
<TargetFramework>$(CliTargetFramework)</TargetFramework>
<OutputType>Exe</OutputType>
<VersionSuffix></VersionSuffix>
<RuntimeFrameworkVersion>$(MicrosoftNETCoreAppPackageVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>

View file

@ -0,0 +1,23 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
if (args.Length > 0)
{
for (int i = 0; i < args.Length; i++)
{
Console.WriteLine($"{i} = {args[i]}");
}
}
}
}
}

View file

@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>
</Project>

View file

@ -113,6 +113,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<LatestPatchVersionForNetCore1_0 Condition="'%24(LatestPatchVersionForNetCore1_0)' == ''">1.0.12</LatestPatchVersionForNetCore1_0>
<LatestPatchVersionForNetCore1_1 Condition="'%24(LatestPatchVersionForNetCore1_1)' == ''">1.1.9</LatestPatchVersionForNetCore1_1>
<LatestPatchVersionForNetCore2_0 Condition="'%24(LatestPatchVersionForNetCore2_0)' == ''">2.0.9</LatestPatchVersionForNetCore2_0>
<LatestPatchVersionForNetCore2_1 Condition="'%24(LatestPatchVersionForNetCore2_1)' == ''">2.1.2</LatestPatchVersionForNetCore2_1>
</PropertyGroup>
</Project>
]]>

View file

@ -48,6 +48,9 @@ namespace EndToEnd
var restoredVersion = GetAspNetCoreAppVersion(assetsFile, portable: true);
restoredVersion.Should().NotBeNull();
var bundledVersionPath = Path.Combine(projectDirectory, ".BundledAspNetCoreVersion");
var bundledVersion = File.ReadAllText(bundledVersionPath).Trim();
restoredVersion.ToNormalizedString().Should().BeEquivalentTo(bundledVersion,
"The bundled aspnetcore versions set in Microsoft.NETCoreSdk.BundledVersions.props should be idenitical to the versions set in DependencyVersions.props." +
"Please update MSBuildExtensions.targets in this repo so these versions match.");

View file

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
@ -22,8 +23,9 @@ namespace EndToEnd
[ClassData(typeof(SupportedNetCoreAppVersions))]
public void ItRollsForwardToTheLatestVersion(string minorVersion)
{
// https://github.com/dotnet/cli/issues/9661: remove this once the ASP.NET version bump
// merges from 2.1.3xx -> 2.1.4xx -> 2.2.1xx
// https://github.com/dotnet/cli/issues/9661
// https://github.com/dotnet/sdk/issues/2446
// dotnet/sdk is missing handling for 2.1 when it isn't the latest runtime
if (minorVersion == "2.1")
{
return;
@ -132,32 +134,5 @@ namespace EndToEnd
}
}
public static IEnumerable<object[]> SupportedNetCoreAppVersions
{
get
{
var versions = new List<string>();
// Runtime 1.x deosn't support openSUSE and Fedora 27, so skip testing those versions on Linux
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
versions.AddRange(new[]
{
"1.0",
"1.1",
});
}
versions.AddRange(new[]
{
"2.0",
"2.1",
"3.0"
});
return versions.Select(version => new object[] { version });
}
}
}
}