Skip to content

Commit 1823554

Browse files
authored
.Net MEVD: More Conformance tests (#10944)
- introduce CollectionConformanceTests - introduce RecordConformanceTests - make GenerateNextKey thread-safe - make sure the tests don't create collection if there is no need to - implement the tests for Postgres, SQL Server and Redis (partially) contributes to #10194 and #10882 and #10883
1 parent 28e9d11 commit 1823554

27 files changed

Lines changed: 789 additions & 120 deletions

‎dotnet/src/VectorDataIntegrationTests/PostgresIntegrationTests/CRUD/PostgresBatchConformanceTests.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace PostgresIntegrationTests.CRUD;
88

9-
public class PostgresBatchConformanceTests(PostgresFixture fixture)
10-
: BatchConformanceTests<string>(fixture), IClassFixture<PostgresFixture>
9+
public class PostgresBatchConformanceTests(PostgresSimpleModelFixture fixture)
10+
: BatchConformanceTests<string>(fixture), IClassFixture<PostgresSimpleModelFixture>
1111
{
1212
}

‎dotnet/src/VectorDataIntegrationTests/PostgresIntegrationTests/CRUD/PostgresGenericDataModelConformanceTests.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace PostgresIntegrationTests.CRUD;
88

9-
public class PostgresGenericDataModelConformanceTests(PostgresFixture fixture)
10-
: GenericDataModelConformanceTests<string>(fixture), IClassFixture<PostgresFixture>
9+
public class PostgresGenericDataModelConformanceTests(PostgresGenericDataModelFixture fixture)
10+
: GenericDataModelConformanceTests<string>(fixture), IClassFixture<PostgresGenericDataModelFixture>
1111
{
1212
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
3+
using PostgresIntegrationTests.Support;
4+
using VectorDataSpecificationTests.CRUD;
5+
using Xunit;
6+
7+
namespace PostgresIntegrationTests.CRUD;
8+
9+
public class PostgresRecordConformanceTests(PostgresSimpleModelFixture fixture)
10+
: RecordConformanceTests<string>(fixture), IClassFixture<PostgresSimpleModelFixture>
11+
{
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
3+
using PostgresIntegrationTests.Support;
4+
using VectorDataSpecificationTests.Collections;
5+
using Xunit;
6+
7+
namespace PostgresIntegrationTests.Collections;
8+
9+
public class PostgresCollectionConformanceTests(PostgresFixture fixture)
10+
: CollectionConformanceTests<string>(fixture), IClassFixture<PostgresFixture>
11+
{
12+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
3+
using VectorDataSpecificationTests.Support;
4+
5+
namespace PostgresIntegrationTests.Support;
6+
7+
public class PostgresGenericDataModelFixture : GenericDataModelFixture<string>
8+
{
9+
public override TestStore TestStore => PostgresTestStore.Instance;
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
3+
using VectorDataSpecificationTests.Support;
4+
5+
namespace PostgresIntegrationTests.Support;
6+
7+
public class PostgresSimpleModelFixture : SimpleModelFixture<string>
8+
{
9+
public override TestStore TestStore => PostgresTestStore.Instance;
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
3+
using RedisIntegrationTests.Support;
4+
using VectorDataSpecificationTests.CRUD;
5+
using Xunit;
6+
7+
namespace RedisIntegrationTests.CRUD;
8+
9+
public class RedisGenericDataModelConformanceTests(RedisGenericDataModelFixture fixture)
10+
: GenericDataModelConformanceTests<string>(fixture), IClassFixture<RedisGenericDataModelFixture>
11+
{
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
3+
using RedisIntegrationTests.Support;
4+
using VectorDataSpecificationTests.CRUD;
5+
using Xunit;
6+
7+
namespace RedisIntegrationTests.CRUD;
8+
9+
public class RedisRecordConformanceTests(RedisSimpleModelFixture fixture)
10+
: RecordConformanceTests<string>(fixture), IClassFixture<RedisSimpleModelFixture>
11+
{
12+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
3+
using VectorDataSpecificationTests.Support;
4+
5+
namespace RedisIntegrationTests.Support;
6+
7+
public class RedisFixture : VectorStoreFixture
8+
{
9+
public override TestStore TestStore => RedisTestStore.Instance;
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
3+
using VectorDataSpecificationTests.Support;
4+
5+
namespace RedisIntegrationTests.Support;
6+
7+
public class RedisGenericDataModelFixture : GenericDataModelFixture<string>
8+
{
9+
public override TestStore TestStore => RedisTestStore.Instance;
10+
}

0 commit comments

Comments
 (0)