re-restore test projects at their destination

since NuGet now stores the relative path to dependent projects in the lock file, projects need to be restored when they are moved
This commit is contained in:
Andrew Stanton-Nurse 2016-04-13 15:59:48 -07:00
parent 362397a945
commit 71d5738fff
6 changed files with 15 additions and 7 deletions

View file

@ -20,7 +20,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests
public GivenThatWeWantToUseDotnetTestE2EInDesignTime()
{
var testAssetManager = new TestAssetsManager(Path.Combine(RepoRoot, "TestAssets"));
var testInstance = testAssetManager.CreateTestInstance("ProjectWithTests").WithLockFiles();
var testInstance = testAssetManager.CreateTestInstance("ProjectWithTests");
_projectFilePath = Path.Combine(testInstance.TestRoot, "project.json");
var contexts = ProjectContext.CreateContextForEachFramework(
@ -28,6 +28,11 @@ namespace Microsoft.Dotnet.Tools.Test.Tests
null,
PlatformServices.Default.Runtime.GetAllCandidateRuntimeIdentifiers());
// Restore the project again in the destination to resolve projects
// Since the lock file has project relative paths in it, those will be broken
// unless we re-restore
new RestoreCommand() { WorkingDirectory = testInstance.TestRoot }.Execute().Should().Pass();
_outputPath = Path.Combine(testInstance.TestRoot, "bin", "Debug", "netcoreapp1.0");
var buildCommand = new BuildCommand(_projectFilePath);
var result = buildCommand.Execute();