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
|
@ -155,6 +155,35 @@ namespace Microsoft.DotNet.Tools.Run.Tests
|
|||
"arg: [two]"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItHandlesUnrestoredProjectFileCorrectly()
|
||||
{
|
||||
// NOTE: we don't say "WithLockFiles", so the project is "unrestored"
|
||||
TestInstance instance = TestAssetsManager.CreateTestInstance("TestAppSimple");
|
||||
|
||||
new RunCommand(instance.TestRoot)
|
||||
.ExecuteWithCapturedOutput()
|
||||
.Should()
|
||||
.Fail()
|
||||
.And
|
||||
.HaveStdErrContaining("NU1009")
|
||||
.And
|
||||
.HaveStdErrContaining("dotnet restore");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItHandlesUnknownProjectFileCorrectly()
|
||||
{
|
||||
new RunCommand("bad path")
|
||||
.ExecuteWithCapturedOutput()
|
||||
.Should()
|
||||
.Fail()
|
||||
.And
|
||||
.HaveStdErrContaining("DOTNET1017")
|
||||
.And
|
||||
.HaveStdErrContaining("bad path");
|
||||
}
|
||||
|
||||
private static string JoinWithNewlines(params string[] values)
|
||||
{
|
||||
return string.Join(Environment.NewLine, values);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue