mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
[PM-2444] Add Pipeline for Testing All Database Variants in CI (#2471)
* Add Pipeline * Fix Lint * Added a Change * Update Pipeline * Add Multi-Version Support * Use Profile Switch for each profile * Fix MySql * Debug MySql * Use Proper Seperator * Add Allow User Variables=true * Pipeline Work * Expand Config for Postgres * Change Config Key * Add Debug Step * Fix Debug Step * Fix Tests * Add Sleep * Fix Tests * Fix SQL Server Tests * Add Sqlite * Use Context Property * Fix Tests * Fix Test Logger * Update AccountRevisionDate Check * Fix Postgres Time Issues * Formatting and Pipeline Update * Remove Unneeded SqlServer Setting * Update .github/workflows/infrastructure-tests.yml Co-authored-by: mimartin12 <77340197+mimartin12@users.noreply.github.com> --------- Co-authored-by: mimartin12 <77340197+mimartin12@users.noreply.github.com>
This commit is contained in:
@ -1,17 +1,31 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Bit.Core.Enums;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Bit.Infrastructure.IntegrationTest;
|
||||
|
||||
public class Database
|
||||
{
|
||||
public SupportedDatabaseProviders Type { get; set; }
|
||||
public string ConnectionString { get; set; } = default!;
|
||||
public bool UseEf { get; set; }
|
||||
public bool Enabled { get; set; } = true;
|
||||
}
|
||||
|
||||
internal class TypedConfig
|
||||
{
|
||||
public Database[] Databases { get; set; } = default!;
|
||||
}
|
||||
|
||||
public static class ConfigurationExtensions
|
||||
{
|
||||
public static bool TryGetConnectionString(this IConfiguration config, string key, out string connectionString)
|
||||
public static Database[] GetDatabases(this IConfiguration config)
|
||||
{
|
||||
connectionString = config[key];
|
||||
if (string.IsNullOrEmpty(connectionString))
|
||||
var typedConfig = config.Get<TypedConfig>();
|
||||
if (typedConfig.Databases == null)
|
||||
{
|
||||
return false;
|
||||
return Array.Empty<Database>();
|
||||
}
|
||||
|
||||
return true;
|
||||
return typedConfig.Databases.Where(d => d.Enabled).ToArray();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user