Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
28 changes: 17 additions & 11 deletions src/CLU/CLUCoreCLR.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Commands.Common", "Commands.Common\Commands.Common.xproj", "{5F567ACA-595E-436D-83DB-A21E08F82DF6}"
EndProject
Expand Down Expand Up @@ -37,7 +37,13 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.CLU.Run", "Micros
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.CLU", "Microsoft.CLU\Microsoft.CLU.xproj", "{D0A59671-088D-463B-B060-2ADAFFB9C3F6}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.CLU.Test", "Microsoft.CLU.Test\Microsoft.CLU.Test.xproj", "{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Commands.Compute", "Microsoft.Azure.Commands.Compute\Microsoft.Azure.Commands.Compute.xproj", "{04F9968A-5662-4508-BEE2-31F56848FCBA}"
ProjectSection(ProjectDependencies) = postProject
{99B1290D-A073-4907-8018-51C714431778} = {99B1290D-A073-4907-8018-51C714431778}
{3910613E-4ED2-49E2-8CCF-966D586665AC} = {3910613E-4ED2-49E2-8CCF-966D586665AC}
{81A48E48-89A7-4B93-8207-4F8FA6DC251B} = {81A48E48-89A7-4B93-8207-4F8FA6DC251B}
{45B05B68-516F-4D74-897F-56D12894946C} = {45B05B68-516F-4D74-897F-56D12894946C}
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Commands.Common.ScenarioTest", "Commands.Common.ScenarioTest\Commands.Common.ScenarioTest.xproj", "{B1D3CB1F-C0CA-401F-8146-B2E9C1EF460F}"
EndProject
Expand All @@ -49,7 +55,7 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Commands.Co
{04F9968A-5662-4508-BEE2-31F56848FCBA} = {04F9968A-5662-4508-BEE2-31F56848FCBA}
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Commands.Compute", "Microsoft.Azure.Commands.Compute\Microsoft.Azure.Commands.Compute.xproj", "{04F9968A-5662-4508-BEE2-31F56848FCBA}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.ScenarioTest.CLU", "Microsoft.ScenarioTests.CLU\Microsoft.ScenarioTest.CLU.xproj", "{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -125,10 +131,10 @@ Global
{D0A59671-088D-463B-B060-2ADAFFB9C3F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D0A59671-088D-463B-B060-2ADAFFB9C3F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D0A59671-088D-463B-B060-2ADAFFB9C3F6}.Release|Any CPU.Build.0 = Release|Any CPU
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Release|Any CPU.Build.0 = Release|Any CPU
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Release|Any CPU.Build.0 = Release|Any CPU
{B1D3CB1F-C0CA-401F-8146-B2E9C1EF460F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B1D3CB1F-C0CA-401F-8146-B2E9C1EF460F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B1D3CB1F-C0CA-401F-8146-B2E9C1EF460F}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -137,10 +143,10 @@ Global
{13C34370-51A4-4726-81B8-BE0996FC9CFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13C34370-51A4-4726-81B8-BE0996FC9CFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13C34370-51A4-4726-81B8-BE0996FC9CFF}.Release|Any CPU.Build.0 = Release|Any CPU
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Release|Any CPU.Build.0 = Release|Any CPU
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion src/CLU/Microsoft.CLU.Run/PackageManagementMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ private static void GenerateScript(string cfgPath)
" export CmdletSessionID=$PPID",
"fi",
"SCRIPTPATH=$(dirname \"$0\")",
$"$SCRIPTPATH/clurun -s {scriptName} -r $SCRIPTPATH/{Path.GetFileName(cfgPath)} $*"
$"$SCRIPTPATH/clurun -s {scriptName} -r $SCRIPTPATH/{Path.GetFileName(cfgPath)} \"$@\""
});
System.Diagnostics.Process.Start("chmod", $"777 {scriptPath}");
}
Expand Down
4 changes: 0 additions & 4 deletions src/CLU/Microsoft.CLU.Test/Content/package.cfg

This file was deleted.

30 changes: 0 additions & 30 deletions src/CLU/Microsoft.CLU.Test/TestCLU.bat

This file was deleted.

4 changes: 4 additions & 0 deletions src/CLU/Microsoft.ScenarioTests.CLU/Content/package.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Name: Microsoft.ScenarioTests.CLU
CommandAssemblies: Microsoft.ScenarioTests.CLU.dll
NounPrefix: Test
NounFirst: true
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
RtPackage: Microsoft.CLU.Commands
RtEntry: Microsoft.CLU.CommandModel.CmdletCommandModel.Run
RtAssembly: Microsoft.CLU.dll
Modules: Microsoft.CLU.Test
NounPrefix: AzureRm
Modules: Microsoft.ScenarioTests.CLU
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>Microsoft.CLU.Test</id>
<id>Microsoft.ScenarioTests.CLU</id>
<title>Microsoft CLU CommandLine test command packge</title>
<version>%PackageVersion%</version>
<authors>Microsoft</authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,18 @@ protected override void ProcessRecord()
WriteObject(new TestRecord() { Name = $"Matched {RecordName}", Value = $"Matched {Value}", SomethingElse = $"Matched {SomethingElse}" });
}
}

