Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Enable Weaviate integration tests #8627

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,20 @@ private static async Task<bool> CheckIfClusterReadyAsync(HttpClient httpClient)
private static async Task<string> SetupWeaviateContainerAsync(DockerClient client)
{
const string Image = "cr.weaviate.io/semitechnologies/weaviate";
const string Tag = "1.26.4";

await client.Images.CreateImageAsync(
new ImagesCreateParameters
{
FromImage = Image,
Tag = "latest",
Tag = Tag,
},
null,
new Progress<JSONMessage>());

var container = await client.Containers.CreateContainerAsync(new CreateContainerParameters()
{
Image = Image,
Image = $"{Image}:{Tag}",
HostConfig = new HostConfig()
{
PortBindings = new Dictionary<string, IList<PortBinding>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ namespace SemanticKernel.IntegrationTests.Connectors.Memory.Weaviate;
[Collection("WeaviateVectorStoreCollection")]
public sealed class WeaviateVectorStoreRecordCollectionTests(WeaviateVectorStoreFixture fixture)
{
private const string SkipReason = "Tests are disabled during batch/object request problem investigation.";

[Fact(Skip = SkipReason)]
[Fact]
public async Task ItCanCreateCollectionAsync()
{
// Arrange
Expand All @@ -28,7 +26,7 @@ public async Task ItCanCreateCollectionAsync()
Assert.True(await sut.CollectionExistsAsync());
}

[Theory(Skip = SkipReason)]
[Theory]
[InlineData("ExistingCollection", true)]
[InlineData("NonExistentCollection", false)]
public async Task ItCanCheckIfCollectionExistsAsync(string collectionName, bool collectionExists)
Expand All @@ -48,7 +46,7 @@ public async Task ItCanCheckIfCollectionExistsAsync(string collectionName, bool
Assert.Equal(collectionExists, result);
}

[Theory(Skip = SkipReason)]
[Theory]
[InlineData("CollectionWithVectorAndDefinition", true, true)]
[InlineData("CollectionWithVector", true, false)]
[InlineData("CollectionWithDefinition", false, true)]
Expand Down Expand Up @@ -98,7 +96,7 @@ public async Task ItCanUpsertAndGetRecordAsync(string collectionName, bool inclu
}
}

[Fact(Skip = SkipReason)]
[Fact]
public async Task ItCanDeleteCollectionAsync()
{
// Arrange
Expand All @@ -117,14 +115,16 @@ public async Task ItCanDeleteCollectionAsync()
Assert.False(await sut.CollectionExistsAsync());
}

[Fact(Skip = SkipReason)]
[Fact]
public async Task ItCanDeleteRecordAsync()
{
// Arrange
var hotelId = new Guid("55555555-5555-5555-5555-555555555555");

var sut = new WeaviateVectorStoreRecordCollection<WeaviateHotel>(fixture.HttpClient!, "TestDeleteRecord");

await sut.CreateCollectionAsync();

var record = this.CreateTestHotel(hotelId);

var upsertResult = await sut.UpsertAsync(record);
Expand All @@ -142,7 +142,7 @@ public async Task ItCanDeleteRecordAsync()
Assert.Null(getResult);
}

[Fact(Skip = SkipReason)]
[Fact]
public async Task ItCanUpsertAndGetAndDeleteBatchAsync()
{
// Arrange
Expand Down Expand Up @@ -176,7 +176,7 @@ public async Task ItCanUpsertAndGetAndDeleteBatchAsync()
Assert.Empty(getResults);
}

[Fact(Skip = SkipReason)]
[Fact]
public async Task ItCanUpsertRecordAsync()
{
// Arrange
Expand Down
Loading