mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 16:42:50 -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:
@ -4,6 +4,7 @@ namespace Bit.Infrastructure.IntegrationTest;
|
||||
|
||||
public interface ITestDatabaseHelper
|
||||
{
|
||||
Database Info { get; }
|
||||
void ClearTracker();
|
||||
}
|
||||
|
||||
@ -11,11 +12,14 @@ public class EfTestDatabaseHelper : ITestDatabaseHelper
|
||||
{
|
||||
private readonly DatabaseContext _databaseContext;
|
||||
|
||||
public EfTestDatabaseHelper(DatabaseContext databaseContext)
|
||||
public EfTestDatabaseHelper(DatabaseContext databaseContext, Database database)
|
||||
{
|
||||
_databaseContext = databaseContext;
|
||||
Info = database;
|
||||
}
|
||||
|
||||
public Database Info { get; }
|
||||
|
||||
public void ClearTracker()
|
||||
{
|
||||
_databaseContext.ChangeTracker.Clear();
|
||||
@ -24,11 +28,13 @@ public class EfTestDatabaseHelper : ITestDatabaseHelper
|
||||
|
||||
public class DapperSqlServerTestDatabaseHelper : ITestDatabaseHelper
|
||||
{
|
||||
public DapperSqlServerTestDatabaseHelper()
|
||||
public DapperSqlServerTestDatabaseHelper(Database database)
|
||||
{
|
||||
|
||||
Info = database;
|
||||
}
|
||||
|
||||
public Database Info { get; }
|
||||
|
||||
public void ClearTracker()
|
||||
{
|
||||
// There are no tracked entities in Dapper SQL Server
|
||||
|
Reference in New Issue
Block a user