dotnet test and publish failing badly when the project isn't restored.
Fixing this by checking for diagnostic errors before continuing. Fix #2692 Fix #2942
This commit is contained in:
parent
0336f6bb34
commit
652d0541ef
18 changed files with 168 additions and 42 deletions
29
test/dotnet-test.Tests/GivenThatWeWantToRunTests.cs
Normal file
29
test/dotnet-test.Tests/GivenThatWeWantToRunTests.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
// 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.IO;
|
||||
using Microsoft.DotNet.TestFramework;
|
||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.Dotnet.Tools.Test.Tests
|
||||
{
|
||||
public class GivenThatWeWantToRunTests : TestBase
|
||||
{
|
||||
[Fact]
|
||||
public void It_fails_correctly_with_an_unrestored_project()
|
||||
{
|
||||
// NOTE: we don't say "WithLockFiles", so the project is "unrestored"
|
||||
var instance = TestAssetsManager.CreateTestInstance(Path.Combine("ProjectsWithTests", "NetCoreAppOnlyProject"));
|
||||
|
||||
new DotnetTestCommand()
|
||||
.ExecuteWithCapturedOutput(instance.TestRoot)
|
||||
.Should()
|
||||
.Fail()
|
||||
.And
|
||||
.HaveStdErrContaining("NU1009")
|
||||
.And
|
||||
.HaveStdErrContaining("dotnet restore");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue