Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<SystemTextJsonVersion Condition="'$(SystemTextJsonVersion)' == ''">8.0.5</SystemTextJsonVersion>
<SystemCommandLineVersion Condition="'$(SystemCommandLineVersion)' == ''">2.0.0-beta7.25374.102</SystemCommandLineVersion>
<MSTestPackageVersion>3.4.3</MSTestPackageVersion>
<xunitv3PackageVersion>3.2.2</xunitv3PackageVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -73,7 +74,7 @@
<PackageVersion Include="Microsoft.VisualStudio.Extensibility.Sdk" Version="17.14.40177" />
<PackageVersion Include="Microsoft.VisualStudio.Extensibility.Build" Version=" 17.14.40177" />
<PackageVersion Include="Microsoft.VisualStudio.SDK" Version="18.0.2345-preview.1" />
<PackageVersion Include="Microsoft.VisualStudio.Sdk.TestFramework.Xunit" Version="17.11.8" />
<PackageVersion Include="Microsoft.VisualStudio.Sdk.TestFramework.Xunit.v3" Version="17.11.66" />
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.4.2244" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.Styles" Version="18.0.2345-preview.1" />
<PackageVersion Include="Microsoft.VisualStudio.TemplateWizardInterface" Version="17.10.40170" />
Expand Down Expand Up @@ -104,9 +105,11 @@
-->
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="4.9.0" />
<PackageVersion Include="VsWebSite.Interop" Version="17.10.40173" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.v3" Version="$(xunitv3PackageVersion)" />
<PackageVersion Include="xunit.v3.assert" Version="$(xunitv3PackageVersion)" />
<PackageVersion Include="xunit.v3.extensibility.core" Version="$(xunitv3PackageVersion)" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="Xunit.StaFact" Version="1.1.11" />
<PackageVersion Include="Xunit.StaFact" Version="3.0.13" />
</ItemGroup>

<!--
Expand Down
5 changes: 3 additions & 2 deletions build/test.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
<!-- Shared test project template -->

<PropertyGroup>
<NoWarn>$(NoWarn);CS1701;xUnit1012;xUnit1014;xUnit2000;xUnit2009;xUnit2013</NoWarn>
<OutputType>Exe</OutputType>
<NoWarn>$(NoWarn);CS1701;xUnit1012;xUnit1014;xUnit1051;xUnit2000;xUnit2009;xUnit2013;xUnit2031</NoWarn>
<WarningsAsErrors>$(WarningsAsErrors);xUnit2024</WarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.v3" />
<PackageReference Include="Moq" />
<PackageReference Include="AwesomeAssertions" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using NuGet.Common;
using NuGet.Test.Utility;
using Xunit;
using Xunit.Abstractions;

namespace NuGet.CommandLine.FuncTest
{
Expand Down Expand Up @@ -73,7 +72,7 @@ public void Run_CanGetExitCode()
fileName,
arguments: args,
timeOutInMilliseconds: 10000,
testOutputHelper: _testOutputHelper);
logLine: _testOutputHelper.WriteLine);

result.ExitCode.Should().Be(16);
}
Expand Down Expand Up @@ -103,7 +102,7 @@ public void Run_CanWriteToStandardInput()
writer.WriteLine("echo Hello & exit 0");
},
timeOutInMilliseconds: 5000,
testOutputHelper: _testOutputHelper);
logLine: _testOutputHelper.WriteLine);

result.Output.Should().Contain("Hello");
}
Expand Down Expand Up @@ -154,7 +153,7 @@ public void Run_DoesNotHangWhenReadingLargeStdout(int outputSizeInKilobytes)
fileName,
Directory.GetCurrentDirectory(),
args,
testOutputHelper: _testOutputHelper);
logLine: _testOutputHelper.WriteLine);

// Assert
Assert.Equal(0, result.ExitCode);
Expand Down Expand Up @@ -193,7 +192,7 @@ public void Run_TimesOut()

Stopwatch stopwatch = Stopwatch.StartNew();

new Action(() => CommandRunner.Run(fileName, arguments: args, timeOutInMilliseconds: 1000, testOutputHelper: _testOutputHelper, timeoutRetryCount: 0))
new Action(() => CommandRunner.Run(fileName, arguments: args, timeOutInMilliseconds: 1000, logLine: _testOutputHelper.WriteLine, timeoutRetryCount: 0))
.Should().Throw<TimeoutException>();

stopwatch.Stop();
Expand Down Expand Up @@ -224,7 +223,7 @@ private void VerifyWithCommandRunner()
fileName,
Directory.GetCurrentDirectory(),
args,
testOutputHelper: _testOutputHelper);
logLine: _testOutputHelper.WriteLine);

// Assert
Assert.Equal(0, result.ExitCode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using NuGet.Test.Utility;
using Test.Utility.Signing;
using Xunit;
using Xunit.Abstractions;

namespace NuGet.CommandLine.FuncTest.Commands
{
Expand Down Expand Up @@ -249,7 +248,7 @@ public CommandRunnerResult RunInstall(string nugetExe, SimpleTestPathContext pat
pathContext.WorkingDirectory,
string.Join(" ", args),
environmentVariables: envVars,
testOutputHelper: _testOutputHelper);
logLine: _testOutputHelper.WriteLine);

// Assert
Assert.True(expectedExitCode == r.ExitCode, r.AllOutput);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using NuGet.Test.Utility;
using Test.Utility;
using Xunit;
using Xunit.Abstractions;

namespace NuGet.CommandLine.FuncTest.Commands
{
Expand Down Expand Up @@ -73,7 +72,7 @@ public void PushCommand_AllowsTimeoutToBeSpecifiedHigherThan100Seconds()
pathContext.WorkingDirectory,
$"push {sourcePath} -Source {server.Uri}push -Timeout 110",
timeOutInMilliseconds: 120 * 1000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert
Assert.True(result.Success, $"{result.Output} {result.Errors}");
Expand Down Expand Up @@ -117,7 +116,7 @@ public void PushCommand_AllowsTimeoutToBeSpecifiedLowerThan100Seconds()
pathContext.WorkingDirectory,
$"push {sourcePath} -Source {server.Uri}push -Timeout 1",
timeOutInMilliseconds: 20 * 1000,
testOutputHelper: _testOutputHelper); // 20 seconds
logLine: _testOutputHelper.WriteLine); // 20 seconds
}

// Assert
Expand Down Expand Up @@ -158,22 +157,22 @@ public void PushCommand_Server_SkipDuplicate_NotSpecified_PushHalts()
pathContext.WorkingDirectory,
$"push {sourcePath} -Source {server.Uri}push -Timeout 110",
timeOutInMilliseconds: 120 * 1000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds

//Run again so that it will be a duplicate push.
result2 = CommandRunner.Run(
nuget,
pathContext.WorkingDirectory,
$"push {sourcePath} -Source {server.Uri}push -Timeout 110",
timeOutInMilliseconds: 120 * 1000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds

result3 = CommandRunner.Run(
nuget,
pathContext.WorkingDirectory,
$"push {sourcePath2} -Source {server.Uri}push -Timeout 110",
timeOutInMilliseconds: 120 * 1000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

// Assert
Expand Down Expand Up @@ -224,23 +223,23 @@ public void PushCommand_Server_SkipDuplicate_IsSpecified_PushProceeds()
pathContext.WorkingDirectory,
$"push {sourcePath} -Source {server.Uri}push -Timeout 110 -SkipDuplicate",
timeOutInMilliseconds: 120 * 1000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds

//Run again so that it will be a duplicate push but use the option to skip duplicate packages.
result2 = CommandRunner.Run(
nuget,
pathContext.WorkingDirectory,
$"push {sourcePath} -Source {server.Uri}push -Timeout 110 -SkipDuplicate",
timeOutInMilliseconds: 120 * 1000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds

//Third run with a different package.
result3 = CommandRunner.Run(
nuget,
pathContext.WorkingDirectory,
$"push {sourcePath2} -Source {server.Uri}push -Timeout 110 -SkipDuplicate",
timeOutInMilliseconds: 120 * 1000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

// Assert
Expand Down Expand Up @@ -287,7 +286,7 @@ public void PushCommand_Server_Snupkg_ByFilename_DoesNotExist_FileNotFoundError(
pathContext.WorkingDirectory,
$"push {snupkgToPush} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

// Assert
Expand Down Expand Up @@ -324,7 +323,7 @@ public void PushCommand_Server_Snupkg_ByWildcard_FindsNothing_FileNotFoundError(
pathContext.WorkingDirectory,
$"push {snupkgToPush} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

//Assert
Expand Down Expand Up @@ -359,7 +358,7 @@ public void PushCommand_Server_Nupkg_ByFilename_FindsNothing_FileNotFoundError()
pathContext.WorkingDirectory,
$"push {nupkgToPush} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

//Assert
Expand Down Expand Up @@ -394,7 +393,7 @@ public void PushCommand_Server_Nupkg_ByWildcard_FindsNothing_FileNotFoundError()
pathContext.WorkingDirectory,
$"push {nupkgToPush} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

//Assert
Expand Down Expand Up @@ -438,7 +437,7 @@ public void PushCommand_Server_Nupkg_ByFilename_SnupkgDoesNotExist_NoFileNotFoun
pathContext.WorkingDirectory,
$"push {nupkgFullPath} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

// Assert
Expand Down Expand Up @@ -479,7 +478,7 @@ public void PushCommand_Server_Nupkg_ByWildcard_SnupkgDoesNotExist_NoFileNotFoun
pathContext.WorkingDirectory,
$"push {pushArgument} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

// Assert
Expand Down Expand Up @@ -531,15 +530,15 @@ public void PushCommand_Server_Nupkg_ByFilename_SnupkgExists_Conflict()
pathContext.WorkingDirectory,
$"push {nupkgFullPath} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds

//Second run with SkipDuplicate
result2 = CommandRunner.Run(
nuget,
pathContext.WorkingDirectory,
$"push {nupkgFullPath} -Source {sourceName} -Timeout 110 -SkipDuplicate",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

// Assert
Expand Down Expand Up @@ -599,7 +598,7 @@ public void PushCommand_Server_Nupkg_ByWildcard_NupkgAndSnupkgPushed()
pathContext.WorkingDirectory,
$"push {wildcardPush} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

// Assert
Expand Down Expand Up @@ -655,7 +654,7 @@ public void PushCommand_Server_Nupkg_ByWildcard_SeparateSymbolUrl_NupkgAndSnupkg
pathContext.WorkingDirectory,
$"push {wildcardPush} -Source {sourceName} -SymbolSource {symbolSourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

// Assert
Expand Down Expand Up @@ -711,7 +710,7 @@ public void PushCommand_Server_Nupkg_SeparateSymbolUrl_NoSymbolTrue_SnupkgNotPus
pathContext.WorkingDirectory,
$"push {wildcardPush} -Source {sourceName} -SymbolSource {symbolPushUrl} -noSymbol -Timeout 110",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

// Assert
Expand Down Expand Up @@ -766,7 +765,7 @@ public void PushCommand_Server_Nupkg_ByWildcard_FindsMatchingSnupkgs_Conflict()
pathContext.WorkingDirectory,
$"push {wildcardPush} -Source {sourceName} -SymbolSource {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

// Assert
Expand Down Expand Up @@ -830,7 +829,7 @@ public void PushCommand_Server_Nupkg_ByWildcard_FindsMatchingSnupkgs_SkipDuplica
pathContext.WorkingDirectory,
$"push {wildcardPush} -Source {sourceName} -Timeout 110 -SkipDuplicate",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

// Assert
Expand Down Expand Up @@ -890,7 +889,7 @@ public void PushCommand_Server_Snupkg_ByWildcard_FindsMatchingSnupkgs_Conflict()
pathContext.WorkingDirectory,
$"push {wildcardPush} -Source {sourceName} -Timeout 110",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

// Assert
Expand Down Expand Up @@ -953,7 +952,7 @@ public void PushCommand_Server_Snupkg_ByWildcard_FindsMatchingSnupkgs_SkipDuplic
pathContext.WorkingDirectory,
$"push {wildcardPush} -Source {sourceName} -Timeout 110 -SkipDuplicate",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}
// Assert

Expand Down Expand Up @@ -1006,14 +1005,14 @@ public void PushCommand_Server_Snupkg_ByFilename_SnupkgExists_Conflict_ServerMes
pathContext.WorkingDirectory,
$"push {snupkgFileName} -Source {sourceName} -Timeout 110 -Verbosity detailed",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds

result2 = CommandRunner.Run(
nuget,
pathContext.WorkingDirectory,
$"push {snupkgFileName} -Source {sourceName} -Timeout 110 -SkipDuplicate -Verbosity detailed",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds
}

// Assert
Expand Down Expand Up @@ -1045,7 +1044,7 @@ public void PushCommand_WhenPushingToAnHttpServerV3_WithSymbols_Errors()
packageDirectory,
$"push {snupkgFileName} -Source {sourceName} -Timeout 110 -Verbosity detailed",
timeOutInMilliseconds: 120000,
testOutputHelper: _testOutputHelper); // 120 seconds
logLine: _testOutputHelper.WriteLine); // 120 seconds

// Assert
Assert.False(result.Success, result.AllOutput);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
using NuGet.Test.Utility;
using Test.Utility.Signing;
using Xunit;
using Xunit.Abstractions;

namespace NuGet.CommandLine.FuncTest.Commands
{
Expand Down Expand Up @@ -435,7 +434,7 @@ public CommandRunnerResult RunRestore(string nugetExe, SimpleTestPathContext pat
pathContext.WorkingDirectory,
string.Join(" ", args),
environmentVariables: envVars,
testOutputHelper: _testOutputHelper);
logLine: _testOutputHelper.WriteLine);

// Assert
Assert.True(expectedExitCode == r.ExitCode, r.AllOutput);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
using NuGet.Versioning;
using Test.Utility;
using Xunit;
using Xunit.Abstractions;

namespace NuGet.CommandLine.FuncTest.Commands
{
Expand Down Expand Up @@ -987,7 +986,7 @@ public CommandRunnerResult RunRestore(SimpleTestPathContext pathContext, int exp
pathContext.WorkingDirectory.Path,
string.Join(" ", args),
environmentVariables: envVars,
testOutputHelper: _testOutputHelper);
logLine: _testOutputHelper.WriteLine);

// Assert
Assert.True(expectedExitCode == r.ExitCode, r.AllOutput);
Expand Down
Loading
Loading