From 39556a46341353b0a5225d573dbdd80996dd7510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Pertus?= Date: Tue, 3 Jan 2023 16:04:51 +0100 Subject: [PATCH] fix tests --- Tests/Dotmim.Sync.Tests/HelperDatabase.cs | 58 +++++++++++++++++-- .../IntegrationTests/MySql/MySqlHttpTests.cs | 2 +- .../MySql/MySqlTcpConflictsTests.cs | 2 +- .../MySql/MySqlTcpFilterTests.cs | 2 +- .../IntegrationTests/MySql/MySqlTcpTests.cs | 2 +- .../Postgres/PostgresHttpTests.cs | 2 +- .../Postgres/PostgresTcpConflictsTests.cs | 2 +- .../Postgres/PostgresTcpFilterTests.cs | 2 +- .../Postgres/PostgresTcpTests.cs | 2 +- 9 files changed, 60 insertions(+), 14 deletions(-) diff --git a/Tests/Dotmim.Sync.Tests/HelperDatabase.cs b/Tests/Dotmim.Sync.Tests/HelperDatabase.cs index 38064072d..de21350b1 100644 --- a/Tests/Dotmim.Sync.Tests/HelperDatabase.cs +++ b/Tests/Dotmim.Sync.Tests/HelperDatabase.cs @@ -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 { @@ -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 + // } + //} } /// diff --git a/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlHttpTests.cs b/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlHttpTests.cs index 6c04da2d1..6c84bc14e 100644 --- a/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlHttpTests.cs +++ b/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlHttpTests.cs @@ -19,7 +19,7 @@ public class MySqlHttpTests : HttpTests { public override List ClientsType => new List - { ProviderType.MySql, ProviderType.Sql}; + { ProviderType.MySql, ProviderType.Sqlite}; public MySqlHttpTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output) { diff --git a/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlTcpConflictsTests.cs b/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlTcpConflictsTests.cs index 622f3cdd3..6fdc8ae22 100644 --- a/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlTcpConflictsTests.cs +++ b/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlTcpConflictsTests.cs @@ -19,7 +19,7 @@ namespace Dotmim.Sync.Tests.IntegrationTests public class MySqlTcpConflictsTests : TcpConflictsTests { public override List ClientsType => new List - { ProviderType.MySql, ProviderType.Sql}; + { ProviderType.MySql, ProviderType.Sqlite}; public MySqlTcpConflictsTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output) { diff --git a/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlTcpFilterTests.cs b/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlTcpFilterTests.cs index 3a3b1d266..faa7323fe 100644 --- a/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlTcpFilterTests.cs +++ b/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlTcpFilterTests.cs @@ -21,7 +21,7 @@ public class MySqlTcpFilterTests : TcpFilterTests { public override List ClientsType => new List - { ProviderType.MySql, ProviderType.Sql }; + { ProviderType.MySql, ProviderType.Sqlite}; public MySqlTcpFilterTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output) { diff --git a/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlTcpTests.cs b/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlTcpTests.cs index 4eba9be72..0055da84d 100644 --- a/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlTcpTests.cs +++ b/Tests/Dotmim.Sync.Tests/IntegrationTests/MySql/MySqlTcpTests.cs @@ -20,7 +20,7 @@ public class MySqlTcpTests : TcpTests { public override List ClientsType => new List - { ProviderType.MySql, ProviderType.Sql }; + { ProviderType.MySql, ProviderType.Sqlite}; public MySqlTcpTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output) { diff --git a/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresHttpTests.cs b/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresHttpTests.cs index 91bae8ac0..0c41d0370 100644 --- a/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresHttpTests.cs +++ b/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresHttpTests.cs @@ -19,7 +19,7 @@ public class PostgresHttpTests : HttpTests { public override List ClientsType => new List - { ProviderType.Postgres, ProviderType.Sql}; + { ProviderType.Postgres, ProviderType.Sqlite}; public PostgresHttpTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output) { diff --git a/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresTcpConflictsTests.cs b/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresTcpConflictsTests.cs index fdf7a516b..1d8bc8396 100644 --- a/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresTcpConflictsTests.cs +++ b/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresTcpConflictsTests.cs @@ -19,7 +19,7 @@ namespace Dotmim.Sync.Tests.IntegrationTests public class PostgresTcpConflictsTests : TcpConflictsTests { public override List ClientsType => new List - { ProviderType.Postgres, ProviderType.Sql}; + { ProviderType.Postgres, ProviderType.Sqlite}; public PostgresTcpConflictsTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output) { diff --git a/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresTcpFilterTests.cs b/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresTcpFilterTests.cs index a9818759d..f3f694c78 100644 --- a/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresTcpFilterTests.cs +++ b/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresTcpFilterTests.cs @@ -21,7 +21,7 @@ public class PostgresTcpFilterTests : TcpFilterTests { public override List ClientsType => new List - { ProviderType.Postgres, ProviderType.Sql }; + { ProviderType.Postgres, ProviderType.Sqlite}; public PostgresTcpFilterTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output) { diff --git a/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresTcpTests.cs b/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresTcpTests.cs index c095fe2c0..319653d38 100644 --- a/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresTcpTests.cs +++ b/Tests/Dotmim.Sync.Tests/IntegrationTests/Postgres/PostgresTcpTests.cs @@ -20,7 +20,7 @@ public class PostgresTcpTests : TcpTests { public override List ClientsType => new List - { ProviderType.Postgres, ProviderType.Sql, ProviderType.Sqlite }; + { ProviderType.Postgres, ProviderType.Sqlite}; public PostgresTcpTests(HelperProvider fixture, ITestOutputHelper output) : base(fixture, output) {