[Cmdlet(VerbsCommon.Show, "TestRecordFromParameter")]
public class ShowTestRecordFromParameter : PSCmdlet
{

[Parameter(Mandatory = true, ValueFromPipeline = true)]
[Alias("Rec")]
public TestRecord Record { get; set; }

protected override void ProcessRecord()
{
WriteObject(Record);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.CLU.Test")]
[assembly: AssemblyTitle("Microsoft.ScenarioTests.CLU")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Microsoft.CLU.Test")]
[assembly: AssemblyProduct("Microsoft.ScenarioTests.CLU")]
[assembly: AssemblyCopyright("Copyright © Microsoft")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand Down
33 changes: 33 additions & 0 deletions src/CLU/Microsoft.ScenarioTests.CLU/out.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
SETLOCAL EnableExtensions

ECHO Test return code success case
call testclu success show 2> out.error
REM We expect that the commands above succeed (return 0)
IF %ERRORLEVEL% NEQ 0 (
ECHO "Expected error level 0 for success, got " %ERRORLEVEL%
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you want to dump out the out.err?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I actually, don’t ☺

From: Yugang Wang [mailto:[email protected]]
Sent: Thursday, December 17, 2015 4:20 PM
To: Azure/azure-powershell [email protected]
Cc: Johan Stenberg [email protected]
Subject: Re: [azure-powershell] Update tests + escape paramters passed to clurun by (bash) wrapper script (#1519)

In src/CLU/Microsoft.ScenarioTests.CLU/out.txthttps://github.com//pull/1519#discussion_r47980704:

@@ -0,0 +1,33 @@

+SETLOCAL EnableExtensions

+ECHO Test return code success case

+call testclu success show 2> out.error

+REM We expect that the commands above succeed (return 0)

+IF %ERRORLEVEL% NEQ 0 (

  • ECHO "Expected error level 0 for success, got " %ERRORLEVEL%
    

you want to dump out the out.err?


Reply to this email directly or view it on GitHubhttps://github.com//pull/1519/files#r47980704.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is fine. To me it would be normal to swallow the stdout but still let stderr surface to the console, but it is your call.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally, I’d agree. However, these tests are verifying that the CLU behaves correctly if there is an error. Thus, the info written to stderr by the cmdlet is not of interest to us and would only pollute the log.

From: Yugang Wang [mailto:[email protected]]
Sent: Thursday, December 17, 2015 4:45 PM
To: Azure/azure-powershell [email protected]
Cc: Johan Stenberg [email protected]
Subject: Re: [azure-powershell] Update tests + escape paramters passed to clurun by (bash) wrapper script (#1519)

In src/CLU/Microsoft.ScenarioTests.CLU/out.txthttps://github.com//pull/1519#discussion_r47982357:

@@ -0,0 +1,33 @@

+SETLOCAL EnableExtensions

+ECHO Test return code success case

+call testclu success show 2> out.error

+REM We expect that the commands above succeed (return 0)

+IF %ERRORLEVEL% NEQ 0 (

  • ECHO "Expected error level 0 for success, got " %ERRORLEVEL%
    

That is fine. To me it would be normal to swallow the stdout but still let stderr surface to the console, but it is your call.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1519/files#r47982357.

EXIT /B 1
)

ECHO Test return codes non terminating error case
call testclu success show --generatenonterminatingerror true 2> out.error
IF %ERRORLEVEL% NEQ 1 (
ECHO "Expected error level 1 for non-terminating error, got " %ERRORLEVEL%
EXIT /B 1
)

ECHO Test return codes terminating error case
call testclu success show --generateterminatingerror true 2> out.error
IF %ERRORLEVEL% NEQ 2 (
ECHO "Expected error level 2 for terminating error, got " %ERRORLEVEL%
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tab is also not right in this file

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ick. That file shouldn’t have been included. Removed.

From: Yugang Wang [mailto:[email protected]]
Sent: Thursday, December 17, 2015 4:42 PM
To: Azure/azure-powershell [email protected]
Cc: Johan Stenberg [email protected]
Subject: Re: [azure-powershell] Update tests + escape paramters passed to clurun by (bash) wrapper script (#1519)

In src/CLU/Microsoft.ScenarioTests.CLU/out.txthttps://github.com//pull/1519#discussion_r47982181:

+IF %ERRORLEVEL% NEQ 0 (

  • ECHO "Expected error level 0 for success, got " %ERRORLEVEL%
    
  • EXIT /B 1
    

+)

+ECHO Test return codes non terminating error case

+call testclu success show --generatenonterminatingerror true 2> out.error

+IF %ERRORLEVEL% NEQ 1 (

  • ECHO "Expected error level 1 for non-terminating error, got " %ERRORLEVEL%
    
  • EXIT /B 1
    

+)

+ECHO Test return codes terminating error case

+call testclu success show --generateterminatingerror true 2> out.error

+IF %ERRORLEVEL% NEQ 2 (

  • ECHO "Expected error level 2 for terminating error, got " %ERRORLEVEL%
    

the tab is also not right in this file


Reply to this email directly or view it on GitHubhttps://github.com//pull/1519/files#r47982181.

EXIT /B 1
)

ECHO Test pipeline aliasing
call testclu test record new | testclu test record show > out.txt
IF %ERRORLEVEL% NEQ 0 (
ECHO "Expected error level 0 for success, got " %ERRORLEVEL%
EXIT /B 1
)


ECHO ALL TESTS ARE HAPPY
33 changes: 33 additions & 0 deletions src/CLU/Microsoft.ScenarioTests.CLU/testrunner.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
SETLOCAL EnableExtensions

ECHO Test return code success case
call testclu success show 2> out.error
REM We expect that the commands above succeed (return 0)
IF %ERRORLEVEL% NEQ 0 (
ECHO "Expected error level 0 for success, got " %ERRORLEVEL%
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should tab be 4 spaces?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

From: Yugang Wang [mailto:[email protected]]
Sent: Thursday, December 17, 2015 4:18 PM
To: Azure/azure-powershell [email protected]
Cc: Johan Stenberg [email protected]
Subject: Re: [azure-powershell] Update tests + escape paramters passed to clurun by (bash) wrapper script (#1519)

In src/CLU/Microsoft.ScenarioTests.CLU/testrunner.bathttps://github.com//pull/1519#discussion_r47980597:

@@ -0,0 +1,33 @@

+SETLOCAL EnableExtensions

+ECHO Test return code success case

+call testclu success show 2> out.error

+REM We expect that the commands above succeed (return 0)

+IF %ERRORLEVEL% NEQ 0 (

  • ECHO "Expected error level 0 for success, got " %ERRORLEVEL%
    

should tab be 4 spaces?


Reply to this email directly or view it on GitHubhttps://github.com//pull/1519/files#r47980597.

EXIT /B 1
)

ECHO Test return codes non terminating error case
call testclu success show --generatenonterminatingerror true 2> out.error
IF %ERRORLEVEL% NEQ 1 (
ECHO "Expected error level 1 for non-terminating error, got " %ERRORLEVEL%
EXIT /B 1
)

ECHO Test return codes terminating error case
call testclu success show --generateterminatingerror true 2> out.error
IF %ERRORLEVEL% NEQ 2 (
ECHO "Expected error level 2 for terminating error, got " %ERRORLEVEL%
EXIT /B 1
)

ECHO Test pipeline aliasing
call testclu record new | testclu record show > out.txt
IF %ERRORLEVEL% NEQ 0 (
ECHO "Expected error level 0 for success, got " %ERRORLEVEL%
EXIT /B 1
)


ECHO ALL TESTS ARE HAPPY
14 changes: 7 additions & 7 deletions tools/CLU/BuildPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

if (!(Test-Path $cmdletsDir))
{
throw "cmdletsDir: '$cmdletsDir' must be an existing directory containing cmdlet code"
throw "cmdletsDir: '$cmdletsDir' must be an existing directory containing cmdlet code"
}
if (!(Test-Path $outputDir))
{
throw "outputDir: '$outputDir' must be an existing directory"
throw "outputDir: '$outputDir' must be an existing directory"
}

if ([string]::IsNullOrWhiteSpace($env:WORKSPACE) -or !(Test-Path $env:WORKSPACE))
{
throw "env:WORKSPACE: '$env:WORKSPACE' must be an existing directory"
throw "env:WORKSPACE: '$env:WORKSPACE' must be an existing directory"
}

$packageSource = $packageSource.TrimEnd('\\')
Expand All @@ -34,19 +34,19 @@ $contentFileText = ""
$contentFiles | %{ $contentFileText += (" <file src=""" + $_.Name + """ target=""content""/>`r`n")}
if ($packageId -ne "Microsoft.CLU.Commands")
{
$contentFileText += " <file src=""content\azure.lx"" target=""content""/>`r`n"
$contentFileText += " <file src=""content\*.lx"" target=""content""/>`r`n"
}
if ($renameFileExists)
{
$contentFileText += " <file src=""content\rename.cfg"" target=""content""/>`r`n"
$contentFileText += " <file src=""content\rename.cfg"" target=""content""/>`r`n"
}
$contentFileText += " <file src=""content\package.cfg"" target=""content""/>`r`n"
$sourceFileText = ""
$refFiles | %{$sourceFileText += (" <file src=""" + $_.Name + """ target=""lib\dnxcore50""/>`r`n")}
$outputContent = $fileContent -replace "%PackageVersion%", $packageVersion
$outputContent = $outputContent -replace "%ReferenceFiles%", $refFileText
$outputContent = $outputContent -replace "%SourceFiles%", $sourceFileText
$outputContent = $outputContent -replace "%ContentFiles%", $contentFileText
$outputContent = $outputContent -replace "%SourceFiles%", $sourceFileText
$outputContent = $outputContent -replace "%ContentFiles%", $contentFileText
Set-Content -Value $outputContent -Path $nuspecOutput

Write-Host "Creating nuget package..."
Expand Down