-
Notifications
You must be signed in to change notification settings - Fork 4k
[Do not merge!] Yanxu/for test #28149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
c6c3da0
f4e98e6
54a3868
6a33026
75eb752
d75f42f
80b5c26
53e2679
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0 (the ""License""); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an ""AS IS"" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code | ||
// is regenerated. | ||
|
||
using System; | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")] | ||
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] | ||
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] | ||
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Authorization")] | ||
[assembly: System.Reflection.AssemblyFileVersionAttribute("8.0.1")] | ||
[assembly: System.Reflection.AssemblyVersionAttribute("8.0.1")] | ||
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] | ||
[assembly: System.CLSCompliantAttribute(false)] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"generate_Id": "c1694601-4d35-40bd-94d8-1b26473b7708" | ||
"generate_Id": "64ce5349-d0cc-4d2a-aa30-8d6c7f4adc31" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Resources | ||
This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. | ||
|
||
## Info | ||
- Modifiable: yes | ||
- Generated: no | ||
- Committed: yes | ||
- Packaged: no | ||
|
||
## Purpose | ||
Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -49,7 +49,7 @@ Get all child resources of a resource `scope` that the calling user has eligible | |||||
### Example 2: List all child resources filtered by resource type | ||||||
```powershell | ||||||
$scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" | ||||||
$filter = "resourceType eq 'resourcegroup'" | ||||||
$filter = "resoureType eq 'resourcegroup'" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo in 'resoureType'; it should be 'resourceType'.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
Get-AzRoleEligibleChildResource -Scope $scope -Filter $filter | ||||||
``` | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -27,7 +27,7 @@ Creates a role eligibility schedule request. | |||||
|
||||||
## EXAMPLES | ||||||
|
||||||
### Example 1: Create a new role eligible schedule request as Admin | ||||||
### Example 1: Create a new role eligibile schedule request as Admin | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo in 'eligibile'; it should be 'eligible'.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
```powershell | ||||||
$guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" | ||||||
$startTime = Get-Date -Format o | ||||||
|
@@ -43,7 +43,7 @@ Name Type | |||||
|
||||||
Creates a request to provision an eligible assignment of `roleDefinition` on the `scope` for the specified `principal` | ||||||
|
||||||
### Example 2: Remove a role eligible schedule request as Admin | ||||||
### Example 2: Remove a role eligibile schedule request as Admin | ||||||
```powershell | ||||||
$guid = "13f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" | ||||||
$startTime = Get-Date -Format o | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -12,7 +12,7 @@ Saves a Management Group scoped Deployment Stack Template. | |||||
|
||||||
## SYNTAX | ||||||
|
||||||
### SaveByNameAndManagementGroupId (Default) | ||||||
### SaveByNameAndManagmentGroupId (Default) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo in 'ManagmentGroupId'; it should be 'ManagementGroupId'.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
``` | ||||||
Save-AzManagementGroupDeploymentStackTemplate [-StackName] <String> [-ManagementGroupId] <String> [-Pre] | ||||||
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>] | ||||||
|
@@ -79,7 +79,7 @@ The id of the ManagementGroup where the DeploymentStack is deployed | |||||
|
||||||
```yaml | ||||||
Type: System.String | ||||||
Parameter Sets: SaveByNameAndManagementGroupId | ||||||
Parameter Sets: SaveByNameAndManagmentGroupId | ||||||
Aliases: | ||||||
|
||||||
Required: True | ||||||
|
@@ -124,7 +124,7 @@ The name of the DeploymentStack to get | |||||
|
||||||
```yaml | ||||||
Type: System.String | ||||||
Parameter Sets: SaveByNameAndManagementGroupId | ||||||
Parameter Sets: SaveByNameAndManagmentGroupId | ||||||
Aliases: | ||||||
|
||||||
Required: True | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -298,22 +298,30 @@ ElseIf (-Not $PSBoundParameters.ContainsKey("TargetModule")) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Run the test-module.ps1 in current folder and set the test status in pipeline result | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If ($TestAutorest) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Write-Host "--------------------------------- TestAutorest step 1 ---------------------------------" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If (-not (Test-Path "$AutorestDirectory/test-module.ps1")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Write-Warning "There is no test-module.ps1 found in the folder: $AutorestDirectory" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Write-Host "--------------------------------- TestAutorest step 2 ---------------------------------" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$ModuleName = Split-Path -Path $AutorestDirectory | Split-Path -Leaf | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Write-Host "--------------------------------- TestAutorest step 3 ---------------------------------" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$ModuleFolderName = $ModuleName.Split(".")[1] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Write-Host "--------------------------------- TestAutorest step 4 ---------------------------------" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If (Test-Path $CIPlanPath) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Write-Host "--------------------------------- TestAutorest step 5 ---------------------------------" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$CIPlan = Get-Content $CIPlanPath | ConvertFrom-Json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Write-Host "--------------------------------- TestAutorest step 6 ---------------------------------" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If (-not ($CIPlan.test.Contains($ModuleFolderName))) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Write-Debug "Skip test for $ModuleName because it is not in the test plan." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Write-Host "--------------------------------- TestAutorest step 7 ---------------------------------" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
. $AutorestDirectory/test-module.ps1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Write-Host "--------------------------------- TestAutorest step 8 ---------------------------------" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] These Write-Host statements appear to be temporary debug logs; consider converting them to Write-Verbose or removing them to keep CI logs clean.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If ($LastExitCode -ne 0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$Status = "Failed" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -322,7 +330,9 @@ If ($TestAutorest) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$Status = "Succeeded" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Write-Host "--------------------------------- TestAutorest step 9 ---------------------------------" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set-ModuleTestStatusInPipelineResult -ModuleName $ModuleName -Status $Status | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Write-Host "--------------------------------- TestAutorest step 10 ---------------------------------" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in 'ManagmentGroupId'; it should be 'ManagementGroupId'.
Copilot uses AI. Check for mistakes.