You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2025/07/11 14:30:11 UTC
(ignite-3) 29/45: wip DropAllTables
This is an automated email from the ASF dual-hosted git repository.
ptupitsyn pushed a commit to branch ignite-22133-bak
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit 866e69d13fd4e6c16aa89dc7b01c6703fb2f3889
Author: Pavel Tupitsyn <pt...@apache.org>
AuthorDate: Fri Jul 11 13:41:41 2025 +0300
wip DropAllTables
---
.../TestUtilities/IgniteTestStore.cs | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/TestUtilities/IgniteTestStore.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/TestUtilities/IgniteTestStore.cs
index 357b82248d9..6fed871df75 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/TestUtilities/IgniteTestStore.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/TestUtilities/IgniteTestStore.cs
@@ -27,11 +27,23 @@ public class IgniteTestStore : RelationalTestStore
}
public override DbContextOptionsBuilder AddProviderOptions(DbContextOptionsBuilder builder) =>
- builder.UseIgnite("localhost:10942");
+ builder.UseIgnite(GetIgniteEndpoint());
- public override void Clean(DbContext context)
+ public override void Clean(DbContext context) => DropAllTables().GetAwaiter().GetResult();
+
+ private static async Task DropAllTables()
{
- // TODO: ??
- context.Database.EnsureDeleted();
+ // Drop all tables so that EnsureCreatedAsync works as expected and every test starts with a clean slate.
+ using var client = await IgniteClient.StartAsync(new(GetIgniteEndpoint()));
+
+ var tables = await client.Tables.GetTablesAsync();
+ var script = string.Join("\n", tables.Select(t => $"DROP TABLE {t.Name}; "));
+
+ if (!string.IsNullOrWhiteSpace(script))
+ {
+ await client.Sql.ExecuteScriptAsync(script);
+ }
}
+
+ private static string GetIgniteEndpoint() => "localhost:10942";
}