Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mimetis committed Jan 3, 2023
1 parent 86e7e2d commit 39556a4
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 14 deletions.
58 changes: 52 additions & 6 deletions Tests/Dotmim.Sync.Tests/HelperDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ await policy.ExecuteAsync(async () =>
[DebuggerStepThrough]
public static void DropDatabase(ProviderType providerType, string dbName)
{
//// We don't care to drop the database on Azure, as the test itself will destroy the instance at the end
//if (Setup.IsOnAzureDev)
// return;
// We don't care to drop the database on Azure, as the test itself will destroy the instance at the end
if (Setup.IsOnAzureDev)
return;

try
{
Expand All @@ -256,12 +256,58 @@ public static void DropDatabase(ProviderType providerType, string dbName)
DropPostgresDatabase(dbName);
break;
}

Debug.WriteLine($"DB {dbName} dropped. ");
}
catch (Exception) { }
finally
catch (Exception ex)
{

Debug.WriteLine(ex.Message);
}

//var task = Task.Run(() =>
//{
// try
// {
// switch (providerType)
// {
// case ProviderType.Sql:
// DropSqlDatabase(dbName);
// break;
// case ProviderType.MySql:
// DropMySqlDatabase(dbName);
// break;
// case ProviderType.MariaDB:
// DropMariaDBDatabase(dbName);
// break;
// case ProviderType.Sqlite:
// DropSqliteDatabase(dbName);
// break;
// case ProviderType.Postgres:
// DropPostgresDatabase(dbName);
// break;
// }

// Debug.WriteLine($"DB {dbName} dropped. ");
// }
// catch (Exception ex)
// {
// Debug.WriteLine(ex.Message);
// }
//});

//if (!task.IsCompleted || task.IsFaulted)
//{
// try
// {
// // No need to resume on the original SynchronizationContext, so use ConfigureAwait(false)
// task.ConfigureAwait(false);
// }
// catch (Exception ex)
// {
// Debug.WriteLine(ex.Message);
// // Nothing to do here
// }
//}
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class MySqlHttpTests : HttpTests
{

public override List<ProviderType> ClientsType => new List<ProviderType>
{ ProviderType.MySql, ProviderType.Sql};
{ ProviderType.MySql, ProviderType.Sqlite};

public MySqlHttpTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Dotmim.Sync.Tests.IntegrationTests
public class MySqlTcpConflictsTests : TcpConflictsTests
{
public override List<ProviderType> ClientsType => new List<ProviderType>
{ ProviderType.MySql, ProviderType.Sql};
{ ProviderType.MySql, ProviderType.Sqlite};

public MySqlTcpConflictsTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class MySqlTcpFilterTests : TcpFilterTests
{

public override List<ProviderType> ClientsType => new List<ProviderType>
{ ProviderType.MySql, ProviderType.Sql };
{ ProviderType.MySql, ProviderType.Sqlite};

public MySqlTcpFilterTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class MySqlTcpTests : TcpTests
{

public override List<ProviderType> ClientsType => new List<ProviderType>
{ ProviderType.MySql, ProviderType.Sql };
{ ProviderType.MySql, ProviderType.Sqlite};

public MySqlTcpTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class PostgresHttpTests : HttpTests
{

public override List<ProviderType> ClientsType => new List<ProviderType>
{ ProviderType.Postgres, ProviderType.Sql};
{ ProviderType.Postgres, ProviderType.Sqlite};

public PostgresHttpTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Dotmim.Sync.Tests.IntegrationTests
public class PostgresTcpConflictsTests : TcpConflictsTests
{
public override List<ProviderType> ClientsType => new List<ProviderType>
{ ProviderType.Postgres, ProviderType.Sql};
{ ProviderType.Postgres, ProviderType.Sqlite};

public PostgresTcpConflictsTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class PostgresTcpFilterTests : TcpFilterTests
{

public override List<ProviderType> ClientsType => new List<ProviderType>
{ ProviderType.Postgres, ProviderType.Sql };
{ ProviderType.Postgres, ProviderType.Sqlite};

public PostgresTcpFilterTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class PostgresTcpTests : TcpTests
{

public override List<ProviderType> ClientsType => new List<ProviderType>
{ ProviderType.Postgres, ProviderType.Sql, ProviderType.Sqlite };
{ ProviderType.Postgres, ProviderType.Sqlite};

public PostgresTcpTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output)
{
Expand Down

0 comments on commit 39556a4

Please sign in to comment.