Skip to content

Commit

Permalink
Test tweaks (#24566)
Browse files Browse the repository at this point in the history
* Update to autorest 4.x
Update to Azure Policy 2023-04-01
Move to non-versioned interface types
Complete full test suite for existing cmdlets
Few bug fixes
Add completer for Location parameter
Fix record/playback, remove -LiveOnly tags
Make test names repeatable to work with record/playback
Implement resource group functions that became inaccessible
Fix test failures due to default parameter injection

* Clean up some transforms in README
Remove unsupported (for now) parameters
Streamline common test code
Move common test code to utils.ps1
Add serialization of test variables to env.json

* Remove extra parameters from Get-AzPolicyAssignment
Rerecord the tests

* Fix $testFilesFolder calculation to work on macOS/linux.

* Hide generated parameter sets for New-*
Correct definitions, validation, and tests for New-AzPolicyAssignment parameters
Re-record all tests

* Replace Get-AzContext with Utils\Get-SubscriptionIdTestSafe
Move to autorest 4.0.690
Update managed identity properties to match generation changes
Remove several parameter transforms no longer needed
Rerecord all tests
91 tests still failing on -Playback with the same signature

* Remove location completer from exports/docs/examples/help

* Improve location completer tests

* Remove transforms for Scope and Id parameters no longer needed
Update cmdlets to use Scope and Id directly
Rerecord all tests
All tests pass in -Record mode
Failures in -Playback mode unchanged

* Change location completer to lazy load (vs. module load)
Preserve "extra" input parameters in Update-* calls to Get-* in order to support -Playback test mode
Tag test files that don't support -Playback mode as LiveOnly
Rerecord all recording files

* Minor updates for consistency
Rerecord all tests
Move 4 test files back to LiveOnly
  • Loading branch information
mentat9 authored Apr 2, 2024
1 parent f43da67 commit c7a8496
Show file tree
Hide file tree
Showing 91 changed files with 20,861 additions and 12,229 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"isContentBase64": false,
"Headers": {
"x-ms-unique-id": [ "417" ],
"x-ms-client-request-id": [ "db77d061-0746-4f6b-9593-c50d7774907a" ],
"x-ms-client-request-id": [ "67a5db42-9814-4fa4-ae16-0b94fff07c43" ],
"CommandName": [ "\u0026" ],
"FullCommandName": [ "Get-AzPolicyAssignment_List3" ],
"ParameterSetName": [ "__AllParameterSets" ],
Expand All @@ -23,14 +23,14 @@
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "11996" ],
"x-ms-request-id": [ "efd7da3d-0bed-49ff-a779-9628a2fc24e0" ],
"x-ms-correlation-request-id": [ "efd7da3d-0bed-49ff-a779-9628a2fc24e0" ],
"x-ms-routing-request-id": [ "WESTUS2:20240329T231136Z:efd7da3d-0bed-49ff-a779-9628a2fc24e0" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "11997" ],
"x-ms-request-id": [ "c6c555aa-2351-41c0-98dd-654fab974ee0" ],
"x-ms-correlation-request-id": [ "c6c555aa-2351-41c0-98dd-654fab974ee0" ],
"x-ms-routing-request-id": [ "WESTUS2:20240402T005516Z:c6c555aa-2351-41c0-98dd-654fab974ee0" ],
"X-Content-Type-Options": [ "nosniff" ],
"X-Cache": [ "CONFIG_NOCACHE" ],
"X-MSEdge-Ref": [ "Ref A: 2A9033E1D8F64D049507CC3717A596AA Ref B: CO6AA3150217049 Ref C: 2024-03-29T23:11:36Z" ],
"Date": [ "Fri, 29 Mar 2024 23:11:35 GMT" ]
"X-MSEdge-Ref": [ "Ref A: 96FE5CDADA4A4EA7934AA82CCDE555CD Ref B: CO6AA3150220011 Ref C: 2024-04-02T00:55:16Z" ],
"Date": [ "Tue, 02 Apr 2024 00:55:15 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "15185" ],
Expand All @@ -49,7 +49,7 @@
"isContentBase64": false,
"Headers": {
"x-ms-unique-id": [ "418" ],
"x-ms-client-request-id": [ "a90cc2ea-2c6f-447e-9702-ff7b2025e8f6" ],
"x-ms-client-request-id": [ "e040cb93-009d-4176-9d58-8a6a9098ea32" ],
"CommandName": [ "\u0026" ],
"FullCommandName": [ "Get-AzPolicyAssignment_Get" ],
"ParameterSetName": [ "__AllParameterSets" ],
Expand All @@ -64,15 +64,15 @@
"Headers": {
"Cache-Control": [ "no-store, no-cache" ],
"Pragma": [ "no-cache" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "11998" ],
"x-ms-request-id": [ "b945010a-3e85-49be-aac6-d08268b8a1e2" ],
"x-ms-correlation-request-id": [ "b945010a-3e85-49be-aac6-d08268b8a1e2" ],
"x-ms-routing-request-id": [ "WESTUS2:20240329T231137Z:b945010a-3e85-49be-aac6-d08268b8a1e2" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "11999" ],
"x-ms-request-id": [ "e1dd057f-5179-4dff-aab2-4eeaf5a1b1d8" ],
"x-ms-correlation-request-id": [ "e1dd057f-5179-4dff-aab2-4eeaf5a1b1d8" ],
"x-ms-routing-request-id": [ "WESTUS2:20240402T005516Z:e1dd057f-5179-4dff-aab2-4eeaf5a1b1d8" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Content-Type-Options": [ "nosniff" ],
"X-Cache": [ "CONFIG_NOCACHE" ],
"X-MSEdge-Ref": [ "Ref A: 6298F1F531E14B3FB6CFCCF397C0F613 Ref B: CO6AA3150217049 Ref C: 2024-03-29T23:11:37Z" ],
"Date": [ "Fri, 29 Mar 2024 23:11:36 GMT" ]
"X-MSEdge-Ref": [ "Ref A: DB3257E50FA441019BC7E0F04236C12A Ref B: CO6AA3150220011 Ref C: 2024-04-02T00:55:16Z" ],
"Date": [ "Tue, 02 Apr 2024 00:55:15 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "104" ],
Expand All @@ -91,7 +91,7 @@
"isContentBase64": false,
"Headers": {
"x-ms-unique-id": [ "419" ],
"x-ms-client-request-id": [ "3583ce02-ab58-4647-9f95-6c59c8109f22" ],
"x-ms-client-request-id": [ "cf79bd5a-72fc-416d-bd61-204d2e0431c6" ],
"CommandName": [ "\u0026" ],
"FullCommandName": [ "Get-AzPolicyAssignment_Get" ],
"ParameterSetName": [ "__AllParameterSets" ],
Expand All @@ -106,15 +106,15 @@
"Headers": {
"Cache-Control": [ "no-store, no-cache" ],
"Pragma": [ "no-cache" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "11999" ],
"x-ms-request-id": [ "38aa23c9-5c1d-418c-bb34-b29ecea030f0" ],
"x-ms-correlation-request-id": [ "38aa23c9-5c1d-418c-bb34-b29ecea030f0" ],
"x-ms-routing-request-id": [ "WESTUS2:20240329T231137Z:38aa23c9-5c1d-418c-bb34-b29ecea030f0" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "11998" ],
"x-ms-request-id": [ "d80d786c-4d35-4546-91a5-b24ca0e58b5b" ],
"x-ms-correlation-request-id": [ "d80d786c-4d35-4546-91a5-b24ca0e58b5b" ],
"x-ms-routing-request-id": [ "WESTUS2:20240402T005516Z:d80d786c-4d35-4546-91a5-b24ca0e58b5b" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Content-Type-Options": [ "nosniff" ],
"X-Cache": [ "CONFIG_NOCACHE" ],
"X-MSEdge-Ref": [ "Ref A: 8E04E0DE2A5842B0A5A2CD5735B7DAE7 Ref B: CO6AA3150217049 Ref C: 2024-03-29T23:11:37Z" ],
"Date": [ "Fri, 29 Mar 2024 23:11:36 GMT" ]
"X-MSEdge-Ref": [ "Ref A: F0CA0BA477F3418A9B79590ED3E7EB20 Ref B: CO6AA3150220011 Ref C: 2024-04-02T00:55:16Z" ],
"Date": [ "Tue, 02 Apr 2024 00:55:16 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "104" ],
Expand All @@ -133,7 +133,7 @@
"isContentBase64": false,
"Headers": {
"x-ms-unique-id": [ "420" ],
"x-ms-client-request-id": [ "db35639d-aeed-4036-82f4-4dae6d9248a2" ],
"x-ms-client-request-id": [ "5a0850ea-9d5a-4033-8253-70c0637a2076" ],
"CommandName": [ "\u0026" ],
"FullCommandName": [ "Get-AzPolicyAssignment_List3" ],
"ParameterSetName": [ "__AllParameterSets" ],
Expand All @@ -150,13 +150,13 @@
"Pragma": [ "no-cache" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "11998" ],
"x-ms-request-id": [ "ed7a1d34-9183-4e6f-b0e8-54d0508d9127" ],
"x-ms-correlation-request-id": [ "ed7a1d34-9183-4e6f-b0e8-54d0508d9127" ],
"x-ms-routing-request-id": [ "WESTUS2:20240329T231138Z:ed7a1d34-9183-4e6f-b0e8-54d0508d9127" ],
"x-ms-request-id": [ "75b8dfd3-86d8-4eca-b780-964d17ea20dd" ],
"x-ms-correlation-request-id": [ "75b8dfd3-86d8-4eca-b780-964d17ea20dd" ],
"x-ms-routing-request-id": [ "WESTUS2:20240402T005517Z:75b8dfd3-86d8-4eca-b780-964d17ea20dd" ],
"X-Content-Type-Options": [ "nosniff" ],
"X-Cache": [ "CONFIG_NOCACHE" ],
"X-MSEdge-Ref": [ "Ref A: EDFBBCC3DAFA436DB1948881EB7524EF Ref B: CO6AA3150217049 Ref C: 2024-03-29T23:11:38Z" ],
"Date": [ "Fri, 29 Mar 2024 23:11:37 GMT" ]
"X-MSEdge-Ref": [ "Ref A: 7EC28538EFE14378AA581511A3644F3A Ref B: CO6AA3150220011 Ref C: 2024-04-02T00:55:17Z" ],
"Date": [ "Tue, 02 Apr 2024 00:55:16 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "15185" ],
Expand All @@ -175,7 +175,7 @@
"isContentBase64": false,
"Headers": {
"x-ms-unique-id": [ "421" ],
"x-ms-client-request-id": [ "3228826a-92fc-4865-966c-9fd32457513d" ],
"x-ms-client-request-id": [ "1e6a7f58-fadb-4b61-ac36-cb3896d3d20d" ],
"CommandName": [ "\u0026" ],
"FullCommandName": [ "Get-AzPolicyAssignment_List3" ],
"ParameterSetName": [ "__AllParameterSets" ],
Expand All @@ -192,13 +192,13 @@
"Pragma": [ "no-cache" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "11999" ],
"x-ms-request-id": [ "661fce4c-869d-43e7-bf7b-6ca214ca2cd8" ],
"x-ms-correlation-request-id": [ "661fce4c-869d-43e7-bf7b-6ca214ca2cd8" ],
"x-ms-routing-request-id": [ "WESTUS2:20240329T231138Z:661fce4c-869d-43e7-bf7b-6ca214ca2cd8" ],
"x-ms-request-id": [ "4e778564-a2b3-456b-8db3-17b6d4a3a67e" ],
"x-ms-correlation-request-id": [ "4e778564-a2b3-456b-8db3-17b6d4a3a67e" ],
"x-ms-routing-request-id": [ "WESTUS2:20240402T005517Z:4e778564-a2b3-456b-8db3-17b6d4a3a67e" ],
"X-Content-Type-Options": [ "nosniff" ],
"X-Cache": [ "CONFIG_NOCACHE" ],
"X-MSEdge-Ref": [ "Ref A: DEF27C9DBFB646E19DE70D4B3D52493E Ref B: CO6AA3150217049 Ref C: 2024-03-29T23:11:38Z" ],
"Date": [ "Fri, 29 Mar 2024 23:11:37 GMT" ]
"X-MSEdge-Ref": [ "Ref A: C39427B0534949BAAD5222D14A96032F Ref B: CO6AA3150220011 Ref C: 2024-04-02T00:55:17Z" ],
"Date": [ "Tue, 02 Apr 2024 00:55:17 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "12" ],
Expand All @@ -217,7 +217,7 @@
"isContentBase64": false,
"Headers": {
"x-ms-unique-id": [ "422" ],
"x-ms-client-request-id": [ "7fc27423-ec0b-4a2c-a48b-1bce14684789" ],
"x-ms-client-request-id": [ "d60395b7-cb86-40e5-90af-21d8c53bb905" ],
"CommandName": [ "\u0026" ],
"FullCommandName": [ "Get-AzPolicyAssignment_List3" ],
"ParameterSetName": [ "__AllParameterSets" ],
Expand All @@ -234,13 +234,13 @@
"Pragma": [ "no-cache" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "11999" ],
"x-ms-request-id": [ "e58e88e4-4c59-4a42-a040-12a14e6fdef3" ],
"x-ms-correlation-request-id": [ "e58e88e4-4c59-4a42-a040-12a14e6fdef3" ],
"x-ms-routing-request-id": [ "WESTUS2:20240329T231138Z:e58e88e4-4c59-4a42-a040-12a14e6fdef3" ],
"x-ms-request-id": [ "4c2b5dca-89eb-4b81-849c-0799b6956821" ],
"x-ms-correlation-request-id": [ "4c2b5dca-89eb-4b81-849c-0799b6956821" ],
"x-ms-routing-request-id": [ "WESTUS2:20240402T005518Z:4c2b5dca-89eb-4b81-849c-0799b6956821" ],
"X-Content-Type-Options": [ "nosniff" ],
"X-Cache": [ "CONFIG_NOCACHE" ],
"X-MSEdge-Ref": [ "Ref A: F5B62659F326492CB404886CC1389F43 Ref B: CO6AA3150217049 Ref C: 2024-03-29T23:11:38Z" ],
"Date": [ "Fri, 29 Mar 2024 23:11:37 GMT" ]
"X-MSEdge-Ref": [ "Ref A: 14C03B7B00D948E6A70D0366DDB97862 Ref B: CO6AA3150220011 Ref C: 2024-04-02T00:55:18Z" ],
"Date": [ "Tue, 02 Apr 2024 00:55:17 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "15185" ],
Expand All @@ -259,7 +259,7 @@
"isContentBase64": false,
"Headers": {
"x-ms-unique-id": [ "423" ],
"x-ms-client-request-id": [ "11cd1510-59df-4eea-a11e-e909fae4d635" ],
"x-ms-client-request-id": [ "5406cf0e-32d0-4e69-a61e-bf41ce92ea06" ],
"CommandName": [ "\u0026" ],
"FullCommandName": [ "Get-AzPolicyAssignment_Get1" ],
"ParameterSetName": [ "__AllParameterSets" ],
Expand All @@ -275,14 +275,14 @@
"Cache-Control": [ "no-store, no-cache" ],
"Pragma": [ "no-cache" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "11998" ],
"x-ms-request-id": [ "99297247-c408-4815-b5fb-14b536108d6b" ],
"x-ms-correlation-request-id": [ "99297247-c408-4815-b5fb-14b536108d6b" ],
"x-ms-routing-request-id": [ "WESTUS2:20240329T231139Z:99297247-c408-4815-b5fb-14b536108d6b" ],
"x-ms-request-id": [ "ab1e200b-51d0-44c9-a9af-7607192219a9" ],
"x-ms-correlation-request-id": [ "ab1e200b-51d0-44c9-a9af-7607192219a9" ],
"x-ms-routing-request-id": [ "WESTUS2:20240402T005518Z:ab1e200b-51d0-44c9-a9af-7607192219a9" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Content-Type-Options": [ "nosniff" ],
"X-Cache": [ "CONFIG_NOCACHE" ],
"X-MSEdge-Ref": [ "Ref A: 66850ED9F48648CDA3EF1836550C8EF4 Ref B: CO6AA3150217049 Ref C: 2024-03-29T23:11:39Z" ],
"Date": [ "Fri, 29 Mar 2024 23:11:38 GMT" ]
"X-MSEdge-Ref": [ "Ref A: DE20892F6C48498F8E36C7912347A8B4 Ref B: CO6AA3150220011 Ref C: 2024-04-02T00:55:18Z" ],
"Date": [ "Tue, 02 Apr 2024 00:55:17 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "104" ],
Expand All @@ -301,7 +301,7 @@
"isContentBase64": false,
"Headers": {
"x-ms-unique-id": [ "424" ],
"x-ms-client-request-id": [ "b6f02710-adc5-4953-a0fd-0720083b2469" ],
"x-ms-client-request-id": [ "53c108aa-b37c-4739-bf9f-3ac1d20617e5" ],
"CommandName": [ "\u0026" ],
"FullCommandName": [ "Get-AzPolicyAssignment_List3" ],
"ParameterSetName": [ "__AllParameterSets" ],
Expand All @@ -317,14 +317,14 @@
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "11998" ],
"x-ms-request-id": [ "99f56cc3-3cf7-4e2e-8f64-da5259e8a262" ],
"x-ms-correlation-request-id": [ "99f56cc3-3cf7-4e2e-8f64-da5259e8a262" ],
"x-ms-routing-request-id": [ "WESTUS2:20240329T231140Z:99f56cc3-3cf7-4e2e-8f64-da5259e8a262" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "11999" ],
"x-ms-request-id": [ "4ccbfc58-527f-43e7-a17c-9a67a374fae3" ],
"x-ms-correlation-request-id": [ "4ccbfc58-527f-43e7-a17c-9a67a374fae3" ],
"x-ms-routing-request-id": [ "WESTUS2:20240402T005519Z:4ccbfc58-527f-43e7-a17c-9a67a374fae3" ],
"X-Content-Type-Options": [ "nosniff" ],
"X-Cache": [ "CONFIG_NOCACHE" ],
"X-MSEdge-Ref": [ "Ref A: 40FC3B777FDA4DBDB8AEC6A189DDD10A Ref B: CO6AA3150217049 Ref C: 2024-03-29T23:11:40Z" ],
"Date": [ "Fri, 29 Mar 2024 23:11:39 GMT" ]
"X-MSEdge-Ref": [ "Ref A: 4EF7D2A2880D4623B1A547AAB62A7B03 Ref B: CO6AA3150220011 Ref C: 2024-04-02T00:55:19Z" ],
"Date": [ "Tue, 02 Apr 2024 00:55:18 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "12" ],
Expand All @@ -343,7 +343,7 @@
"isContentBase64": false,
"Headers": {
"x-ms-unique-id": [ "425" ],
"x-ms-client-request-id": [ "fb301fda-77e8-48ec-9a74-b634c8e5274d" ],
"x-ms-client-request-id": [ "4fedad38-84df-4806-b85b-76d13fd0c934" ],
"CommandName": [ "\u0026" ],
"FullCommandName": [ "Get-AzPolicyAssignment_List3" ],
"ParameterSetName": [ "__AllParameterSets" ],
Expand All @@ -360,13 +360,13 @@
"Pragma": [ "no-cache" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "11998" ],
"x-ms-request-id": [ "867666d1-fd59-4d78-92d0-905cd74df5be" ],
"x-ms-correlation-request-id": [ "867666d1-fd59-4d78-92d0-905cd74df5be" ],
"x-ms-routing-request-id": [ "WESTUS2:20240329T231140Z:867666d1-fd59-4d78-92d0-905cd74df5be" ],
"x-ms-request-id": [ "e160d3d1-a70c-4abb-9349-15f4c69791b8" ],
"x-ms-correlation-request-id": [ "e160d3d1-a70c-4abb-9349-15f4c69791b8" ],
"x-ms-routing-request-id": [ "WESTUS2:20240402T005519Z:e160d3d1-a70c-4abb-9349-15f4c69791b8" ],
"X-Content-Type-Options": [ "nosniff" ],
"X-Cache": [ "CONFIG_NOCACHE" ],
"X-MSEdge-Ref": [ "Ref A: 6814C3718C8A41F38DB8A72ABC52953B Ref B: CO6AA3150217049 Ref C: 2024-03-29T23:11:40Z" ],
"Date": [ "Fri, 29 Mar 2024 23:11:39 GMT" ]
"X-MSEdge-Ref": [ "Ref A: 5903FDB76EAE4D8394E764A0864C528D Ref B: CO6AA3150220011 Ref C: 2024-04-02T00:55:19Z" ],
"Date": [ "Tue, 02 Apr 2024 00:55:18 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "15185" ],
Expand Down
Loading

0 comments on commit c7a8496

Please sign in to comment.