Last necessary test changes

Fix the refactoring bugs

fix restore

downgrade version of package command test

Linux Test Script Fixes

use corehost instead of corerun for arg testing

don't copy corehost

fix scripts

Account for change in publish path, use corerun. Issue with AppContext.BaseDirectory in corehost.

Case Sensitive Reflector

wait for process exit

Fix bug in runtests.ps1

fix release build output path

fixup bug in runtests.sh
This commit is contained in:
Bryan 2016-01-22 16:31:35 -08:00 committed by Bryan Thornbury
parent cd9e5e2f08
commit 4c41c9699c
10 changed files with 32 additions and 27 deletions

View file

@ -8,23 +8,24 @@
$TestPackagesPath = "$RepoRoot\tests\packages"
$ArgTestRoot = "$RepoRoot\test\ArgumentForwardingTests"
$ArgTestBinRoot = "$RepoRoot\artifacts\tests\arg-forwarding"
$ArgTestOutputRoot = "$RepoRoot\artifacts\tests\arg-forwarding"
$ArgTestBin = "$ArgTestOutputRoot\$Configuration\dnxcore50"
dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$ArgTestBinRoot" --configuration "$Configuration" "$ArgTestRoot\Reflector"
dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$ArgTestOutputRoot" --configuration "$Configuration" "$ArgTestRoot\Reflector"
if (!$?) {
Write-Host Command failed: dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$ArgTestBinRoot" --configuration "$Configuration" "$ArgTestRoot\Reflector"
Write-Host Command failed: dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$ArgTestOutputRoot" --configuration "$Configuration" "$ArgTestRoot\Reflector"
Exit 1
}
dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$ArgTestBinRoot" --configuration "$Configuration" "$ArgTestRoot\ArgumentForwardingTests"
dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$ArgTestOutputRoot" --configuration "$Configuration" "$ArgTestRoot\ArgumentForwardingTests"
if (!$?) {
Write-Host Command failed: dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$ArgTestBinRoot" --configuration "$Configuration" "$ArgTestRoot\ArgumentForwardingTests"
Write-Host Command failed: dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$ArgTestOutputRoot" --configuration "$Configuration" "$ArgTestRoot\ArgumentForwardingTests"
Exit 1
}
cp "$ArgTestRoot\Reflector\reflector_cmd.cmd" "$ArgTestBinRoot"
cp "$ArgTestRoot\Reflector\reflector_cmd.cmd" "$ArgTestBin"
pushd $ArgTestBinRoot
pushd "$ArgTestBin"
& ".\corerun" "xunit.console.netcore.exe" "ArgumentForwardingTests.dll" -xml "$_-testResults.xml" -notrait category=failing
$exitCode = $LastExitCode

17
scripts/test/argument-forwarding-tests.sh Normal file → Executable file
View file

@ -17,14 +17,15 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
source "$DIR/../common/_common.sh"
ArgTestRoot = "$REPOROOT/test/ArgumentForwardingTests"
ArgTestBinRoot="$REPOROOT/artifacts/tests/arg-forwarding"
ArgTestRoot="$REPOROOT/test/ArgumentForwardingTests"
ArgTestOutputRoot="$REPOROOT/artifacts/tests/arg-forwarding"
ArgTestBin="$ArgTestOutputRoot/$CONFIGURATION/dnxcore50"
dotnet publish --framework "dnxcore50" --runtime "$RID" --output "$ArgTestBinRoot" --configuration "$CONFIGURATION" "$ArgTestRoot/Reflector"
dotnet publish --framework "dnxcore50" --runtime "$RID" --output "$ArgTestBinRoot" --configuration "$CONFIGURATION" "$ArgTestRoot/ArgumentForwardingTests"
dotnet publish --framework "dnxcore50" --runtime "$RID" --output "$ArgTestOutputRoot" --configuration "$CONFIGURATION" "$ArgTestRoot/Reflector"
dotnet publish --framework "dnxcore50" --runtime "$RID" --output "$ArgTestOutputRoot" --configuration "$CONFIGURATION" "$ArgTestRoot/ArgumentForwardingTests"
cp "$ArgTestRoot/Reflector/reflector_cmd.cmd" "$ArgTestBinRoot"
pushd $TestBinRoot
./corerun "xunit.console.netcore.exe" "ArgumentForwardingTests.dll" -xml "ArgumentForwardingTests-testResults.xml" -notrait category=failing
popd
pushd "$ArgTestBin"
./corerun "xunit.console.netcore.exe" "ArgumentForwardingTests.dll" -xml "ArgumentForwardingTests-testResults.xml" -notrait category=failing
popd

View file

@ -74,9 +74,8 @@ $TestScripts | ForEach-Object {
$exitCode = $LastExitCode
if ($exitCode -ne 0) {
$failingTests += "$_"
$failCount += 1
}
$failCount += 1
}
if ($failCount -ne 0) {

View file

@ -67,9 +67,9 @@ for script in ${TestScripts[@]}
do
"$REPOROOT/scripts/test/$script"
exitCode=$?
failCount+=1
if [ $exitCode -ne 0 ]; then
failedTests+=($script)
failCount+=1
fi
done

View file

@ -34,7 +34,7 @@ namespace Microsoft.DotNet.Cli.Utils
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
public static string EscapeAndConcatenateArgArrayForCmd(IEnumerable<string> args)
public static string EscapeAndConcatenateArgArrayForCmdProcessStart(IEnumerable<string> args)
{
return string.Join(" ", EscapeArgArrayForCmd(args));
}

View file

@ -47,7 +47,7 @@ namespace Microsoft.DotNet.Cli.Utils
}
else
{
var escapedArgs = ArgumentEscaper.EscapeAndConcatenateArgArray(args);
var escapedArgs = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(args);
return new CommandSpec(commandName, escapedArgs, CommandResolutionStrategy.Path);
}
@ -198,7 +198,7 @@ namespace Microsoft.DotNet.Cli.Utils
}
else
{
var escapedArgs = ArgumentEscaper.EscapeAndConcatenateArgArray(args);
var escapedArgs = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(args);
return new CommandSpec(fileName, escapedArgs, CommandResolutionStrategy.NugetPackage);
}
@ -240,7 +240,7 @@ namespace Microsoft.DotNet.Cli.Utils
}
else
{
var escapedArgs = ArgumentEscaper.EscapeAndConcatenateArgArray(args);
var escapedArgs = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(args);
return new CommandSpec(commandPath, escapedArgs, resolutionStrategy);
}
}

View file

@ -18,7 +18,7 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
{
public class ArgumentForwardingTests : TestBase
{
private static readonly string s_reflectorExeName = "reflector" + Constants.ExeSuffix;
private static readonly string s_reflectorExeName = "Reflector" + Constants.ExeSuffix;
private static readonly string s_reflectorCmdName = "reflector_cmd";
private string ReflectorPath { get; set; }
@ -106,6 +106,11 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
[InlineData(@"a\""b \\ cd ""\e f\"" \\""\\\")]
public void TestArgumentForwardingCmd(string testUserArgument)
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}
// Get Baseline Argument Evaluation via Reflector
// This does not need to be different for cmd because
// it only establishes what the string[] args should be
@ -247,6 +252,7 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
};
proc.Start();
proc.WaitForExit();
var stdOut = proc.StandardOutput.ReadToEnd();
Assert.Equal(0, proc.ExitCode);

View file

@ -2,9 +2,6 @@
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.0.0-rc2-23704",
"Microsoft.NETCore.TestHost" : "1.0.0-*",
"NETStandard.Library": "1.0.0-rc2-23704",
"Microsoft.NETCore.TestHost" : "1.0.0-rc2-23704",

View file

@ -175,6 +175,7 @@ namespace Microsoft.DotNet.Tools.Publish.Tests
}
[Fact]
[ActiveIssue(982)]
public void PublishScriptsRun()
{
// create unique directories in the 'temp' folder

View file

@ -5,7 +5,7 @@
},
"dependencies": {
"NETStandard.Library": "1.0.0-rc2-23714"
"NETStandard.Library": "1.0.0-rc2-23704"
},
"frameworks": {