Merge remote-tracking branch 'oldcli/release/2.2.1xx' into merge-release/2.2.1xx

This commit is contained in:
William Li 2018-09-09 20:42:17 -07:00
commit f3c7f5ed78
36 changed files with 760 additions and 76 deletions

View file

@ -52,7 +52,7 @@ namespace EndToEnd
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." +
"The bundled aspnetcore versions set in Microsoft.NETCoreSdk.BundledVersions.props should be identical to the versions generated." +
"Please update MSBuildExtensions.targets in this repo so these versions match.");
}
@ -98,7 +98,7 @@ namespace EndToEnd
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." +
"The bundled aspnetcore versions set in Microsoft.NETCoreSdk.BundledVersions.props should be identical to the versions set in DependencyVersions.props." +
"Please update MSBuildExtensions.targets in this repo so these versions match.");
}

View file

@ -18,7 +18,8 @@ namespace EndToEnd
"1.0",
"1.1",
"2.0",
"2.1"
"2.1",
"2.2"
}.Select(version => new object[] { version });
}
}

View file

@ -109,19 +109,23 @@ namespace Microsoft.DotNet.TestFramework
return this;
}
public TestAssetInstance WithNuGetConfig(string nugetCache)
public TestAssetInstance WithNuGetConfig(string nugetCache, string externalRestoreSources = null)
{
var thisAssembly = typeof(TestAssetInstance).GetTypeInfo().Assembly;
var newNuGetConfig = Root.GetFile("NuGet.Config");
externalRestoreSources = externalRestoreSources ?? string.Empty;
var content = @"<?xml version=""1.0"" encoding=""utf-8""?>
<configuration>
<packageSources>
<add key=""dotnet-core"" value=""https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json"" />
<add key=""test-packages"" value=""$fullpath$"" />
$externalRestoreSources$
</packageSources>
</configuration>";
content = content.Replace("$fullpath$", nugetCache);
content = content
.Replace("$fullpath$", nugetCache)
.Replace("$externalRestoreSources$", externalRestoreSources);
using (var newNuGetConfigStream =
new FileStream(newNuGetConfig.FullName, FileMode.Create, FileAccess.Write))

View file

@ -22,6 +22,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
private string _stage2WithBackwardsCompatibleRuntimesDirectory;
private string _testPackages;
private string _testWorkingFolder;
private string _testArtifactsFolder;
public static string RepoRoot
{
@ -92,6 +93,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public string Stage2WithBackwardsCompatibleRuntimesDirectory => _stage2WithBackwardsCompatibleRuntimesDirectory;
public string TestPackages => _testPackages;
public string TestWorkingFolder => _testWorkingFolder;
public string TestArtifactsFolder => _testArtifactsFolder;
public RepoDirectoriesProvider(
string artifacts = null,
@ -123,6 +125,8 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
_testPackages = Path.Combine(_artifacts, "test", "packages");
}
_testArtifactsFolder = Path.Combine(_artifacts, "test", "artifacts");
_testWorkingFolder = Path.Combine(RepoRoot,
"bin",
(previousStage + 1).ToString(),

View file

@ -0,0 +1,33 @@
// 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;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.TestFramework;
using Microsoft.DotNet.Tools.Common;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public static class TestAssetInstanceExtensions
{
public static TestAssetInstance WithNuGetConfigAndExternalRestoreSources(
this TestAssetInstance testAssetInstance, string nugetCache)
{
var externalRestoreSourcesForTests = Path.Combine(
new RepoDirectoriesProvider().TestArtifactsFolder, "ExternalRestoreSourcesForTestsContainer.txt");
var externalRestoreSources = File.Exists(externalRestoreSourcesForTests) ?
File.ReadAllText(externalRestoreSourcesForTests) :
string.Empty;
return testAssetInstance.WithNuGetConfig(nugetCache, externalRestoreSources);
}
}
}