Update test to pass --no-restore to templates

This commit is contained in:
Mike Lorbetske 2017-07-10 15:57:30 -07:00
parent 5aec446657
commit ea467db3af
13 changed files with 20 additions and 18 deletions

View file

@ -47,7 +47,7 @@ namespace Microsoft.DotNet.Cli.Build
{
ToolPath = ToolPath,
TemplateType = newArgs[0],
TemplateArgs = newArgs[1] + $" --debug:ephemeral-hive -n TempProject -o \"{outputDir}\"",
TemplateArgs = newArgs[1] + $" --debug:ephemeral-hive -n TempProject -o \"{outputDir}\" --no-restore",
HostObject = HostObject,
BuildEngine = BuildEngine
};

View file

@ -15,7 +15,7 @@ namespace Microsoft.DotNet.Tools.Migrate
string outputDirectory,
string workingDirectory)
{
RunCommand("new", new string[] { "console", "-o", workingDirectory, "--debug:ephemeral-hive" }, workingDirectory);
RunCommand("new", new string[] { "console", "-o", workingDirectory, "--debug:ephemeral-hive", "--no-restore" }, workingDirectory);
}
private void RunCommand(string commandToExecute, IEnumerable<string> args, string workingDirectory)
{

View file

@ -19,7 +19,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd
{
string projectDirectory = directory.Path;
string newArgs = "console -f netcoreapp2.0 --debug:ephemeral-hive";
string newArgs = "console -f netcoreapp2.0 --debug:ephemeral-hive --no-restore";
new NewCommandShim()
.WithWorkingDirectory(projectDirectory)
.Execute(newArgs)

View file

@ -68,7 +68,7 @@ Commands:
try
{
string args = $"classlib -o \"{projDir.Path}\" --debug:ephemeral-hive";
string args = $"classlib -o \"{projDir.Path}\" --debug:ephemeral-hive --no-restore";
new NewCommandShim()
.WithWorkingDirectory(projDir.Path)
.ExecuteWithCapturedOutput(args)

View file

@ -93,7 +93,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests
string dir = "pkgs";
string args = $"--packages {dir}";
string newArgs = $"console -f netcoreapp2.0 -o \"{rootPath}\" --debug:ephemeral-hive";
string newArgs = $"console -f netcoreapp2.0 -o \"{rootPath}\" --debug:ephemeral-hive --no-restore";
new NewCommandShim()
.WithWorkingDirectory(rootPath)
.Execute(newArgs)

View file

@ -209,7 +209,7 @@ Commands:
try
{
string newArgs = $"classlib -o \"{dir.Path}\" --debug:ephemeral-hive";
string newArgs = $"classlib -o \"{dir.Path}\" --debug:ephemeral-hive --no-restore";
new NewCommandShim()
.WithWorkingDirectory(dir.Path)
.ExecuteWithCapturedOutput(newArgs)

View file

@ -21,13 +21,13 @@ namespace Microsoft.DotNet.New.Tests
new NewCommand()
.WithWorkingDirectory(rootPath)
.Execute($"console --debug:ephemeral-hive");
.Execute($"console --debug:ephemeral-hive --no-restore");
DateTime expectedState = Directory.GetLastWriteTime(rootPath);
var result = new NewCommand()
.WithWorkingDirectory(rootPath)
.ExecuteWithCapturedOutput($"console --debug:ephemeral-hive");
.ExecuteWithCapturedOutput($"console --debug:ephemeral-hive --no-restore");
DateTime actualState = Directory.GetLastWriteTime(rootPath);
@ -64,7 +64,7 @@ namespace Microsoft.DotNet.New.Tests
new NewCommand()
.WithWorkingDirectory(projectFolder)
.Execute($"{projectType} --debug:ephemeral-hive")
.Execute($"{projectType} --debug:ephemeral-hive --no-restore")
.Should().Pass();
// https://github.com/dotnet/templating/issues/946 - remove DisableImplicitAssetTargetFallback once this is fixed.
@ -87,7 +87,7 @@ namespace Microsoft.DotNet.New.Tests
new NewCommand()
.WithWorkingDirectory(rootPath)
.Execute($"{type} --name {projectName} -o . --debug:ephemeral-hive")
.Execute($"{type} --name {projectName} -o . --debug:ephemeral-hive --no-restore")
.Should().Pass();
new RestoreCommand()

View file

@ -42,9 +42,11 @@ namespace Microsoft.DotNet.New.Tests
bool skipSpaWebpackSteps)
{
string rootPath = TestAssets.CreateTestDirectory(identifier: $"{language}_{projectType}").FullName;
//This works around the SPA templates not currently supporting the "--no-restore" switch
string noRestoreDirective = skipSpaWebpackSteps ? "" : "--no-restore";
new TestCommand("dotnet") { WorkingDirectory = rootPath }
.Execute($"new {projectType} -lang {language} -o {rootPath} --debug:ephemeral-hive")
.Execute($"new {projectType} -lang {language} -o {rootPath} --debug:ephemeral-hive {noRestoreDirective}")
.Should().Pass();
if (useNuGetConfigForAspNet)

View file

@ -245,7 +245,7 @@ namespace Microsoft.DotNet.Tools.Pack.Tests
string dir = "pkgs";
string args = $"--packages {dir}";
string newArgs = $"console -o \"{rootPath}\"";
string newArgs = $"console -o \"{rootPath}\" --no-restore";
new NewCommandShim()
.WithWorkingDirectory(rootPath)
.Execute(newArgs)

View file

@ -206,7 +206,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
string dir = "pkgs";
string args = $"--packages {dir}";
string newArgs = $"console -o \"{rootPath}\"";
string newArgs = $"console -o \"{rootPath}\" --no-restore";
new NewCommandShim()
.WithWorkingDirectory(rootPath)
.Execute(newArgs)

View file

@ -65,7 +65,7 @@ Commands:
try
{
string newArgs = $"classlib -o \"{projDir.Path}\"";
string newArgs = $"classlib -o \"{projDir.Path}\" --no-restore";
new NewCommandShim()
.WithWorkingDirectory(projDir.Path)
.ExecuteWithCapturedOutput(newArgs)

View file

@ -24,7 +24,7 @@ namespace Microsoft.DotNet.Restore.Tests
string dir = "pkgs";
string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir));
string newArgs = $"console -o \"{rootPath}\"";
string newArgs = $"console -o \"{rootPath}\" --no-restore";
new NewCommandShim()
.WithWorkingDirectory(rootPath)
.Execute(newArgs)
@ -51,7 +51,7 @@ namespace Microsoft.DotNet.Restore.Tests
string dir = "pkgs";
string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir));
string newArgs = $"classlib -o \"{rootPath}\"";
string newArgs = $"classlib -o \"{rootPath}\" --no-restore";
new NewCommandShim()
.WithWorkingDirectory(rootPath)
.Execute(newArgs)
@ -98,7 +98,7 @@ namespace Microsoft.DotNet.Restore.Tests
string dir = "pkgs";
string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir));
string newArgs = $"console -o \"{rootPath}\"";
string newArgs = $"console -o \"{rootPath}\" --no-restore";
new NewCommandShim()
.WithWorkingDirectory(rootPath)
.Execute(newArgs)

View file

@ -198,7 +198,7 @@ namespace Microsoft.DotNet.Cli.Run.Tests
string dir = "pkgs";
string args = $"--packages {dir}";
string newArgs = $"console -o \"{rootPath}\"";
string newArgs = $"console -o \"{rootPath}\" --no-restore";
new NewCommandShim()
.WithWorkingDirectory(rootPath)
.Execute(newArgs)