Skip to content

Commit 010aaf2

Browse files
authored
Merge pull request #5 from Azure/preview
Sync
2 parents 47b54cd + cc604cf commit 010aaf2

File tree

3,665 files changed

+465261
-4349521
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,665 files changed

+465261
-4349521
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ app.config
2626
*.userprefs
2727
*.sln.docstates
2828
.vscode
29+
*.userosscache
2930

3031
# Build results
3132
[Dd]ebug/
@@ -217,6 +218,8 @@ pingme.txt
217218
groupMapping*.json
218219
/tools/index.json
219220
/Package/index.json
221+
/tools/outputtypes.json
222+
/Package/outputtypes.json
220223

221224
*.msi
222225
*.wixpdb

AzurePowershell.Test.targets

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,32 @@
5656
</Target>
5757

5858
<Target Name="InvokeXUnit">
59-
<Message Importance="high" Text="Running XUnit tests" />
60-
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
59+
<PropertyGroup> <!-- Create the file path for the test dll (src/TestResults/<dll name>.html -->
60+
<TestName>$(XUnitTests.Split('\').Length)</TestName>
61+
<TestNamePathLength>$([MSBuild]::Subtract($(TestName), 1))</TestNamePathLength>
62+
<TestSubFileName>$(XUnitTests.Split('\')[$(TestNamePathLength)])</TestSubFileName>
63+
<TestFileName>$(TestOutputDirectory)\$(TestSubFileName).html</TestFileName>
64+
</PropertyGroup>
65+
<Message Importance="high" Text="Running XUnit tests... $(TestFileName)" />
6166

6267
<xunit
63-
Assemblies="@(XUnitTests)"
68+
Assemblies="$(XUnitTests)"
6469
AppDomains="true"
6570
ShadowCopy="false"
6671
ParallelizeTestCollections="false"
67-
ParallelizeAssemblies="true"
72+
ParallelizeAssemblies="false"
6873
IncludeTraits="AcceptanceType=CheckIn"
69-
Html="$(TestOutputDirectory)\AzurePowershellTestResults.html"
70-
MaxParallelThreads="10"
74+
Html="$(TestFileName)"
7175
DiagnosticMessages="false"
72-
ContinueOnError="false"
73-
Condition=" @(XUnitTests) != '' "/>
76+
ContinueOnError="true"
77+
Condition=" $(XUnitTests) != '' ">
78+
<Output TaskParameter="ExitCode" ItemName="XUnitExitCode"/>
79+
</xunit>
80+
81+
82+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. Move-Item -Path $(TestOutputDirectory)/$(TestSubFileName).html -Destination $(TestOutputDirectory)/PassingTests/$(TestSubFileName).html &quot;" Condition="%(XUnitExitCode.Identity) == 0"/>
83+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. Move-Item -Path $(TestOutputDirectory)/$(TestSubFileName).html -Destination $(TestOutputDirectory)/FailingTests/$(TestSubFileName).html &quot;" Condition="%(XUnitExitCode.Identity) != 0"/>
84+
7485
</Target>
7586

7687
<Target Name="InvokeXUnitAll">
@@ -82,10 +93,9 @@
8293
AppDomains="true"
8394
ShadowCopy="false"
8495
ParallelizeTestCollections="false"
85-
ParallelizeAssemblies="true"
96+
ParallelizeAssemblies="false"
8697
ExcludeTraits="RunType=LiveOnly;AcceptanceType=CheckIn"
8798
Html="$(TestOutputDirectory)\AzurePowershellAllTestResults.html"
88-
MaxParallelThreads="10"
8999
DiagnosticMessages="false"
90100
ContinueOnError="false"
91101
Condition=" @(XUnitTests) != '' "/>

ChangeLog.md

Lines changed: 288 additions & 141 deletions
Large diffs are not rendered by default.

ModuleMappings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
],
7171
"src/ResourceManager/DeviceProvisioningServices/": [
7272
"AzureRM.DeviceProvisioningServices"
73+
],
74+
"src/ResourceManager/DevSpaces/": [
75+
"AzureRM.DevSpaces"
7376
],
7477
"src/ResourceManager/DevTestLabs/": [
7578
"AzureRM.DevTestLabs"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ If there is a feature you would like to see in Azure PowerShell, please use the
156156

157157
If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](https://azure.github.io/guidelines/).
158158

159-
More information about contributing to this repo can be found in [CONTRIBUTING md](https://github.com/Azure/azure-powershell/blob/preview/CONTRIBUTING.md) and the [Azure PowerShell Developer Guide](https://github.com/Azure/azure-powershell/wiki/Azure-Powershell-Developer-Guide) folder.
159+
More information about contributing to this repo can be found in [CONTRIBUTING md](https://github.com/Azure/azure-powershell/blob/preview/CONTRIBUTING.md) and the [Azure PowerShell Developer Guide](https://github.com/Azure/azure-powershell/blob/preview/documentation/development-docs/azure-powershell-developer-guide.md) folder.
160160

161161
## Learn More
162162

TestMappings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
"src/ResourceManager/DeviceProvisioningServices/": [
7777
".\\src\\ResourceManager\\DeviceProvisioningServices\\Commands.DeviceProvisioningServices.Test\\bin\\Debug\\Microsoft.Azure.Commands.DeviceProvisioningServices.dll"
7878
],
79+
"src/ResourceManager/DevSpaces/": [
80+
".\\src\\ResourceManager\\DevSpaces\\Commands.DevSpaces.Test\\bin\\Debug\\Microsoft.Azure.Commands.DevSpaces.Test.dll"
81+
],
7982
"src/ResourceManager/DevTestLabs/": [],
8083
"src/ResourceManager/Dns/": [
8184
".\\src\\ResourceManager\\Dns\\Commands.Dns.Test\\bin\\Debug\\Microsoft.Azure.Commands.Dns.Test.dll"
@@ -143,6 +146,9 @@
143146
".\\src\\ResourceManager\\RecoveryServices\\Commands.RecoveryServices.Backup.Test\\bin\\Debug\\Microsoft.Azure.Commands.RecoveryServices.Backup.Test.dll",
144147
".\\src\\ResourceManager\\RecoveryServices\\Commands.RecoveryServices.Test\\bin\\Debug\\Microsoft.Azure.Commands.RecoveryServicesArm.Test.dll"
145148
],
149+
"src/ResourceManager/RecoveryServices.SiteRecovery/": [
150+
".\\src\\ResourceManager\\RecoveryServices.SiteRecovery\\Commands.RecoveryServices.SiteRecovery.Test\\bin\\Debug\\Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.Test.dll"
151+
],
146152
"src/ResourceManager/RedisCache/": [
147153
".\\src\\ResourceManager\\RedisCache\\Commands.RedisCache.Test\\bin\\Debug\\Microsoft.Azure.Commands.RedisCache.Test.dll"
148154
],

build.proj

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@
100100
<CmdletSolutionsToBuild Include=".\src\Stack.sln"
101101
Condition=" '$(Scope)' == 'All' or '$(Scope)' == 'Stack'"/>
102102

103+
<CommonSolution Include="$(LibrarySourceFolder)\Common\Common.sln" />
103104
<StaticAnalysis Include=".\tools\StaticAnalysis\StaticAnalysis.sln" />
104105
<LocalBuildTasks Include="$(LibraryToolsFolder)\BuildPackagesTask\Microsoft.Azure.Build.Tasks.sln" />
105-
<LocalBuildTasks Include="$(LibraryToolsFolder)\RepoTasks\RepoTasks.sln" Condition="'$(NetCore)' == 'false'"/>
106+
<LocalBuildTasks Include="$(LibraryToolsFolder)\RepoTasks\RepoTasks.sln" Condition="'$(NetCore)' == 'false'"/>
106107
</ItemGroup>
107108

108109
<!-- Tasks -->
@@ -209,16 +210,18 @@
209210
<Exec Command="$(NuGetCommand) sources add -Name LocalFeed -Source &quot;$(LocalFeedFolder)&quot; $(NuGetRestoreConfigSwitch)"/>
210211
<Exec Command="$(NuGetCommand) sources add -Name nugetRemote -Source &quot;https://api.nuget.org/v3/index.json&quot; $(NuGetRestoreConfigSwitch)"/>
211212
<!-- Restore packages -->
213+
<Exec Command="$(NuGetCommand) restore %(CommonSolution.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
214+
ContinueOnError="false" />
212215
<Exec Command="$(NuGetCommand) restore %(CmdletSolutionsToBuild.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
213216
ContinueOnError="false" />
214217
<!-- Restore packages for static analysis-->
215218
<Exec Command="$(NuGetCommand) restore %(StaticAnalysis.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
216219
ContinueOnError="false" />
217220
<!-- Restore packages for local build tasks-->
218-
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetLocalBuildTaskPackages)"
221+
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
219222
ContinueOnError="false" />
220223
<!-- Restore packages for repo tasks tasks-->
221-
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRepoTasksPackages)"
224+
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
222225
ContinueOnError="false" />
223226
<Exec Command="$(NuGetCommand) restore %(SetupSln.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
224227
ContinueOnError="false" />
@@ -264,6 +267,13 @@
264267
<MakeDir Directories="$(StackPackageFolder)"
265268
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
266269

270+
<MSBuild
271+
Projects="@(CommonSolution)"
272+
Targets="Build"
273+
Properties="Configuration=$(Configuration);Platform=Any CPU"
274+
BuildInParallel="$(BuildInParallel)"
275+
ContinueOnError="false" />
276+
267277
<MSBuild Projects="@(CmdletSolutionsToBuild)"
268278
Targets="Build"
269279
Properties="Configuration=$(Configuration);Platform=Any CPU"
@@ -280,7 +290,7 @@
280290

281291
<Exec ContinueOnError="false"
282292
Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot; . $(LibraryToolsFolder)\NewHelpIndex.ps1 -OutputFile $(PackageDirectory)\index.json -BuildConfig $(Configuration) &quot;"
283-
Condition="'$(Latest)' == 'true' and $(CodeSign) == 'true'"/>
293+
Condition=" ('$(Scope)' == 'All' or '$(Scope)' == 'Latest') and $(CodeSign) == 'true'"/>
284294

285295
<!-- Copying modules to be signed -->
286296

@@ -314,6 +324,11 @@
314324
Condition= " '$(Scope)' == 'All' or '$(Scope)' == 'Stack' "/>
315325

316326
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
327+
328+
<Exec ContinueOnError="false"
329+
Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot; . $(LibraryToolsFolder)\NewOutputTypeIndex.ps1 -OutputFile $(PackageDirectory)\outputtypes.json -BuildConfig $(Configuration) &quot;"
330+
Condition=" ('$(Scope)' == 'All' or '$(Scope)' == 'Latest') and $(CodeSign) == 'true'"/>
331+
317332
<!-- AzureRM -->
318333
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\AzureRM.psd1"
319334
DestinationFolder="$(LibraryToolsFolder)\AzureRM" Condition= " '$(Scope)' == 'All' or '$(Scope)' == 'Latest' "/>
@@ -582,9 +597,8 @@
582597

583598
<Message Importance="high" Text="Running dependency analysis..." />
584599

585-
<Exec Command="$(MSBuildProjectDirectory)\src\Package\StaticAnalysis.exe $(MSBuildProjectDirectory)\src\Package\$(Configuration) $(MSBuildProjectDirectory)\src\Package true $(SkipHelp)"
586-
Condition="'$(Scope)' != 'Stack'"
587-
ContinueOnError="True"/>
600+
<Exec Command="$(MSBuildProjectDirectory)\src\Package\StaticAnalysis.exe $(MSBuildProjectDirectory)\src\Package\$(Configuration) $(MSBuildProjectDirectory)\src\Package true $(SkipHelp) @(ModulesChanged)"
601+
Condition="'$(Scope)' != 'Stack'"/>
588602

589603
<Exec Command="$(PackageDirectory)\StaticAnalysis.exe $(StackPackageFolder)\$(Configuration) $(StackPackageFolder)"
590604
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'"
@@ -601,7 +615,7 @@
601615
<Target Name="ChangeLogCheck">
602616
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CheckChangeLog.ps1 -FilesChanged '@(FilesChanged)' &quot;"
603617
ContinueOnError="false"
604-
Condition="'$(Latest)' == 'true'"/>
618+
Condition=" '$(Scope)' == 'All' or '$(Scope)' == 'Latest' "/>
605619
<OnError ExecuteTargets="ChangeLogErrorMessage"/>
606620
</Target>
607621

@@ -638,11 +652,43 @@
638652
<Target Name="Test" DependsOnTargets="BeforeRunTests">
639653
<Message Importance="high" Text="Running check in tests..." />
640654

655+
<CallTarget Targets="BinScopeCheck" />
656+
657+
<CallTarget Targets="RunPoliCheck" />
658+
641659
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;$(MSBuildProjectDirectory)\tools\Modules\Run-UnitTests.ps1 -BuildConfig $(Configuration) -Scope $(Scope) &quot;"
642660
ContinueOnError="ErrorAndContinue"/>
643661

644662
<!-- Azure / Stack -->
645-
<CallTarget Targets="InvokeXUnit" Condition="false"/>
663+
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
664+
<MakeDir Directories="$(TestOutputDirectory)/PassingTests" ContinueOnError="false" />
665+
<MakeDir Directories="$(TestOutputDirectory)/FailingTests" ContinueOnError="false" />
666+
<MSBuild Projects="build.proj"
667+
Targets="InvokeXUnit"
668+
Properties="XUnitTests=%(XUnitTests.Identity);TestOutputDirectory=$(TestOutputDirectory)"
669+
ContinueOnError="false" />
670+
671+
<CallTarget Targets="TestFailureCheck" />
672+
</Target>
673+
674+
<Target Name="BinScopeCheck">
675+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;$(MSBuildProjectDirectory)\tools\CheckBinScope.ps1 -BuildConfig $(Configuration) -CIToolsPath $(CIToolsPath) &quot;"
676+
ContinueOnError="False"/>
677+
<OnError ExecuteTargets="BinScopeErrorMessage"/>
678+
</Target>
679+
680+
<Target Name="BinScopeErrorMessage">
681+
<Error Text="Binscope failed, please check the files in src/Package/BinScope"/>
682+
</Target>
683+
684+
<Target Name="TestFailureCheck">
685+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;if ((Get-ChildItem $(TestOutputDirectory)/FailingTests).Count -ge 1) { throw &quot;Failing tests, please check files in src/TestResults/FailingTests&quot; } &quot;"
686+
ContinueOnError="False"/>
687+
<OnError ExecuteTargets="TestFailureErrorMessage"/>
688+
</Target>
689+
690+
<Target Name="TestFailureErrorMessage">
691+
<Error Text="Test failures occured, check the files in src/TestResults/FailingTests."/>
646692
</Target>
647693

648694
<!-- Run Full switch with scenario tests -->
@@ -661,4 +707,14 @@
661707
<CallTarget Targets="LiveTests"/>
662708
</Target>
663709

710+
<Target Name="RunPoliCheck">
711+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;$(MSBuildProjectDirectory)\tools\CheckPoliCheck.ps1 -BuildConfig $(Configuration) -CIToolsPath $(CIToolsPath) &quot;"
712+
ContinueOnError="False"/>
713+
<OnError ExecuteTargets="PoliCheckErrorMessage"/>
714+
</Target>
715+
716+
<Target Name="PoliCheckErrorMessage">
717+
<Error Text="PoliCheck failed with a Severity 1 issue, please check the report at in src/Package/PoliCheck-Scan.html"/>
718+
</Target>
719+
664720
</Project>

documentation/Debugging-StaticAnalysis-Errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ _Note_: Sometimes the error listed in the .csv file can be a false positive (for
4242
We take breaking changes very seriously, so please be mindful about the violations that you suppress in our repo.
4343

4444
### Signature Issues
45-
Signature issues occur when your cmdlets do not follow PowerShell standards. Please check [this page](https://github.com/Azure/azure-powershell/wiki/PowerShell-Cmdlet-Design-Guidelines) to ensure you are following PowerShell guidelines. Issues with severity 0 or 1 must be addressed, while issues with severity 2 are advisory. If you have an issue with severity 0 or 1 that has been approved by the Azure PowerShell team, you can suppress them following these steps:
45+
Signature issues occur when your cmdlets do not follow PowerShell standards. Please check [this page](https://github.com/Azure/azure-powershell/blob/preview/documentation/development-docs/azure-powershell-design-guidelines.md) to ensure you are following PowerShell guidelines. Issues with severity 0 or 1 must be addressed, while issues with severity 2 are advisory. If you have an issue with severity 0 or 1 that has been approved by the Azure PowerShell team, you can suppress them following these steps:
4646

4747
- Download the `SignatureIssues.csv` file from the Jenkins build
4848
- Open the file using a text editor (such as VS Code) and copy each of the errors you'd like to suppress

documentation/breaking-changes/breaking-changes-attribute-help.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ Breaking changes in the cmdlet : Get-SomeObjectA
237237

238238
#### The output return type is changing
239239
```cs
240-
[CmdletOutputBreakingChange(typeof(List<Foo>), ReplacementCmdletOutputTypeName = "Dictionary<String, Foo>")]
241-
[Cmdlet(VerbsCommon.Get, "SomeObjectA"), OutputType(typeof(List<Foo>))]
240+
[CmdletOutputBreakingChange(typeof(Foo), ReplacementCmdletOutputTypeName = "Dictionary<String, Foo>")]
241+
[Cmdlet(VerbsCommon.Get, "SomeObjectA"), OutputType(typeof(Foo))]
242242
public class GetSomeObjectA : AzureRMCmdlet
243243
{
244244
protected override void BeginProcessing()

documentation/breaking-changes/breaking-changes-tool-help.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ When the type of the output is a generic, and one of the arguments of the generi
300300
For example, if we had a cmdlet `Get-SomeObject` that returned a list of `Foo` objects
301301

302302
```cs
303-
[Cmdlet(VerbsCommon.Get, "SomeObject"), OutputType(typeof(List<Foo>))]
303+
[Cmdlet(VerbsCommon.Get, "SomeObject"), OutputType(typeof(Foo))]
304304
public class GetSomeObject : Cmdlet
305305
{
306306
protected override void BeginProcessing()
@@ -313,7 +313,7 @@ public class GetSomeObject : Cmdlet
313313
but it now returns a list of `Bar` objects
314314

315315
```cs
316-
[Cmdlet(VerbsCommon.Get, "SomeObject"), OutputType(typeof(List<Bar>))]
316+
[Cmdlet(VerbsCommon.Get, "SomeObject"), OutputType(typeof(Bar))]
317317
```
318318

319319
the following script will no longer work since we are accessing properties of the `Foo` object that may not be a part of the `Bar` object

0 commit comments

Comments
 (0)