Skip to content

Commit

Permalink
.Net: Disable redis integration tests since they are intermittently f…
Browse files Browse the repository at this point in the history
…ailing on ubuntu (#7955)

### Motivation and Context

The idea is to run integration tests as part of the merge pipeline for
database connectors using docker containers where possible. This is
working well in the build server for redis on windows, but failing
intermittently with connection errors on ubuntu.

### Description

Disabling these tests as part of the build run for now, to avoid
blocking the merge queue.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
  • Loading branch information
westey-m authored Aug 7, 2024
1 parent 8371e09 commit 35a3975
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ namespace SemanticKernel.IntegrationTests.Connectors.Memory.Redis;
[Collection("RedisVectorStoreCollection")]
public sealed class RedisHashSetVectorStoreRecordCollectionTests(ITestOutputHelper output, RedisVectorStoreFixture fixture)
{
// If null, all tests will be enabled
private const string SkipReason = "Requires Redis docker container up and running";

private const string TestCollectionName = "hashhotels";

[Theory]
[Theory(Skip = SkipReason)]
[InlineData(TestCollectionName, true)]
[InlineData("nonexistentcollection", false)]
public async Task CollectionExistsReturnsCollectionStateAsync(string collectionName, bool expectedExists)
Expand All @@ -39,7 +42,7 @@ public async Task CollectionExistsReturnsCollectionStateAsync(string collectionN
Assert.Equal(expectedExists, actual);
}

[Theory]
[Theory(Skip = SkipReason)]
[InlineData(true)]
[InlineData(false)]
public async Task ItCanCreateACollectionUpsertAndGetAsync(bool useRecordDefinition)
Expand Down Expand Up @@ -81,7 +84,7 @@ public async Task ItCanCreateACollectionUpsertAndGetAsync(bool useRecordDefiniti
output.WriteLine(getResult?.ToString());
}

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

[Theory]
[Theory(Skip = SkipReason)]
[InlineData(true)]
[InlineData(false)]
public async Task ItCanUpsertDocumentToVectorStoreAsync(bool useRecordDefinition)
Expand Down Expand Up @@ -134,7 +137,7 @@ public async Task ItCanUpsertDocumentToVectorStoreAsync(bool useRecordDefinition
output.WriteLine(getResult?.ToString());
}

[Theory]
[Theory(Skip = SkipReason)]
[InlineData(true)]
[InlineData(false)]
public async Task ItCanUpsertManyDocumentsToVectorStoreAsync(bool useRecordDefinition)
Expand Down Expand Up @@ -171,7 +174,7 @@ public async Task ItCanUpsertManyDocumentsToVectorStoreAsync(bool useRecordDefin
}
}

[Theory]
[Theory(Skip = SkipReason)]
[InlineData(true, true)]
[InlineData(true, false)]
[InlineData(false, true)]
Expand Down Expand Up @@ -209,7 +212,7 @@ public async Task ItCanGetDocumentFromVectorStoreAsync(bool includeVectors, bool
output.WriteLine(getResult?.ToString());
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task ItCanGetManyDocumentsFromVectorStoreAsync()
{
// Arrange
Expand All @@ -232,7 +235,7 @@ public async Task ItCanGetManyDocumentsFromVectorStoreAsync()
}
}

[Theory]
[Theory(Skip = SkipReason)]
[InlineData(true)]
[InlineData(false)]
public async Task ItCanRemoveDocumentFromVectorStoreAsync(bool useRecordDefinition)
Expand Down Expand Up @@ -264,7 +267,7 @@ public async Task ItCanRemoveDocumentFromVectorStoreAsync(bool useRecordDefiniti
Assert.Null(await sut.GetAsync("Remove-1"));
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task ItCanRemoveManyDocumentsFromVectorStoreAsync()
{
// Arrange
Expand All @@ -284,7 +287,7 @@ public async Task ItCanRemoveManyDocumentsFromVectorStoreAsync()
Assert.Null(await sut.GetAsync("RemoveMany-3", new GetRecordOptions { IncludeVectors = true }));
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task ItReturnsNullWhenGettingNonExistentRecordAsync()
{
// Arrange
Expand All @@ -295,7 +298,7 @@ public async Task ItReturnsNullWhenGettingNonExistentRecordAsync()
Assert.Null(await sut.GetAsync("BaseSet-5", new GetRecordOptions { IncludeVectors = true }));
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task ItThrowsMappingExceptionForFailedMapperAsync()
{
// Arrange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ namespace SemanticKernel.IntegrationTests.Connectors.Memory.Redis;
[Collection("RedisVectorStoreCollection")]
public sealed class RedisJsonVectorStoreRecordCollectionTests(ITestOutputHelper output, RedisVectorStoreFixture fixture)
{
// If null, all tests will be enabled
private const string SkipReason = "Requires Redis docker container up and running";

private const string TestCollectionName = "jsonhotels";

[Theory]
[Theory(Skip = SkipReason)]
[InlineData(TestCollectionName, true)]
[InlineData("nonexistentcollection", false)]
public async Task CollectionExistsReturnsCollectionStateAsync(string collectionName, bool expectedExists)
Expand All @@ -39,7 +42,7 @@ public async Task CollectionExistsReturnsCollectionStateAsync(string collectionN
Assert.Equal(expectedExists, actual);
}

[Theory]
[Theory(Skip = SkipReason)]
[InlineData(true)]
[InlineData(false)]
public async Task ItCanCreateACollectionUpsertAndGetAsync(bool useRecordDefinition)
Expand Down Expand Up @@ -86,7 +89,7 @@ public async Task ItCanCreateACollectionUpsertAndGetAsync(bool useRecordDefiniti
output.WriteLine(getResult?.ToString());
}

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

[Theory]
[Theory(Skip = SkipReason)]
[InlineData(true)]
[InlineData(false)]
public async Task ItCanUpsertDocumentToVectorStoreAsync(bool useRecordDefinition)
Expand Down Expand Up @@ -144,7 +147,7 @@ public async Task ItCanUpsertDocumentToVectorStoreAsync(bool useRecordDefinition
output.WriteLine(getResult?.ToString());
}

[Theory]
[Theory(Skip = SkipReason)]
[InlineData(true)]
[InlineData(false)]
public async Task ItCanUpsertManyDocumentsToVectorStoreAsync(bool useRecordDefinition)
Expand Down Expand Up @@ -181,7 +184,7 @@ public async Task ItCanUpsertManyDocumentsToVectorStoreAsync(bool useRecordDefin
}
}

[Theory]
[Theory(Skip = SkipReason)]
[InlineData(true, true)]
[InlineData(true, false)]
[InlineData(false, true)]
Expand Down Expand Up @@ -223,7 +226,7 @@ public async Task ItCanGetDocumentFromVectorStoreAsync(bool includeVectors, bool
output.WriteLine(getResult?.ToString());
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task ItCanGetManyDocumentsFromVectorStoreAsync()
{
// Arrange
Expand All @@ -246,7 +249,7 @@ public async Task ItCanGetManyDocumentsFromVectorStoreAsync()
}
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task ItFailsToGetDocumentsWithInvalidSchemaAsync()
{
// Arrange.
Expand All @@ -257,7 +260,7 @@ public async Task ItFailsToGetDocumentsWithInvalidSchemaAsync()
await Assert.ThrowsAsync<VectorStoreRecordMappingException>(async () => await sut.GetAsync("BaseSet-4-Invalid", new GetRecordOptions { IncludeVectors = true }));
}

[Theory]
[Theory(Skip = SkipReason)]
[InlineData(true)]
[InlineData(false)]
public async Task ItCanRemoveDocumentFromVectorStoreAsync(bool useRecordDefinition)
Expand Down Expand Up @@ -290,7 +293,7 @@ public async Task ItCanRemoveDocumentFromVectorStoreAsync(bool useRecordDefiniti
Assert.Null(await sut.GetAsync("Remove-1"));
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task ItCanRemoveManyDocumentsFromVectorStoreAsync()
{
// Arrange
Expand All @@ -310,7 +313,7 @@ public async Task ItCanRemoveManyDocumentsFromVectorStoreAsync()
Assert.Null(await sut.GetAsync("RemoveMany-3", new GetRecordOptions { IncludeVectors = true }));
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task ItReturnsNullWhenGettingNonExistentRecordAsync()
{
// Arrange
Expand All @@ -321,7 +324,7 @@ public async Task ItReturnsNullWhenGettingNonExistentRecordAsync()
Assert.Null(await sut.GetAsync("BaseSet-5", new GetRecordOptions { IncludeVectors = true }));
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task ItThrowsMappingExceptionForFailedMapperAsync()
{
// Arrange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ namespace SemanticKernel.IntegrationTests.Connectors.Memory.Redis;
[Collection("RedisVectorStoreCollection")]
public class RedisVectorStoreTests(ITestOutputHelper output, RedisVectorStoreFixture fixture)
{
[Fact]
// If null, all tests will be enabled
private const string SkipReason = "Requires Redis docker container up and running";

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

0 comments on commit 35a3975

Please sign in to comment.