Merge branch 'release/2.1' into dev
This commit is contained in:
commit
006d111e3b
|
|
@ -41,12 +41,12 @@
|
|||
<MicrosoftVisualStudioWebBrowserLinkPackageVersion>2.2.0-preview1-34410</MicrosoftVisualStudioWebBrowserLinkPackageVersion>
|
||||
<MicrosoftVisualStudioWebCodeGenerationDesignPackageVersion>2.2.0-preview1-34410</MicrosoftVisualStudioWebCodeGenerationDesignPackageVersion>
|
||||
<NETStandardLibrary20PackageVersion>2.0.3</NETStandardLibrary20PackageVersion>
|
||||
<SeleniumFirefoxWebDriverPackageVersion>0.19.0</SeleniumFirefoxWebDriverPackageVersion>
|
||||
<SeleniumSupportPackageVersion>3.7.0</SeleniumSupportPackageVersion>
|
||||
<SeleniumWebDriverMicrosoftDriverPackageVersion>16.16299.0</SeleniumWebDriverMicrosoftDriverPackageVersion>
|
||||
<SeleniumWebDriverPackageVersion>3.7.0</SeleniumWebDriverPackageVersion>
|
||||
<SeleniumFirefoxWebDriverPackageVersion>0.20.0</SeleniumFirefoxWebDriverPackageVersion>
|
||||
<SeleniumSupportPackageVersion>3.12.1</SeleniumSupportPackageVersion>
|
||||
<SeleniumWebDriverMicrosoftDriverPackageVersion>17.17134.0</SeleniumWebDriverMicrosoftDriverPackageVersion>
|
||||
<SeleniumWebDriverPackageVersion>3.12.1</SeleniumWebDriverPackageVersion>
|
||||
<SystemSecurityPermissionsPackageVersion>4.6.0-preview1-26604-01</SystemSecurityPermissionsPackageVersion>
|
||||
<XunitAnalyzersPackageVersion>0.8.0</XunitAnalyzersPackageVersion>
|
||||
<XunitAnalyzersPackageVersion>0.9.0</XunitAnalyzersPackageVersion>
|
||||
<XunitPackageVersion>2.3.1</XunitPackageVersion>
|
||||
<XunitRunnerVisualStudioPackageVersion>2.4.0-beta.1.build3945</XunitRunnerVisualStudioPackageVersion>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
using System;
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.CommandLineUtils;
|
||||
|
|
@ -22,19 +25,25 @@ namespace Templates.Test.Helpers
|
|||
"Microsoft.DotNet.Web.Spa.ProjectTemplates",
|
||||
};
|
||||
|
||||
public static void EnsureTemplatePackagesWereReinstalled(ITestOutputHelper output)
|
||||
public static string CustomHivePath { get; } = Path.Combine(AppContext.BaseDirectory, ".templateengine");
|
||||
|
||||
public static void EnsureTemplatingEngineInitialized(ITestOutputHelper output)
|
||||
{
|
||||
lock (_templatePackagesReinstallationLock)
|
||||
{
|
||||
if (!_haveReinstalledTemplatePackages)
|
||||
{
|
||||
ReinstallTemplatePackages(output);
|
||||
if (Directory.Exists(CustomHivePath))
|
||||
{
|
||||
Directory.Delete(CustomHivePath, recursive: true);
|
||||
}
|
||||
InstallTemplatePackages(output);
|
||||
_haveReinstalledTemplatePackages = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ReinstallTemplatePackages(ITestOutputHelper output)
|
||||
private static void InstallTemplatePackages(ITestOutputHelper output)
|
||||
{
|
||||
// Remove any previous or prebundled version of the template packages
|
||||
foreach (var packageName in _templatePackages)
|
||||
|
|
@ -43,7 +52,7 @@ namespace Templates.Test.Helpers
|
|||
output,
|
||||
AppContext.BaseDirectory,
|
||||
DotNetMuxer.MuxerPathOrDefault(),
|
||||
$"new --uninstall {packageName}");
|
||||
$"new --uninstall {packageName} --debug:custom-hive \"{CustomHivePath}\"");
|
||||
|
||||
// We don't need this command to succeed, because we'll verify next that
|
||||
// uninstallation had the desired effect. This command is expected to fail
|
||||
|
|
@ -66,7 +75,7 @@ namespace Templates.Test.Helpers
|
|||
output,
|
||||
AppContext.BaseDirectory,
|
||||
DotNetMuxer.MuxerPathOrDefault(),
|
||||
$"new --install \"{packagePath}\"");
|
||||
$"new --install \"{packagePath}\" --debug:custom-hive \"{CustomHivePath}\"");
|
||||
proc.WaitForExit(assertSuccess: true);
|
||||
}
|
||||
}
|
||||
|
|
@ -84,7 +93,7 @@ namespace Templates.Test.Helpers
|
|||
output,
|
||||
tempDir,
|
||||
DotNetMuxer.MuxerPathOrDefault(),
|
||||
$"new \"{templateName}\"");
|
||||
$"new \"{templateName}\" --debug:custom-hive \"{CustomHivePath}\"");
|
||||
|
||||
proc.WaitForExit(assertSuccess: false);
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace Templates.Test
|
|||
|
||||
public TemplateTestBase(ITestOutputHelper output)
|
||||
{
|
||||
TemplatePackageInstaller.EnsureTemplatePackagesWereReinstalled(output);
|
||||
TemplatePackageInstaller.EnsureTemplatingEngineInitialized(output);
|
||||
|
||||
Output = output;
|
||||
ProjectGuid = Guid.NewGuid().ToString("N");
|
||||
|
|
@ -57,16 +57,11 @@ $@"<Project>
|
|||
File.WriteAllText(Path.Combine(TemplateOutputDir, "Directory.Build.targets"), directoryBuildTargetsContent);
|
||||
}
|
||||
|
||||
protected void InstallTemplatePackages()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected void RunDotNetNew(string templateName, string targetFrameworkOverride, string auth = null, string language = null, bool useLocalDB = false, bool noHttps = false)
|
||||
{
|
||||
SetAfterDirectoryBuildPropsContents();
|
||||
|
||||
var args = $"new {templateName}";
|
||||
var args = $"new {templateName} --debug:custom-hive \"{TemplatePackageInstaller.CustomHivePath}\"";
|
||||
|
||||
if (!string.IsNullOrEmpty(targetFrameworkOverride))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue