Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ await Define<Context>()
Assert.That(data.Keys, Is.SupersetOf(ExpectedKeys));

Assert.That(data["Host.Model"], Is.AnyOf("Container", "WindowsService", "Console"));
Assert.That(data["Persistence.Type"], Is.Not.Empty);
Assert.That(data["Persistence.BodyStorage.Type"], Is.Not.Empty);
Assert.That(data["Persistence.BodyStorage.Auth"], Is.AnyOf("ManagedIdentity", "SharedKeyOrSas", "IamRole", "StaticCredentials", "NotApplicable"));
Assert.That(data["Persistence.HostingSource"], Is.AnyOf("Probe", "Configuration", "ConnectionString", "None"));
Assert.That(data["Storage.Type"], Is.Not.Empty);
Assert.That(data["Storage.BodyStorage.Type"], Is.Not.Empty);
Assert.That(data["Storage.BodyStorage.Auth"], Is.AnyOf("ManagedIdentity", "SharedKeyOrSas", "IamRole", "StaticCredentials", "NotApplicable"));
Assert.That(data["Storage.HostingSource"], Is.AnyOf("Probe", "Configuration", "ConnectionString", "None"));
Assert.That(data["Security.Authentication"], Is.AnyOf("Enabled", "Disabled"));
Assert.That(data["Features.EmailNotifications"], Is.AnyOf("Enabled", "Disabled", "NotConfigured", "ReadFailed"));
Assert.That(int.Parse(data["Retention.ErrorHours"]), Is.GreaterThan(0));
Expand All @@ -79,13 +79,13 @@ await Define<Context>()
"Host.RuntimeVersion",
"Host.ProcessorCount",
"Host.AvailableMemoryGB",
"Persistence.Type",
"Persistence.Hosting",
"Persistence.ServerVersion",
"Persistence.HostingSource",
"Persistence.FullTextSearch",
"Persistence.BodyStorage.Type",
"Persistence.BodyStorage.Auth",
"Storage.Type",
"Storage.Hosting",
"Storage.ServerVersion",
"Storage.HostingSource",
"Storage.FullTextSearch",
"Storage.BodyStorage.Type",
"Storage.BodyStorage.Auth",
"Security.Authentication",
"Security.RoleBasedAuthorization",
"Security.Https",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public IEnumerable<EnvironmentDatum> GetData()

return
[
Value("Persistence.Type", () => hostingProbe.StorageName),
Deferred("Persistence.Hosting", async cancellationToken => (await Hosting(cancellationToken)).Hosting),
Deferred("Persistence.ServerVersion", async cancellationToken => (await Hosting(cancellationToken)).ServerVersion),
Deferred("Persistence.HostingSource", async cancellationToken => (await Hosting(cancellationToken)).Source),
Value("Persistence.FullTextSearch", () => settings.EnableFullTextSearchOnBodies ? "Enabled" : "Disabled"),
Value("Persistence.BodyStorage.Type", () => BodyStorageType(settings.BodyStorage)),
Value("Persistence.BodyStorage.Auth", () => BodyStorageAuth(settings.BodyStorage)),
Value("Storage.Type", () => hostingProbe.StorageName),
Deferred("Storage.Hosting", async cancellationToken => (await Hosting(cancellationToken)).Hosting),
Deferred("Storage.ServerVersion", async cancellationToken => (await Hosting(cancellationToken)).ServerVersion),
Deferred("Storage.HostingSource", async cancellationToken => (await Hosting(cancellationToken)).Source),
Value("Storage.FullTextSearch", () => settings.EnableFullTextSearchOnBodies ? "Enabled" : "Disabled"),
Value("Storage.BodyStorage.Type", () => BodyStorageType(settings.BodyStorage)),
Value("Storage.BodyStorage.Auth", () => BodyStorageAuth(settings.BodyStorage)),
Value("Limits.MaxBodySizeToStore", () => settings.BodyStorage.MaxBodySizeToStore.ToString(CultureInfo.InvariantCulture))
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ class RavenEnvironmentDataProvider(RavenPersisterSettings settings, IRavenDocume
{
public IEnumerable<EnvironmentDatum> GetData() =>
[
Value("Persistence.Type", () => "RavenDB"),
Value("Persistence.RavenServer", () => settings.UseEmbeddedServer ? "Embedded" : "External"),
Value("Persistence.Hosting", () => Hosting().Hosting),
Deferred("Persistence.ServerVersion", ServerVersion),
Value("Persistence.HostingSource", () => Hosting().Source),
Value("Persistence.FullTextSearch", () => settings.EnableFullTextSearchOnBodies ? "Enabled" : "Disabled"),
Value("Persistence.BodyStorage.Type", () => "RavenAttachments"),
Value("Persistence.BodyStorage.Auth", () => "NotApplicable")
Value("Storage.Type", () => "RavenDB"),
Value("Storage.RavenServer", () => settings.UseEmbeddedServer ? "Embedded" : "External"),
Value("Storage.Hosting", () => Hosting().Hosting),
Deferred("Storage.ServerVersion", ServerVersion),
Value("Storage.HostingSource", () => Hosting().Source),
Value("Storage.FullTextSearch", () => settings.EnableFullTextSearchOnBodies ? "Enabled" : "Disabled"),
Value("Storage.BodyStorage.Type", () => "RavenAttachments"),
Value("Storage.BodyStorage.Auth", () => "NotApplicable")
];

(string Hosting, string Source) Hosting()
Expand Down
22 changes: 11 additions & 11 deletions src/ServiceControl.Persistence.Tests/EFCore/EnvironmentDataTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public async Task Should_report_managed_identity_for_azure_blob_service_uri()

Assert.Multiple(() =>
{
Assert.That(data["Persistence.BodyStorage.Type"], Is.EqualTo("AzureBlob"));
Assert.That(data["Persistence.BodyStorage.Auth"], Is.EqualTo("ManagedIdentity"));
Assert.That(data["Storage.BodyStorage.Type"], Is.EqualTo("AzureBlob"));
Assert.That(data["Storage.BodyStorage.Auth"], Is.EqualTo("ManagedIdentity"));
});
}

Expand All @@ -67,7 +67,7 @@ public async Task Should_report_shared_key_for_azure_blob_connection_string()
Authentication = new AzureBlobSharedKeyAuthentication { ConnectionString = "UseDevelopmentStorage=true" }
});

Assert.That(data["Persistence.BodyStorage.Auth"], Is.EqualTo("SharedKeyOrSas"));
Assert.That(data["Storage.BodyStorage.Auth"], Is.EqualTo("SharedKeyOrSas"));
}

[Test]
Expand All @@ -77,8 +77,8 @@ public async Task Should_report_iam_role_when_s3_has_no_static_credentials()

Assert.Multiple(() =>
{
Assert.That(data["Persistence.BodyStorage.Type"], Is.EqualTo("S3"));
Assert.That(data["Persistence.BodyStorage.Auth"], Is.EqualTo("IamRole"));
Assert.That(data["Storage.BodyStorage.Type"], Is.EqualTo("S3"));
Assert.That(data["Storage.BodyStorage.Auth"], Is.EqualTo("IamRole"));
});
}

Expand All @@ -91,7 +91,7 @@ public async Task Should_report_static_credentials_when_s3_has_an_access_key()
Credentials = new S3StaticCredentials { AccessKeyId = "key", SecretAccessKey = "secret" }
});

Assert.That(data["Persistence.BodyStorage.Auth"], Is.EqualTo("StaticCredentials"));
Assert.That(data["Storage.BodyStorage.Auth"], Is.EqualTo("StaticCredentials"));
}

[Test]
Expand All @@ -101,8 +101,8 @@ public async Task Should_report_file_system_body_storage_as_not_applicable_for_a

Assert.Multiple(() =>
{
Assert.That(data["Persistence.BodyStorage.Type"], Is.EqualTo("FileSystem"));
Assert.That(data["Persistence.BodyStorage.Auth"], Is.EqualTo("NotApplicable"));
Assert.That(data["Storage.BodyStorage.Type"], Is.EqualTo("FileSystem"));
Assert.That(data["Storage.BodyStorage.Auth"], Is.EqualTo("NotApplicable"));
});
}

Expand All @@ -128,9 +128,9 @@ public async Task Should_fall_back_to_unknown_when_the_hosting_probe_fails()

Assert.Multiple(() =>
{
Assert.That(data["Persistence.Hosting"], Is.EqualTo("Unknown"));
Assert.That(data["Persistence.ServerVersion"], Is.EqualTo("Unknown"));
Assert.That(data["Persistence.HostingSource"], Is.EqualTo("None"));
Assert.That(data["Storage.Hosting"], Is.EqualTo("Unknown"));
Assert.That(data["Storage.ServerVersion"], Is.EqualTo("Unknown"));
Assert.That(data["Storage.HostingSource"], Is.EqualTo("None"));
});
}

Expand Down
Loading