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 e0ef5d997bcb5e02e07b7407731efab7cbeb843b Author: Pavel Tupitsyn <[email protected]> AuthorDate: Fri Jul 11 13:26:30 2025 +0300 wip test infra --- .../Query/NorthwindQueryIgniteFixture.cs | 28 ++++++++++++++++ .../Query/NorthwindWhereQueryIgniteTest.cs | 10 ++++++ .../IgniteNorthwindTestStoreFactory.cs | 26 +++++++++++++++ .../TestUtilities/IgniteTestStore.cs | 39 ++++++++++++++++++++++ .../TestUtilities/IgniteTestStoreFactory.cs | 39 ++++++++++++++++++++++ 5 files changed, 142 insertions(+) diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/Query/NorthwindQueryIgniteFixture.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/Query/NorthwindQueryIgniteFixture.cs new file mode 100644 index 00000000000..79f8a39b76d --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/Query/NorthwindQueryIgniteFixture.cs @@ -0,0 +1,28 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Apache.Ignite.EntityFrameworkCore.FunctionalTests.Query; + +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Query; +using Microsoft.EntityFrameworkCore.TestUtilities; +using TestUtilities; + +public class NorthwindQueryIgniteFixture<TModelCustomizer> : NorthwindQueryRelationalFixture<TModelCustomizer> + where TModelCustomizer : IModelCustomizer, new() +{ + protected override ITestStoreFactory TestStoreFactory => + IgniteNorthwindTestStoreFactory.Instance; +} diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/Query/NorthwindWhereQueryIgniteTest.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/Query/NorthwindWhereQueryIgniteTest.cs new file mode 100644 index 00000000000..7d2256d50a3 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/Query/NorthwindWhereQueryIgniteTest.cs @@ -0,0 +1,10 @@ +namespace Apache.Ignite.EntityFrameworkCore.FunctionalTests.Query; + +using Microsoft.EntityFrameworkCore.Query; +using Microsoft.EntityFrameworkCore.TestUtilities; + +public class NorthwindWhereQueryIgniteTest : NorthwindWhereQueryRelationalTestBase< + NorthwindQuerySqlServerFixture<NoopModelCustomizer>> +{ + +} diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/TestUtilities/IgniteNorthwindTestStoreFactory.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/TestUtilities/IgniteNorthwindTestStoreFactory.cs new file mode 100644 index 00000000000..46e9bae236f --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/TestUtilities/IgniteNorthwindTestStoreFactory.cs @@ -0,0 +1,26 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Apache.Ignite.EntityFrameworkCore.FunctionalTests.TestUtilities; + +public class IgniteNorthwindTestStoreFactory : IgniteTestStoreFactory +{ + private IgniteNorthwindTestStoreFactory() + { + // No-op. + } + + public static new IgniteNorthwindTestStoreFactory Instance { get; } = new(); +} diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/TestUtilities/IgniteTestStore.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/TestUtilities/IgniteTestStore.cs new file mode 100644 index 00000000000..5d762c7cf82 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/TestUtilities/IgniteTestStore.cs @@ -0,0 +1,39 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Apache.Ignite.EntityFrameworkCore.FunctionalTests.TestUtilities; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.TestUtilities; + +public class IgniteTestStore : RelationalTestStore +{ + public IgniteTestStore(string name, bool shared) + : base(name, shared) + { + } + + public override DbContextOptionsBuilder AddProviderOptions(DbContextOptionsBuilder builder) + { + // Ignite does not have any provider options for now. + return builder; + } + + public override void Clean(DbContext context) + { + // TODO: ?? + context.Database.EnsureDeleted(); + } +} diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/TestUtilities/IgniteTestStoreFactory.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/TestUtilities/IgniteTestStoreFactory.cs new file mode 100644 index 00000000000..721250058ad --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore.FunctionalTests/TestUtilities/IgniteTestStoreFactory.cs @@ -0,0 +1,39 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Apache.Ignite.EntityFrameworkCore.FunctionalTests.TestUtilities; + +using Microsoft.EntityFrameworkCore.TestUtilities; +using Microsoft.Extensions.DependencyInjection; + +public class IgniteTestStoreFactory : RelationalTestStoreFactory +{ + protected IgniteTestStoreFactory() + { + // No-op. + } + + public static IgniteTestStoreFactory Instance { get; } = new(); + + public override TestStore Create(string storeName) => new IgniteTestStore(storeName, shared: false); + + public override TestStore GetOrCreate(string storeName) => Create(storeName); + + public override IServiceCollection AddProviderServices(IServiceCollection serviceCollection) + { + // Ignite does not have any provider services for now. + return serviceCollection; + } +}
