From dd4d0378bc5a563b4f9e6965b6df8398ecabfa63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20R=C3=A5nge?= Date: Tue, 25 Aug 2026 12:25:17 +0200 Subject: [PATCH 1/2] In case of empty resource key use 'NOKEY' fallback --- src/ARI/Commands/InventoryCommand.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ARI/Commands/InventoryCommand.cs b/src/ARI/Commands/InventoryCommand.cs index 0c664d1..a0b1674 100644 --- a/src/ARI/Commands/InventoryCommand.cs +++ b/src/ARI/Commands/InventoryCommand.cs @@ -229,14 +229,19 @@ await writer.WriteLineAsync( var order = 0; foreach (var resources in tag.Resources) { - await writer.WriteLineAsync($"| {resources.Key.Link()} |"); + var key = resources.Key; + if (string.IsNullOrWhiteSpace(key)) + { + key = "NOKEY"; + } + await writer.WriteLineAsync($"| {key.Link()} |"); using var valueWriter = CakeContext - .OpenIndexWrite(tagPath, resources.Key, markDownFileName, out var tagValuePath); + .OpenIndexWrite(tagPath, key, markDownFileName, out var tagValuePath); await valueWriter.AddFrontmatter( modified, - $"{tag.PublicId} = {resources.Key}", + $"{tag.PublicId} = {key}", Interlocked.Increment(ref order), settings ); From e1a954cd394ad58e8c2efe2f17605d6c5033bd57 Mon Sep 17 00:00:00 2001 From: Mattias Karlsson Date: Wed, 2 Sep 2026 22:52:05 +0200 Subject: [PATCH 2/2] test: migrate ARI.Tests HTTP mocks to Devlead.Testing.MockHttp Routes.json Replace the hand-rolled MockHttpClient switch and ARIServiceProviderFixture with the package ServiceProviderFixture and Routes.json, and cover empty tag values writing under NOKEY. --- src/ARI.Tests/ARI.Tests.csproj | 39 +- src/ARI.Tests/Constants.cs | 88 +- .../IServiceCollectionExtensions.cs | 126 +- .../Fixture/ARIServiceProviderFixture.cs | 138 -- .../Fixture/ServiceProviderFixture.cs | 25 + src/ARI.Tests/Resources/Routes.json | 362 +++++ ...ubscription1_ResourceGroup1_Resources.json | 14 + src/ARI.Tests/Resources/TenantsUser.json | 44 - ...tyTagValue_UsesNoKeyDirectory.verified.txt | 1227 +++++++++++++++++ ...SiteApplicationsettings=False.verified.txt | 51 +- ...eSiteApplicationsettings=True.verified.txt | 51 +- ...SiteApplicationsettings=False.verified.txt | 51 +- ...eSiteApplicationsettings=True.verified.txt | 51 +- .../Unit/Commands/InventoryCommandTests.cs | 66 +- .../Services/ARM/ResourceGroupServiceTests.cs | 4 +- ...a05_resourceGroupName=lab-dev.verified.txt | 55 +- .../Unit/Services/ARM/ResourceServiceTests.cs | 4 +- .../Services/ARM/SubscriptionServiceTests.cs | 4 +- .../Unit/Services/ARM/TenantServiceTests.cs | 4 +- .../Unit/Services/ARM/TokenServiceTests.cs | 6 +- .../Services/ARM/WebAppConfigServiceTests.cs | 4 +- .../ARM/WebAppSettingsServiceTests.cs | 4 +- .../Unit/Services/AzureTokenServiceTests.cs | 4 +- 23 files changed, 1936 insertions(+), 486 deletions(-) delete mode 100644 src/ARI.Tests/Fixture/ARIServiceProviderFixture.cs create mode 100644 src/ARI.Tests/Fixture/ServiceProviderFixture.cs create mode 100644 src/ARI.Tests/Resources/Routes.json delete mode 100644 src/ARI.Tests/Resources/TenantsUser.json create mode 100644 src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_EmptyTagValue_UsesNoKeyDirectory.verified.txt diff --git a/src/ARI.Tests/ARI.Tests.csproj b/src/ARI.Tests/ARI.Tests.csproj index 0067906..4fba951 100644 --- a/src/ARI.Tests/ARI.Tests.csproj +++ b/src/ARI.Tests/ARI.Tests.csproj @@ -8,39 +8,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -55,6 +23,7 @@ + @@ -79,8 +48,4 @@ - - - - diff --git a/src/ARI.Tests/Constants.cs b/src/ARI.Tests/Constants.cs index 158546c..d2c3f9a 100644 --- a/src/ARI.Tests/Constants.cs +++ b/src/ARI.Tests/Constants.cs @@ -1,8 +1,6 @@ -using static System.Net.WebRequestMethods; +namespace ARI.Tests; -namespace ARI.Tests; - -public static class Constants +public class Constants { public static class Tenant { @@ -47,13 +45,6 @@ public static class ResourceGroup1 public static class Request { - public static class Method - { - public const string - Post = "POST", - Get = "GET"; - } - public static class Uri { public const string @@ -103,79 +94,4 @@ public static class ResourceGroup1 } } } - - public static class Response - { - public static class Json - { - public static string TenantsServicePrinciple { get; } = GetResourceString($"{nameof(TenantsServicePrinciple)}.json"); - public static string TenantsUser { get; } = GetResourceString($"{nameof(TenantsUser)}.json"); - public static string GraphOrg { get; } = GetResourceString($"{nameof(GraphOrg)}.json"); - public static string Subscriptions { get; } = GetResourceString($"{nameof(Subscriptions)}.json"); - - public static class Subscription1 - { - public static string ResourceGroups { get; } = GetResourceString($"{nameof(Subscription1)}_{nameof(ResourceGroups)}.json"); - public static class ResourceGroup1 - { - public static string Resources { get; } = GetResourceString($"{nameof(Subscription1)}_{nameof(ResourceGroup1)}_{nameof(Resources)}.json"); - public static class Site - { - public static string Config { get; } = GetResourceString($"{nameof(Subscription1)}_{nameof(ResourceGroup1)}_{nameof(Site)}_{nameof(Config)}.json"); - public static string Settings { get; } = GetResourceString($"{nameof(Subscription1)}_{nameof(ResourceGroup1)}_{nameof(Site)}_{nameof(Settings)}.json"); - } - } - public static class ResourceGroup2 - { - public static string Resources { get; } = GetResourceString($"{nameof(Subscription1)}_{nameof(ResourceGroup2)}_{nameof(Resources)}.json"); - public static class Site - { - public static string Config { get; } = GetResourceString($"{nameof(Subscription1)}_{nameof(ResourceGroup2)}_{nameof(Site)}_{nameof(Config)}.json"); - public static string Settings { get; } = GetResourceString($"{nameof(Subscription1)}_{nameof(ResourceGroup2)}_{nameof(Site)}_{nameof(Settings)}.json"); - } - } - public static class ResourceGroup3 - { - public static string Resources { get; } = GetResourceString($"{nameof(Subscription1)}_{nameof(ResourceGroup3)}_{nameof(Resources)}.json"); - public static class Site - { - public static string Config { get; } = GetResourceString($"{nameof(Subscription1)}_{nameof(ResourceGroup3)}_{nameof(Site)}_{nameof(Config)}.json"); - public static string Settings { get; } = GetResourceString($"{nameof(Subscription1)}_{nameof(ResourceGroup3)}_{nameof(Site)}_{nameof(Settings)}.json"); - } - } - } - - public static class Subscription2 - { - public static string ResourceGroups { get; } = GetResourceString($"{nameof(Subscription2)}_{nameof(ResourceGroups)}.json"); - public static class ResourceGroup1 - { - public static string Resources { get; } = GetResourceString($"{nameof(Subscription2)}_{nameof(ResourceGroup1)}_{nameof(Resources)}.json"); - } - } - } - } - - public static class MediaType - { - public const string - Json = "application/json"; - } - - private static string GetResourceString(string filename, Encoding? encoding = null) - { - using var stream = GetResourceStream(filename); - using var reader = new StreamReader(stream, encoding ?? Encoding.UTF8); - return reader.ReadToEnd(); - } - - private static Stream GetResourceStream(string filename) - { - var resourceStream = typeof(ARIServiceProviderFixture) - .Assembly - .GetManifestResourceStream($"ARI.Tests.Resources.{filename}"); - - return resourceStream - ?? throw new Exception($"Failed to get stream for {filename}."); - } } diff --git a/src/ARI.Tests/Extensions/IServiceCollectionExtensions.cs b/src/ARI.Tests/Extensions/IServiceCollectionExtensions.cs index 998c896..76d56cd 100644 --- a/src/ARI.Tests/Extensions/IServiceCollectionExtensions.cs +++ b/src/ARI.Tests/Extensions/IServiceCollectionExtensions.cs @@ -2,7 +2,6 @@ using Cake.Core.Configuration; using Cake.Core.Diagnostics; using Cake.Core.IO; -using VerifyTests.Http; namespace ARI.Tests.Extensions; @@ -14,14 +13,14 @@ public static IServiceCollection AddCakeFakes( ) { var configuration = new FakeConfiguration(); - + var environment = FakeEnvironment.CreateUnixEnvironment(); - + var fileSystem = new FakeFileSystem(environment); configureFileSystem?.Invoke(fileSystem); var globber = new Globber(fileSystem, environment); - + var log = new FakeLog(); var Context = Substitute.For(); @@ -40,123 +39,4 @@ public static IServiceCollection AddCakeFakes( .AddSingleton(environment.Runtime) .AddSingleton(Context); } - - public static IServiceCollection AddMockHttpClient(this IServiceCollection services) - { - static HttpResponseMessage GetMockJsonResponse(string response) - => new() - { - Content = new StringContent( - response, - Encoding.UTF8, - Constants.MediaType.Json - ) - }; - - static MockHttpClient CreateClient() - => new ( - request => request switch - { - { - Method.Method: Constants.Request.Method.Get, - RequestUri.AbsoluteUri: Constants.Request.Uri.Tenants - } => GetMockJsonResponse(Constants.Response.Json.TenantsServicePrinciple), - - { - Method.Method: Constants.Request.Method.Get, - RequestUri.AbsoluteUri: Constants.Request.Uri.GraphOrg - } => GetMockJsonResponse(Constants.Response.Json.GraphOrg), - - { - Method.Method: Constants.Request.Method.Get, - RequestUri.AbsoluteUri: Constants.Request.Uri.Subscriptions - } => GetMockJsonResponse(Constants.Response.Json.Subscriptions), - - { - Method.Method: Constants.Request.Method.Get, - RequestUri.AbsoluteUri: Constants.Request.Uri.Subscription1.ResourceGroups - } => GetMockJsonResponse(Constants.Response.Json.Subscription1.ResourceGroups), - - { - Method.Method: Constants.Request.Method.Get, - RequestUri.AbsoluteUri: Constants.Request.Uri.Subscription2.ResourceGroups - } => GetMockJsonResponse(Constants.Response.Json.Subscription2.ResourceGroups), - - { - Method.Method: Constants.Request.Method.Get, - RequestUri.AbsoluteUri: Constants.Request.Uri.Subscription1.ResourceGroup1.Resources - } => GetMockJsonResponse(Constants.Response.Json.Subscription1.ResourceGroup1.Resources), - - { - Method.Method: Constants.Request.Method.Get, - RequestUri.AbsoluteUri: Constants.Request.Uri.Subscription1.ResourceGroup2.Resources - } => GetMockJsonResponse(Constants.Response.Json.Subscription1.ResourceGroup2.Resources), - - { - Method.Method: Constants.Request.Method.Get, - RequestUri.AbsoluteUri: Constants.Request.Uri.Subscription1.ResourceGroup3.Resources - } => GetMockJsonResponse(Constants.Response.Json.Subscription1.ResourceGroup3.Resources), - - { - Method.Method: Constants.Request.Method.Get, - RequestUri.AbsoluteUri: Constants.Request.Uri.Subscription2.ResourceGroup1.Resources - } => GetMockJsonResponse(Constants.Response.Json.Subscription2.ResourceGroup1.Resources), - - { - Method.Method: Constants.Request.Method.Get, - RequestUri.AbsoluteUri: Constants.Request.Uri.Subscription1.ResourceGroup1.Site.Config - } => GetMockJsonResponse(Constants.Response.Json.Subscription1.ResourceGroup1.Site.Config), - - { - Method.Method: Constants.Request.Method.Get, - RequestUri.AbsoluteUri: Constants.Request.Uri.Subscription1.ResourceGroup2.Site.Config - } => GetMockJsonResponse(Constants.Response.Json.Subscription1.ResourceGroup2.Site.Config), - - { - Method.Method: Constants.Request.Method.Get, - RequestUri.AbsoluteUri: Constants.Request.Uri.Subscription1.ResourceGroup3.Site.Config - } => GetMockJsonResponse(Constants.Response.Json.Subscription1.ResourceGroup3.Site.Config), - - { - Method.Method: Constants.Request.Method.Post, - RequestUri.AbsoluteUri: Constants.Request.Uri.Subscription1.ResourceGroup1.Site.Settings - } => GetMockJsonResponse(Constants.Response.Json.Subscription1.ResourceGroup1.Site.Settings), - - { - Method.Method: Constants.Request.Method.Post, - RequestUri.AbsoluteUri: Constants.Request.Uri.Subscription1.ResourceGroup2.Site.Settings - } => GetMockJsonResponse(Constants.Response.Json.Subscription1.ResourceGroup2.Site.Settings), - - { - Method.Method: Constants.Request.Method.Post, - RequestUri.AbsoluteUri: Constants.Request.Uri.Subscription1.ResourceGroup3.Site.Settings - } => GetMockJsonResponse(Constants.Response.Json.Subscription1.ResourceGroup3.Site.Settings), - - _ => new HttpResponseMessage - { - StatusCode = System.Net.HttpStatusCode.NotFound - } - } - ); - - return services - .AddSingleton( - _ => CreateClient() - ) - .AddSingleton( - _ => - { - var httpClientFactory = Substitute.For(); - httpClientFactory - .CreateClient(null!) - .ReturnsForAnyArgs(_ => CreateClient()); - - httpClientFactory - .CreateClient() - .Returns(_ => CreateClient()); - - return httpClientFactory; - } - );; - } } diff --git a/src/ARI.Tests/Fixture/ARIServiceProviderFixture.cs b/src/ARI.Tests/Fixture/ARIServiceProviderFixture.cs deleted file mode 100644 index 67ee71c..0000000 --- a/src/ARI.Tests/Fixture/ARIServiceProviderFixture.cs +++ /dev/null @@ -1,138 +0,0 @@ -using Azure.Core; - -namespace ARI.Tests.Fixture; - -public static class ARIServiceProviderFixture -{ - public static (T1, T2, T3, T4, T5, T6, T7) GetRequiredService( - Func? configure = null - ) where T1 : notnull - where T2 : notnull - where T3 : notnull - where T4 : notnull - where T5 : notnull - where T6 : notnull - where T7 : notnull - { - var provider = GetServiceProvider(configure); - return ( - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService() - ); - } - public static (T1, T2, T3, T4, T5, T6) GetRequiredService( - Func? configure = null - ) where T1 : notnull - where T2 : notnull - where T3 : notnull - where T4 : notnull - where T5 : notnull - where T6 : notnull - { - var provider = GetServiceProvider(configure); - return ( - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService() - ); - } - - public static (T1, T2, T3, T4, T5) GetRequiredService( - Func? configure = null - ) where T1 : notnull - where T2 : notnull - where T3 : notnull - where T4 : notnull - where T5 : notnull - { - var provider = GetServiceProvider(configure); - return ( - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService() - ); - } - - - - public static (T1, T2, T3, T4) GetRequiredService( - Func? configure = null - ) where T1 : notnull - where T2 : notnull - where T3 : notnull - where T4 : notnull - { - var provider = GetServiceProvider(configure); - return ( - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService() - ); - } - - public static (T1, T2, T3) GetRequiredService( - Func? configure = null - ) where T1 : notnull - where T2 : notnull - where T3 : notnull - { - var provider = GetServiceProvider(configure); - return ( - provider.GetRequiredService(), - provider.GetRequiredService(), - provider.GetRequiredService() - ); - } - - public static (T1, T2) GetRequiredService( - Func? configure = null - ) where T1 : notnull - where T2 : notnull - { - var provider = GetServiceProvider(configure); - return ( - provider.GetRequiredService(), - provider.GetRequiredService() - ); - } - - public static T GetRequiredService( - Func? configure = null - ) where T : notnull - => GetServiceProvider(configure) - .GetRequiredService(); - - public static ServiceProvider GetServiceProvider(Func? configure) - { - var serviceCollection = new ServiceCollection(); - - serviceCollection - .AddLogging() - .AddSingleton( - (tenantId, scope) => Task.FromResult(new AccessToken(nameof(AccessToken), DateTimeOffset.UtcNow.AddDays(1))) - ) - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddMockHttpClient(); - - return (configure?.Invoke(serviceCollection) ?? serviceCollection).BuildServiceProvider(); - } -} diff --git a/src/ARI.Tests/Fixture/ServiceProviderFixture.cs b/src/ARI.Tests/Fixture/ServiceProviderFixture.cs new file mode 100644 index 0000000..a6e8175 --- /dev/null +++ b/src/ARI.Tests/Fixture/ServiceProviderFixture.cs @@ -0,0 +1,25 @@ +using ARI.Tests; +using Azure.Core; +using Devlead.Testing.MockHttp; + +public static partial class ServiceProviderFixture +{ + static partial void InitServiceProvider(IServiceCollection services) + { + services + .AddLogging() + .AddSingleton( + (tenantId, scope) => Task.FromResult(new AccessToken(nameof(AccessToken), DateTimeOffset.UtcNow.AddDays(1))) + ) + .AddSingleton() + .AddSingleton() + .AddSingleton() + .AddSingleton() + .AddSingleton() + .AddSingleton() + .AddSingleton() + .AddSingleton() + .AddSingleton() + .AddMockHttpClient(); + } +} diff --git a/src/ARI.Tests/Resources/Routes.json b/src/ARI.Tests/Resources/Routes.json new file mode 100644 index 0000000..acca8e2 --- /dev/null +++ b/src/ARI.Tests/Resources/Routes.json @@ -0,0 +1,362 @@ +[ + { + "Request": { + "Methods": [ + { + "Method": "GET" + } + ], + "AbsoluteUri": "https://management.azure.com/tenants?api-version=2020-01-01" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "TenantsServicePrinciple.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + }, + { + "Request": { + "Methods": [ + { + "Method": "GET" + } + ], + "AbsoluteUri": "https://graph.microsoft.com/beta/organization/daea2e9b-847b-4c93-850d-2aa6f2d7af33" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "GraphOrg.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + }, + { + "Request": { + "Methods": [ + { + "Method": "GET" + } + ], + "AbsoluteUri": "https://management.azure.com/subscriptions?api-version=2020-01-01" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "Subscriptions.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + }, + { + "Request": { + "Methods": [ + { + "Method": "GET" + } + ], + "AbsoluteUri": "https://management.azure.com/subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourcegroups?api-version=2021-04-01" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "Subscription1_ResourceGroups.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + }, + { + "Request": { + "Methods": [ + { + "Method": "GET" + } + ], + "AbsoluteUri": "https://management.azure.com/subscriptions/72ac930a-f34e-42d8-b06d-dc2a9e12ed71/resourcegroups?api-version=2021-04-01" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "Subscription2_ResourceGroups.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + }, + { + "Request": { + "Methods": [ + { + "Method": "GET" + } + ], + "AbsoluteUri": "https://management.azure.com/subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-dev/resources?$expand=createdTime,changedTime,provisioningState&api-version=2021-04-01" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "Subscription1_ResourceGroup1_Resources.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + }, + { + "Request": { + "Methods": [ + { + "Method": "GET" + } + ], + "AbsoluteUri": "https://management.azure.com/subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-stg/resources?$expand=createdTime,changedTime,provisioningState&api-version=2021-04-01" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "Subscription1_ResourceGroup2_Resources.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + }, + { + "Request": { + "Methods": [ + { + "Method": "GET" + } + ], + "AbsoluteUri": "https://management.azure.com/subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-prd/resources?$expand=createdTime,changedTime,provisioningState&api-version=2021-04-01" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "Subscription1_ResourceGroup3_Resources.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + }, + { + "Request": { + "Methods": [ + { + "Method": "GET" + } + ], + "AbsoluteUri": "https://management.azure.com/subscriptions/72ac930a-f34e-42d8-b06d-dc2a9e12ed71/resourceGroups/common-dev/resources?$expand=createdTime,changedTime,provisioningState&api-version=2021-04-01" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "Subscription2_ResourceGroup1_Resources.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + }, + { + "Request": { + "Methods": [ + { + "Method": "GET" + } + ], + "AbsoluteUri": "https://management.azure.com/subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-dev/providers/Microsoft.Web/sites/lab-web-web-dev/config?api-version=2022-03-01" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "Subscription1_ResourceGroup1_Site_Config.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + }, + { + "Request": { + "Methods": [ + { + "Method": "GET" + } + ], + "AbsoluteUri": "https://management.azure.com/subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-stg/providers/Microsoft.Web/sites/lab-web-web-stg/config?api-version=2022-03-01" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "Subscription1_ResourceGroup2_Site_Config.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + }, + { + "Request": { + "Methods": [ + { + "Method": "GET" + } + ], + "AbsoluteUri": "https://management.azure.com/subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-prd/providers/Microsoft.Web/sites/lab-web-web-prd/config?api-version=2022-03-01" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "Subscription1_ResourceGroup3_Site_Config.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + }, + { + "Request": { + "Methods": [ + { + "Method": "POST" + } + ], + "AbsoluteUri": "https://management.azure.com/subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-dev/providers/Microsoft.Web/sites/lab-web-web-dev/config/appsettings/list?api-version=2022-03-01" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "Subscription1_ResourceGroup1_Site_Settings.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + }, + { + "Request": { + "Methods": [ + { + "Method": "POST" + } + ], + "AbsoluteUri": "https://management.azure.com/subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-stg/providers/Microsoft.Web/sites/lab-web-web-stg/config/appsettings/list?api-version=2022-03-01" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "Subscription1_ResourceGroup2_Site_Settings.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + }, + { + "Request": { + "Methods": [ + { + "Method": "POST" + } + ], + "AbsoluteUri": "https://management.azure.com/subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-prd/providers/Microsoft.Web/sites/lab-web-web-prd/config/appsettings/list?api-version=2022-03-01" + }, + "Responses": [ + { + "RequestHeaders": {}, + "ContentResource": "Subscription1_ResourceGroup3_Site_Settings.json", + "ContentType": "application/json", + "ContentHeaders": {}, + "StatusCode": 200 + } + ], + "Authorization": { + "Authorization": [ + "Bearer AccessToken" + ] + } + } +] diff --git a/src/ARI.Tests/Resources/Subscription1_ResourceGroup1_Resources.json b/src/ARI.Tests/Resources/Subscription1_ResourceGroup1_Resources.json index fc0c421..6cfee57 100644 --- a/src/ARI.Tests/Resources/Subscription1_ResourceGroup1_Resources.json +++ b/src/ARI.Tests/Resources/Subscription1_ResourceGroup1_Resources.json @@ -323,6 +323,20 @@ "Environment": "dev" }, "type": "Microsoft.Web/staticSites" + }, + { + "changedTime": "2022-11-21T12:03:51.6365323Z", + "createdTime": "2022-11-21T11:53:50.1716015Z", + "id": "/subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-dev/providers/Microsoft.Storage/storageAccounts/emptytagstorage", + "location": "westeurope", + "managedBy": "", + "name": "emptytagstorage", + "properties": {}, + "provisioningState": "Succeeded", + "tags": { + "test": "" + }, + "type": "Microsoft.Storage/storageAccounts" } ] } diff --git a/src/ARI.Tests/Resources/TenantsUser.json b/src/ARI.Tests/Resources/TenantsUser.json deleted file mode 100644 index a2bfba3..0000000 --- a/src/ARI.Tests/Resources/TenantsUser.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "value": [ - { - "id": "/tenants/a70a1586-9c4a-4373-b907-1d310660dbd1", - "tenantId": "a70a1586-9c4a-4373-b907-1d310660dbd1", - "countryCode": "US", - "displayName": "Test_Test_aad50", - "domains": [ - "aad50.ccsctp.net" - ], - "tenantCategory": "ManagedBy", - "defaultDomain": "aad50.ccsctp.net", - "tenantType": "AAD" - }, - { - "id": "/tenants/83abe5cd-bcc3-441a-bd86-e6a75360cecc", - "tenantId": "83abe5cd-bcc3-441a-bd86-e6a75360cecc", - "countryCode": "US", - "displayName": "Contoso Corp.", - "domains": [ - "auxteststagemanual.ccsctp.net" - ], - "tenantCategory": "Home", - "defaultDomain": "auxteststagemanual.ccsctp.net", - "tenantType": "AAD" - }, - { - "id": "/tenants/daea2e9b-847b-4c93-850d-2aa6f2d7af33", - "tenantId": "daea2e9b-847b-4c93-850d-2aa6f2d7af33", - "countryCode": "US", - "displayName": "TEST_TEST_RDV", - "domains": [ - "rdvmohoro.ccsctp.net", - "rdvmohoro.mail.ccsctp.net", - "rdvmohoro.com" - ], - "tenantCategory": "ProjectedBy", - "defaultDomain": "rdvmohoro.ccsctp.net", - "tenantType": "AAD", - "tenantBrandingLogoUrl": "logo1.logo.rdvmohoro.com" - } - ], - "nextLink": "..." -} \ No newline at end of file diff --git a/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_EmptyTagValue_UsesNoKeyDirectory.verified.txt b/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_EmptyTagValue_UsesNoKeyDirectory.verified.txt new file mode 100644 index 0000000..a7eeb57 --- /dev/null +++ b/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_EmptyTagValue_UsesNoKeyDirectory.verified.txt @@ -0,0 +1,1227 @@ +{ + Output: { + Path: /home/docs, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/Application0x20Insights0x20Smart0x20Detection, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/Application0x20Insights0x20Smart0x20Detection/index.md, + Exists: true, + Hidden: false, + Length: 1732 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/devops-azuresql-private-endpoint, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/devops-azuresql-private-endpoint/index.md, + Exists: true, + Hidden: false, + Length: 2275 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/devops-azuresql-private-endpoint.nic.c26f32ea-6270-47e3-815f-231edbca1634, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/devops-azuresql-private-endpoint.nic.c26f32ea-6270-47e3-815f-231edbca1634/index.md, + Exists: true, + Hidden: false, + Length: 2358 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/emptytagstorage, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/emptytagstorage/index.md, + Exists: true, + Hidden: false, + Length: 1829 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/Failure0x20Anomalies0x20-0x20lab-appi-dev, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/Failure0x20Anomalies0x20-0x20lab-appi-dev/index.md, + Exists: true, + Hidden: false, + Length: 1743 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-appi-dev, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-appi-dev/index.md, + Exists: true, + Hidden: false, + Length: 2230 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-asp-dev, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-asp-dev/index.md, + Exists: true, + Hidden: false, + Length: 3189 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-devops-sql-dev, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-devops-sql-dev/DevOps, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-devops-sql-dev/DevOps/index.md, + Exists: true, + Hidden: false, + Length: 2949 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-devops-sql-dev/master, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-devops-sql-dev/master/index.md, + Exists: true, + Hidden: false, + Length: 2402 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-devops-sql-dev/SecondDatabase, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-devops-sql-dev/SecondDatabase/index.md, + Exists: true, + Hidden: false, + Length: 2966 + } + ] + } + ], + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-devops-sql-dev/index.md, + Exists: true, + Hidden: false, + Length: 2234 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-docs-stapp-dev, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-docs-stapp-dev/index.md, + Exists: true, + Hidden: false, + Length: 2793 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-kv-dev, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-kv-dev/index.md, + Exists: true, + Hidden: false, + Length: 2223 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-log-dev, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-log-dev/index.md, + Exists: true, + Hidden: false, + Length: 2240 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-srch-dev, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-srch-dev/index.md, + Exists: true, + Hidden: false, + Length: 2650 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-vnet-dev, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-vnet-dev/index.md, + Exists: true, + Hidden: false, + Length: 2235 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-web-web-dev, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-web-web-dev/index.md, + Exists: true, + Hidden: false, + Length: 3883 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/labdevecdo, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/labdevecdo/index.md, + Exists: true, + Hidden: false, + Length: 2785 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/privatelink.database.windows.net, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/privatelink.database.windows.net/privatelink.database.windows.net-link, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/privatelink.database.windows.net/privatelink.database.windows.net-link/index.md, + Exists: true, + Hidden: false, + Length: 2371 + } + ] + } + ], + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/privatelink.database.windows.net/index.md, + Exists: true, + Hidden: false, + Length: 2275 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/web.dev.ecdo.azurevoodoo.net-lab-asp-dev, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/web.dev.ecdo.azurevoodoo.net-lab-asp-dev/index.md, + Exists: true, + Hidden: false, + Length: 1736 + } + ] + } + ], + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/index.md, + Exists: true, + Hidden: false, + Length: 5173 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/Application0x20Insights0x20Smart0x20Detection, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/Application0x20Insights0x20Smart0x20Detection/index.md, + Exists: true, + Hidden: false, + Length: 1732 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/devops-azuresql-private-endpoint, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/devops-azuresql-private-endpoint/index.md, + Exists: true, + Hidden: false, + Length: 2275 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/devops-azuresql-private-endpoint.nic.c26f32ea-6270-47e3-815f-231edbca1634, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/devops-azuresql-private-endpoint.nic.c26f32ea-6270-47e3-815f-231edbca1634/index.md, + Exists: true, + Hidden: false, + Length: 2358 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/Failure0x20Anomalies0x20-0x20lab-appi-prd, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/Failure0x20Anomalies0x20-0x20lab-appi-prd/index.md, + Exists: true, + Hidden: false, + Length: 1743 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-appi-prd, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-appi-prd/index.md, + Exists: true, + Hidden: false, + Length: 2230 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-asp-prd, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-asp-prd/index.md, + Exists: true, + Hidden: false, + Length: 3189 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-docs-stapp-prd, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-docs-stapp-prd/index.md, + Exists: true, + Hidden: false, + Length: 2792 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-kv-prd, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-kv-prd/index.md, + Exists: true, + Hidden: false, + Length: 2222 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-log-prd, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-log-prd/index.md, + Exists: true, + Hidden: false, + Length: 2239 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-prdops-sql-prd, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-prdops-sql-prd/DevOps, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-prdops-sql-prd/DevOps/index.md, + Exists: true, + Hidden: false, + Length: 2950 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-prdops-sql-prd/master, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-prdops-sql-prd/master/index.md, + Exists: true, + Hidden: false, + Length: 2402 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-prdops-sql-prd/SecondDatabase, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-prdops-sql-prd/SecondDatabase/index.md, + Exists: true, + Hidden: false, + Length: 2966 + } + ] + } + ], + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-prdops-sql-prd/index.md, + Exists: true, + Hidden: false, + Length: 2235 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-srch-prd, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-srch-prd/index.md, + Exists: true, + Hidden: false, + Length: 2650 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-vnet-prd, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-vnet-prd/index.md, + Exists: true, + Hidden: false, + Length: 2235 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-web-web-prd, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/lab-web-web-prd/index.md, + Exists: true, + Hidden: false, + Length: 3883 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/labdevecdo, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/labdevecdo/index.md, + Exists: true, + Hidden: false, + Length: 2785 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/privatelink.database.windows.net, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/privatelink.database.windows.net/privatelink.database.windows.net-link, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/privatelink.database.windows.net/privatelink.database.windows.net-link/index.md, + Exists: true, + Hidden: false, + Length: 2371 + } + ] + } + ], + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/privatelink.database.windows.net/index.md, + Exists: true, + Hidden: false, + Length: 2275 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/web.dev.ecdo.azurevoodoo.net-lab-asp-prd, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/web.dev.ecdo.azurevoodoo.net-lab-asp-prd/index.md, + Exists: true, + Hidden: false, + Length: 1736 + } + ] + } + ], + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/index.md, + Exists: true, + Hidden: false, + Length: 5066 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/Application0x20Insights0x20Smart0x20Detection, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/Application0x20Insights0x20Smart0x20Detection/index.md, + Exists: true, + Hidden: false, + Length: 1732 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/devops-azuresql-private-endpoint, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/devops-azuresql-private-endpoint/index.md, + Exists: true, + Hidden: false, + Length: 2275 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/devops-azuresql-private-endpoint.nic.c26f32ea-6270-47e3-815f-231edbca1634, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/devops-azuresql-private-endpoint.nic.c26f32ea-6270-47e3-815f-231edbca1634/index.md, + Exists: true, + Hidden: false, + Length: 2358 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/Failure0x20Anomalies0x20-0x20lab-appi-stg, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/Failure0x20Anomalies0x20-0x20lab-appi-stg/index.md, + Exists: true, + Hidden: false, + Length: 1743 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-appi-stg, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-appi-stg/index.md, + Exists: true, + Hidden: false, + Length: 2230 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-asp-stg, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-asp-stg/index.md, + Exists: true, + Hidden: false, + Length: 3189 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-docs-stapp-stg, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-docs-stapp-stg/index.md, + Exists: true, + Hidden: false, + Length: 2792 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-kv-stg, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-kv-stg/index.md, + Exists: true, + Hidden: false, + Length: 2222 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-log-stg, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-log-stg/index.md, + Exists: true, + Hidden: false, + Length: 2239 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-srch-stg, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-srch-stg/index.md, + Exists: true, + Hidden: false, + Length: 2650 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-stgops-sql-stg, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-stgops-sql-stg/DevOps, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-stgops-sql-stg/DevOps/index.md, + Exists: true, + Hidden: false, + Length: 2950 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-stgops-sql-stg/master, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-stgops-sql-stg/master/index.md, + Exists: true, + Hidden: false, + Length: 2402 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-stgops-sql-stg/SecondDatabase, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-stgops-sql-stg/SecondDatabase/index.md, + Exists: true, + Hidden: false, + Length: 2966 + } + ] + } + ], + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-stgops-sql-stg/index.md, + Exists: true, + Hidden: false, + Length: 2235 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-vnet-stg, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-vnet-stg/index.md, + Exists: true, + Hidden: false, + Length: 2235 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-web-web-stg, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/lab-web-web-stg/index.md, + Exists: true, + Hidden: false, + Length: 3883 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/labdevecdo, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/labdevecdo/index.md, + Exists: true, + Hidden: false, + Length: 2785 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/privatelink.database.windows.net, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/privatelink.database.windows.net/privatelink.database.windows.net-link, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/privatelink.database.windows.net/privatelink.database.windows.net-link/index.md, + Exists: true, + Hidden: false, + Length: 2371 + } + ] + } + ], + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/privatelink.database.windows.net/index.md, + Exists: true, + Hidden: false, + Length: 2275 + } + ] + }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/web.dev.ecdo.azurevoodoo.net-lab-asp-stg, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/web.dev.ecdo.azurevoodoo.net-lab-asp-stg/index.md, + Exists: true, + Hidden: false, + Length: 1736 + } + ] + } + ], + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/index.md, + Exists: true, + Hidden: false, + Length: 5066 + } + ] + } + ], + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/index.md, + Exists: true, + Hidden: false, + Length: 2525 + } + ] + }, + { + Path: /home/docs/72ac930a-f34e-42d8-b06d-dc2a9e12ed71, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/72ac930a-f34e-42d8-b06d-dc2a9e12ed71/common-dev, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/72ac930a-f34e-42d8-b06d-dc2a9e12ed71/common-dev/commonacrdevecdo, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/72ac930a-f34e-42d8-b06d-dc2a9e12ed71/common-dev/commonacrdevecdo/index.md, + Exists: true, + Hidden: false, + Length: 2804 + } + ] + } + ], + Files: [ + { + Path: /home/docs/72ac930a-f34e-42d8-b06d-dc2a9e12ed71/common-dev/index.md, + Exists: true, + Hidden: false, + Length: 1828 + } + ] + } + ], + Files: [ + { + Path: /home/docs/72ac930a-f34e-42d8-b06d-dc2a9e12ed71/index.md, + Exists: true, + Hidden: false, + Length: 2132 + } + ] + }, + { + Path: /home/docs/billingdimension, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/billingdimension/common, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/billingdimension/common/index.md, + Exists: true, + Hidden: false, + Length: 671 + } + ] + }, + { + Path: /home/docs/billingdimension/lab, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/billingdimension/lab/index.md, + Exists: true, + Hidden: false, + Length: 15272 + } + ] + } + ], + Files: [ + { + Path: /home/docs/billingdimension/index.md, + Exists: true, + Hidden: false, + Length: 339 + } + ] + }, + { + Path: /home/docs/creator, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/creator/Bicep-common, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/creator/Bicep-common/index.md, + Exists: true, + Hidden: false, + Length: 668 + } + ] + }, + { + Path: /home/docs/creator/Bicep-lab, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/creator/Bicep-lab/index.md, + Exists: true, + Hidden: false, + Length: 15269 + } + ] + } + ], + Files: [ + { + Path: /home/docs/creator/index.md, + Exists: true, + Hidden: false, + Length: 354 + } + ] + }, + { + Path: /home/docs/dimension, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/dimension/common, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/dimension/common/index.md, + Exists: true, + Hidden: false, + Length: 664 + } + ] + }, + { + Path: /home/docs/dimension/lab, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/dimension/lab/index.md, + Exists: true, + Hidden: false, + Length: 15265 + } + ] + } + ], + Files: [ + { + Path: /home/docs/dimension/index.md, + Exists: true, + Hidden: false, + Length: 332 + } + ] + }, + { + Path: /home/docs/environment, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/environment/dev, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/environment/dev/index.md, + Exists: true, + Hidden: false, + Length: 15389 + } + ] + }, + { + Path: /home/docs/environment/prd, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/environment/prd/index.md, + Exists: true, + Hidden: false, + Length: 339 + } + ] + }, + { + Path: /home/docs/environment/stg, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/environment/stg/index.md, + Exists: true, + Hidden: false, + Length: 339 + } + ] + } + ], + Files: [ + { + Path: /home/docs/environment/index.md, + Exists: true, + Hidden: false, + Length: 342 + } + ] + }, + { + Path: /home/docs/has-tags, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/has-tags/false, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/has-tags/false/index.md, + Exists: true, + Hidden: false, + Length: 4390 + } + ] + }, + { + Path: /home/docs/has-tags/true, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/has-tags/true/index.md, + Exists: true, + Hidden: false, + Length: 16453 + } + ] + } + ], + Files: [ + { + Path: /home/docs/has-tags/index.md, + Exists: true, + Hidden: false, + Length: 331 + } + ] + }, + { + Path: /home/docs/tagkey1, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/tagkey1/tagValue1, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/tagkey1/tagValue1/index.md, + Exists: true, + Hidden: false, + Length: 511 + } + ] + } + ], + Files: [ + { + Path: /home/docs/tagkey1/index.md, + Exists: true, + Hidden: false, + Length: 322 + } + ] + }, + { + Path: /home/docs/tagkey2, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/tagkey2/tagValue2, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/tagkey2/tagValue2/index.md, + Exists: true, + Hidden: false, + Length: 511 + } + ] + } + ], + Files: [ + { + Path: /home/docs/tagkey2/index.md, + Exists: true, + Hidden: false, + Length: 322 + } + ] + }, + { + Path: /home/docs/test, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/test/NOKEY, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/test/NOKEY/index.md, + Exists: true, + Hidden: false, + Length: 396 + } + ] + } + ], + Files: [ + { + Path: /home/docs/test/index.md, + Exists: true, + Hidden: false, + Length: 311 + } + ] + } + ], + Files: [ + { + Path: /home/docs/index.md, + Exists: true, + Hidden: false, + Length: 2860 + } + ] + } +} \ No newline at end of file diff --git a/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=False_includeSiteApplicationsettings=False.verified.txt b/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=False_includeSiteApplicationsettings=False.verified.txt index ed62901..9c7e100 100644 --- a/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=False_includeSiteApplicationsettings=False.verified.txt +++ b/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=False_includeSiteApplicationsettings=False.verified.txt @@ -1,4 +1,4 @@ -{ +{ Output: { Path: /home/docs, Exists: true, @@ -58,6 +58,19 @@ } ] }, + { + Path: /home/docs/rdvmohoro.mail.ccsctp.net/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/emptytagstorage, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/rdvmohoro.mail.ccsctp.net/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/emptytagstorage/index.md, + Exists: true, + Hidden: false, + Length: 1829 + } + ] + }, { Path: /home/docs/rdvmohoro.mail.ccsctp.net/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/Failure0x20Anomalies0x20-0x20lab-appi-dev, Exists: true, @@ -124,7 +137,7 @@ Path: /home/docs/rdvmohoro.mail.ccsctp.net/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-devops-sql-dev/master/index.md, Exists: true, Hidden: false, - Length: 2401 + Length: 2402 } ] }, @@ -289,7 +302,7 @@ Path: /home/docs/rdvmohoro.mail.ccsctp.net/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/index.md, Exists: true, Hidden: false, - Length: 5066 + Length: 5173 } ] }, @@ -1108,7 +1121,7 @@ Path: /home/docs/rdvmohoro.mail.ccsctp.net/has-tags/true/index.md, Exists: true, Hidden: false, - Length: 16193 + Length: 16453 } ] } @@ -1177,6 +1190,34 @@ Length: 322 } ] + }, + { + Path: /home/docs/rdvmohoro.mail.ccsctp.net/test, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/rdvmohoro.mail.ccsctp.net/test/NOKEY, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/rdvmohoro.mail.ccsctp.net/test/NOKEY/index.md, + Exists: true, + Hidden: false, + Length: 396 + } + ] + } + ], + Files: [ + { + Path: /home/docs/rdvmohoro.mail.ccsctp.net/test/index.md, + Exists: true, + Hidden: false, + Length: 311 + } + ] } ], Files: [ @@ -1184,7 +1225,7 @@ Path: /home/docs/rdvmohoro.mail.ccsctp.net/index.md, Exists: true, Hidden: false, - Length: 3813 + Length: 4010 } ] } diff --git a/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=False_includeSiteApplicationsettings=True.verified.txt b/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=False_includeSiteApplicationsettings=True.verified.txt index 4d67a83..674d656 100644 --- a/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=False_includeSiteApplicationsettings=True.verified.txt +++ b/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=False_includeSiteApplicationsettings=True.verified.txt @@ -1,4 +1,4 @@ -{ +{ Output: { Path: /home/docs, Exists: true, @@ -58,6 +58,19 @@ } ] }, + { + Path: /home/docs/rdvmohoro.mail.ccsctp.net/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/emptytagstorage, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/rdvmohoro.mail.ccsctp.net/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/emptytagstorage/index.md, + Exists: true, + Hidden: false, + Length: 1829 + } + ] + }, { Path: /home/docs/rdvmohoro.mail.ccsctp.net/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/Failure0x20Anomalies0x20-0x20lab-appi-dev, Exists: true, @@ -124,7 +137,7 @@ Path: /home/docs/rdvmohoro.mail.ccsctp.net/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-devops-sql-dev/master/index.md, Exists: true, Hidden: false, - Length: 2401 + Length: 2402 } ] }, @@ -289,7 +302,7 @@ Path: /home/docs/rdvmohoro.mail.ccsctp.net/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/index.md, Exists: true, Hidden: false, - Length: 5066 + Length: 5173 } ] }, @@ -1108,7 +1121,7 @@ Path: /home/docs/rdvmohoro.mail.ccsctp.net/has-tags/true/index.md, Exists: true, Hidden: false, - Length: 16193 + Length: 16453 } ] } @@ -1177,6 +1190,34 @@ Length: 322 } ] + }, + { + Path: /home/docs/rdvmohoro.mail.ccsctp.net/test, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/rdvmohoro.mail.ccsctp.net/test/NOKEY, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/rdvmohoro.mail.ccsctp.net/test/NOKEY/index.md, + Exists: true, + Hidden: false, + Length: 396 + } + ] + } + ], + Files: [ + { + Path: /home/docs/rdvmohoro.mail.ccsctp.net/test/index.md, + Exists: true, + Hidden: false, + Length: 311 + } + ] } ], Files: [ @@ -1184,7 +1225,7 @@ Path: /home/docs/rdvmohoro.mail.ccsctp.net/index.md, Exists: true, Hidden: false, - Length: 3813 + Length: 4010 } ] } diff --git a/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=True_includeSiteApplicationsettings=False.verified.txt b/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=True_includeSiteApplicationsettings=False.verified.txt index 129c4d7..a7eeb57 100644 --- a/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=True_includeSiteApplicationsettings=False.verified.txt +++ b/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=True_includeSiteApplicationsettings=False.verified.txt @@ -1,4 +1,4 @@ -{ +{ Output: { Path: /home/docs, Exists: true, @@ -53,6 +53,19 @@ } ] }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/emptytagstorage, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/emptytagstorage/index.md, + Exists: true, + Hidden: false, + Length: 1829 + } + ] + }, { Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/Failure0x20Anomalies0x20-0x20lab-appi-dev, Exists: true, @@ -119,7 +132,7 @@ Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-devops-sql-dev/master/index.md, Exists: true, Hidden: false, - Length: 2401 + Length: 2402 } ] }, @@ -284,7 +297,7 @@ Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/index.md, Exists: true, Hidden: false, - Length: 5066 + Length: 5173 } ] }, @@ -1103,7 +1116,7 @@ Path: /home/docs/has-tags/true/index.md, Exists: true, Hidden: false, - Length: 16193 + Length: 16453 } ] } @@ -1172,6 +1185,34 @@ Length: 322 } ] + }, + { + Path: /home/docs/test, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/test/NOKEY, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/test/NOKEY/index.md, + Exists: true, + Hidden: false, + Length: 396 + } + ] + } + ], + Files: [ + { + Path: /home/docs/test/index.md, + Exists: true, + Hidden: false, + Length: 311 + } + ] } ], Files: [ @@ -1179,7 +1220,7 @@ Path: /home/docs/index.md, Exists: true, Hidden: false, - Length: 2663 + Length: 2860 } ] } diff --git a/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=True_includeSiteApplicationsettings=True.verified.txt b/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=True_includeSiteApplicationsettings=True.verified.txt index 8258d8a..393eb3e 100644 --- a/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=True_includeSiteApplicationsettings=True.verified.txt +++ b/src/ARI.Tests/Unit/Commands/InventoryCommandTests.ExecuteAsync_skipTenantOverview=True_includeSiteApplicationsettings=True.verified.txt @@ -1,4 +1,4 @@ -{ +{ Output: { Path: /home/docs, Exists: true, @@ -53,6 +53,19 @@ } ] }, + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/emptytagstorage, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/emptytagstorage/index.md, + Exists: true, + Hidden: false, + Length: 1829 + } + ] + }, { Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/Failure0x20Anomalies0x20-0x20lab-appi-dev, Exists: true, @@ -119,7 +132,7 @@ Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/lab-devops-sql-dev/master/index.md, Exists: true, Hidden: false, - Length: 2401 + Length: 2402 } ] }, @@ -284,7 +297,7 @@ Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/index.md, Exists: true, Hidden: false, - Length: 5066 + Length: 5173 } ] }, @@ -1103,7 +1116,7 @@ Path: /home/docs/has-tags/true/index.md, Exists: true, Hidden: false, - Length: 16193 + Length: 16453 } ] } @@ -1172,6 +1185,34 @@ Length: 322 } ] + }, + { + Path: /home/docs/test, + Exists: true, + Hidden: false, + Directories: [ + { + Path: /home/docs/test/NOKEY, + Exists: true, + Hidden: false, + Files: [ + { + Path: /home/docs/test/NOKEY/index.md, + Exists: true, + Hidden: false, + Length: 396 + } + ] + } + ], + Files: [ + { + Path: /home/docs/test/index.md, + Exists: true, + Hidden: false, + Length: 311 + } + ] } ], Files: [ @@ -1179,7 +1220,7 @@ Path: /home/docs/index.md, Exists: true, Hidden: false, - Length: 2663 + Length: 2860 } ] } diff --git a/src/ARI.Tests/Unit/Commands/InventoryCommandTests.cs b/src/ARI.Tests/Unit/Commands/InventoryCommandTests.cs index 6db85d3..fcb4817 100644 --- a/src/ARI.Tests/Unit/Commands/InventoryCommandTests.cs +++ b/src/ARI.Tests/Unit/Commands/InventoryCommandTests.cs @@ -17,7 +17,7 @@ public async Task ExecuteAsync(bool skipTenantOverview, bool includeSiteApplicat { // Given var context = new CommandContext( - Array.Empty(), + [], Substitute.For(), nameof(InventoryCommand), null @@ -37,7 +37,7 @@ public async Task ExecuteAsync(bool skipTenantOverview, bool includeSiteApplicat resourceGroupService, resourceService, markdownServices - ) = ARIServiceProviderFixture.GetRequiredService, TenantService, SubscriptionService, ResourceGroupService, ResourceService, IEnumerable>( + ) = ServiceProviderFixture.GetRequiredService, TenantService, SubscriptionService, ResourceGroupService, ResourceService, IEnumerable>( services => services .AddCakeFakes( fileSystem => fileSystem.CreateDirectory(settings.OutputPath) @@ -68,5 +68,65 @@ public async Task ExecuteAsync(bool skipTenantOverview, bool includeSiteApplicat // Then await Verify(result); } -} + /// + /// Empty tag values previously resolved to the same path as the tag index page + /// (parentPath.Combine("")), which collided with the already-open writer. + /// Empty values must use the NOKEY directory fallback. + /// + [Test] + public async Task ExecuteAsync_EmptyTagValue_UsesNoKeyDirectory() + { + // Given + var context = new CommandContext( + [], + Substitute.For(), + nameof(InventoryCommand), + null + ); + var settings = new InventorySettings + { + TenantId = Constants.Tenant.Id, + OutputPath = "/home/docs", + SkipTenantOverview = true + }; + var ( + cakeContext, + logger, + tenantService, + subscriptionService, + resourceGroupService, + resourceService, + markdownServices + ) = ServiceProviderFixture.GetRequiredService, TenantService, SubscriptionService, ResourceGroupService, ResourceService, IEnumerable>( + services => services + .AddCakeFakes( + fileSystem => fileSystem.CreateDirectory(settings.OutputPath) + ) + ); + + ICommand command = new InventoryCommand( + cakeContext, + logger, + tenantService, + subscriptionService, + resourceGroupService, + resourceService, + markdownServices + ); + + // When + var result = new + { + ExitCode = await command.ExecuteAsync( + context, + settings, + CancellationToken.None + ), + Output = cakeContext.FileSystem.FromDirectoryPath(settings.OutputPath) + }; + + // Then + await Verify(result); + } +} diff --git a/src/ARI.Tests/Unit/Services/ARM/ResourceGroupServiceTests.cs b/src/ARI.Tests/Unit/Services/ARM/ResourceGroupServiceTests.cs index 4f13d0d..ec3b0e6 100644 --- a/src/ARI.Tests/Unit/Services/ARM/ResourceGroupServiceTests.cs +++ b/src/ARI.Tests/Unit/Services/ARM/ResourceGroupServiceTests.cs @@ -1,4 +1,4 @@ -namespace ARI.Tests.Unit.Services.ARM; +namespace ARI.Tests.Unit.Services.ARM; [TestFixture] public class ResourceGroupServiceTests @@ -8,7 +8,7 @@ public class ResourceGroupServiceTests public async Task GetSubscriptions(string subscriptionId) { // Given - var resourceGroupService = ARIServiceProviderFixture + var resourceGroupService = ServiceProviderFixture .GetRequiredService(); // When diff --git a/src/ARI.Tests/Unit/Services/ARM/ResourceServiceTests.GetSubscriptions_subscriptionId=291bba3f-e0a5-47bc-a099-3bdcb2a50a05_resourceGroupName=lab-dev.verified.txt b/src/ARI.Tests/Unit/Services/ARM/ResourceServiceTests.GetSubscriptions_subscriptionId=291bba3f-e0a5-47bc-a099-3bdcb2a50a05_resourceGroupName=lab-dev.verified.txt index 9d0e341..3694b1e 100644 --- a/src/ARI.Tests/Unit/Services/ARM/ResourceServiceTests.GetSubscriptions_subscriptionId=291bba3f-e0a5-47bc-a099-3bdcb2a50a05_resourceGroupName=lab-dev.verified.txt +++ b/src/ARI.Tests/Unit/Services/ARM/ResourceServiceTests.GetSubscriptions_subscriptionId=291bba3f-e0a5-47bc-a099-3bdcb2a50a05_resourceGroupName=lab-dev.verified.txt @@ -1,4 +1,4 @@ -[ +[ { Id: /subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-dev/providers/microsoft.insights/actiongroups/Application Insights Smart Detection, Location: global, @@ -56,6 +56,25 @@ Environment: dev } }, + { + Id: /subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-dev/providers/Microsoft.Storage/storageAccounts/emptytagstorage, + Location: westeurope, + ManagedBy: , + Name: emptytagstorage, + CreatedTime: DateTimeOffset_7, + ChangedTime: DateTimeOffset_8, + ProvisioningState: Succeeded, + Type: Microsoft.Storage/storageAccounts, + PublicId: emptytagstorage, + Description: emptytagstorage, + TenantId: Guid_1, + SubscriptionId: Guid_2, + ResourceGroupName: lab-dev, + Order: 4, + Tags: { + test: + } + }, { Id: /subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-dev/providers/microsoft.alertsmanagement/smartDetectorAlertRules/Failure Anomalies - lab-appi-dev, Location: global, @@ -69,7 +88,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 4 + Order: 5 }, { Id: /subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-dev/providers/Microsoft.Insights/components/lab-appi-dev, @@ -84,7 +103,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 5, + Order: 6, Tags: { BillingDimension: lab, Creator: Bicep-lab, @@ -112,7 +131,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 6, + Order: 7, Tags: { BillingDimension: lab, Creator: Bicep-lab, @@ -133,7 +152,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 7, + Order: 8, Tags: { BillingDimension: lab, Creator: Bicep-lab, @@ -159,7 +178,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 8, + Order: 9, Tags: { BillingDimension: lab, Creator: Bicep-lab, @@ -186,7 +205,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 9 + Order: 10 }, { Id: /subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/resourceGroups/lab-dev/providers/Microsoft.Sql/servers/lab-devops-sql-dev/databases/SecondDatabase, @@ -206,7 +225,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 10, + Order: 11, Tags: { BillingDimension: lab, Creator: Bicep-lab, @@ -231,7 +250,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 11, + Order: 12, Tags: { BillingDimension: lab, Creator: Bicep-lab, @@ -252,7 +271,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 12, + Order: 13, Tags: { BillingDimension: lab, Creator: Bicep-lab, @@ -273,7 +292,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 13, + Order: 14, Tags: { BillingDimension: lab, Creator: Bicep-lab, @@ -297,7 +316,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 14, + Order: 15, Tags: { BillingDimension: lab, Creator: Bicep-lab, @@ -318,7 +337,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 15, + Order: 16, Tags: { BillingDimension: lab, Creator: Bicep-lab, @@ -339,7 +358,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 16, + Order: 17, Tags: { BillingDimension: lab, Creator: Bicep-lab, @@ -364,7 +383,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 17, + Order: 18, Tags: { BillingDimension: lab, Creator: Bicep-lab, @@ -385,7 +404,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 18, + Order: 19, Tags: { BillingDimension: lab, Creator: Bicep-lab, @@ -406,7 +425,7 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 19, + Order: 20, Tags: { BillingDimension: lab, Creator: Bicep-lab, @@ -427,6 +446,6 @@ TenantId: Guid_1, SubscriptionId: Guid_2, ResourceGroupName: lab-dev, - Order: 20 + Order: 21 } ] \ No newline at end of file diff --git a/src/ARI.Tests/Unit/Services/ARM/ResourceServiceTests.cs b/src/ARI.Tests/Unit/Services/ARM/ResourceServiceTests.cs index 0696759..35001b1 100644 --- a/src/ARI.Tests/Unit/Services/ARM/ResourceServiceTests.cs +++ b/src/ARI.Tests/Unit/Services/ARM/ResourceServiceTests.cs @@ -1,4 +1,4 @@ -namespace ARI.Tests.Unit.Services.ARM; +namespace ARI.Tests.Unit.Services.ARM; [TestFixture] public class ResourceServiceTests @@ -10,7 +10,7 @@ public class ResourceServiceTests public async Task GetSubscriptions(string subscriptionId, string resourceGroupName) { // Given - var resourceService = ARIServiceProviderFixture + var resourceService = ServiceProviderFixture .GetRequiredService(); // When diff --git a/src/ARI.Tests/Unit/Services/ARM/SubscriptionServiceTests.cs b/src/ARI.Tests/Unit/Services/ARM/SubscriptionServiceTests.cs index cc73246..769fb59 100644 --- a/src/ARI.Tests/Unit/Services/ARM/SubscriptionServiceTests.cs +++ b/src/ARI.Tests/Unit/Services/ARM/SubscriptionServiceTests.cs @@ -1,4 +1,4 @@ -namespace ARI.Tests.Unit.Services.ARM; +namespace ARI.Tests.Unit.Services.ARM; [TestFixture] public class SubscriptionServiceTests @@ -7,7 +7,7 @@ public class SubscriptionServiceTests public async Task GetSubscriptions() { // Given - var subscriptionService = ARIServiceProviderFixture + var subscriptionService = ServiceProviderFixture .GetRequiredService(); // When diff --git a/src/ARI.Tests/Unit/Services/ARM/TenantServiceTests.cs b/src/ARI.Tests/Unit/Services/ARM/TenantServiceTests.cs index d3c5d4b..cfb8240 100644 --- a/src/ARI.Tests/Unit/Services/ARM/TenantServiceTests.cs +++ b/src/ARI.Tests/Unit/Services/ARM/TenantServiceTests.cs @@ -1,4 +1,4 @@ -namespace ARI.Tests.Unit.Services.ARM; +namespace ARI.Tests.Unit.Services.ARM; [TestFixture] public class TenantServiceTests @@ -7,7 +7,7 @@ public class TenantServiceTests public async Task GetTenant() { // Given - var tenantService = ARIServiceProviderFixture + var tenantService = ServiceProviderFixture .GetRequiredService(); // When diff --git a/src/ARI.Tests/Unit/Services/ARM/TokenServiceTests.cs b/src/ARI.Tests/Unit/Services/ARM/TokenServiceTests.cs index 4897e50..64883a0 100644 --- a/src/ARI.Tests/Unit/Services/ARM/TokenServiceTests.cs +++ b/src/ARI.Tests/Unit/Services/ARM/TokenServiceTests.cs @@ -1,4 +1,4 @@ -using ARI.Models.Tenant.Subscription; +using ARI.Models.Tenant.Subscription; using ARI.Models; using ARI.Models.Tenant; using ARI.Models.Graph; @@ -13,7 +13,7 @@ public class TokenServiceTests public async Task ARMHttpClientGetAsync(string url) { // Given - var tokenService = ARIServiceProviderFixture + var tokenService = ServiceProviderFixture .GetRequiredService(); // When @@ -30,7 +30,7 @@ public async Task ARMHttpClientGetAsync(string url) public async Task GraphHttpClientGetAsync(string url) { // Given - var tokenService = ARIServiceProviderFixture + var tokenService = ServiceProviderFixture .GetRequiredService(); // When diff --git a/src/ARI.Tests/Unit/Services/ARM/WebAppConfigServiceTests.cs b/src/ARI.Tests/Unit/Services/ARM/WebAppConfigServiceTests.cs index c1d4457..4983cd0 100644 --- a/src/ARI.Tests/Unit/Services/ARM/WebAppConfigServiceTests.cs +++ b/src/ARI.Tests/Unit/Services/ARM/WebAppConfigServiceTests.cs @@ -1,4 +1,4 @@ -namespace ARI.Tests.Unit.Services.ARM; +namespace ARI.Tests.Unit.Services.ARM; [TestFixture] public class WebAppConfigServiceTests @@ -9,7 +9,7 @@ public class WebAppConfigServiceTests public async Task GetWebAppConfig(string subscriptionId, string resourceGroupName, string siteName) { // Given - var webAppConfigService = ARIServiceProviderFixture + var webAppConfigService = ServiceProviderFixture .GetRequiredService(); // When diff --git a/src/ARI.Tests/Unit/Services/ARM/WebAppSettingsServiceTests.cs b/src/ARI.Tests/Unit/Services/ARM/WebAppSettingsServiceTests.cs index 8e40178..8a051cf 100644 --- a/src/ARI.Tests/Unit/Services/ARM/WebAppSettingsServiceTests.cs +++ b/src/ARI.Tests/Unit/Services/ARM/WebAppSettingsServiceTests.cs @@ -1,4 +1,4 @@ -namespace ARI.Tests.Unit.Services.ARM; +namespace ARI.Tests.Unit.Services.ARM; [TestFixture] public class WebAppSettingsServiceTests @@ -9,7 +9,7 @@ public class WebAppSettingsServiceTests public async Task GetWebAppSettings(string subscriptionId, string resourceGroupName, string siteName) { // Given - var webAppSettingsService = ARIServiceProviderFixture + var webAppSettingsService = ServiceProviderFixture .GetRequiredService(); // When diff --git a/src/ARI.Tests/Unit/Services/AzureTokenServiceTests.cs b/src/ARI.Tests/Unit/Services/AzureTokenServiceTests.cs index b9c92c6..9dd1e85 100644 --- a/src/ARI.Tests/Unit/Services/AzureTokenServiceTests.cs +++ b/src/ARI.Tests/Unit/Services/AzureTokenServiceTests.cs @@ -1,4 +1,4 @@ -namespace ARI.Tests.Unit.Services; +namespace ARI.Tests.Unit.Services; [TestFixture] public class AzureTokenServiceTests @@ -7,7 +7,7 @@ public class AzureTokenServiceTests public async Task GetToken() { // Given - var azureTokenService = ARIServiceProviderFixture + var azureTokenService = ServiceProviderFixture .GetRequiredService(); // When