Skip to content

Commit 35a3975

Browse files
authored
.Net: Disable redis integration tests since they are intermittently failing 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 😄
1 parent 8371e09 commit 35a3975

File tree

3 files changed

+33
-24
lines changed

3 files changed

+33
-24
lines changed

dotnet/src/IntegrationTests/Connectors/Memory/Redis/RedisHashSetVectorStoreRecordCollectionTests.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ namespace SemanticKernel.IntegrationTests.Connectors.Memory.Redis;
2222
[Collection("RedisVectorStoreCollection")]
2323
public sealed class RedisHashSetVectorStoreRecordCollectionTests(ITestOutputHelper output, RedisVectorStoreFixture fixture)
2424
{
25+
// If null, all tests will be enabled
26+
private const string SkipReason = "Requires Redis docker container up and running";
27+
2528
private const string TestCollectionName = "hashhotels";
2629

27-
[Theory]
30+
[Theory(Skip = SkipReason)]
2831
[InlineData(TestCollectionName, true)]
2932
[InlineData("nonexistentcollection", false)]
3033
public async Task CollectionExistsReturnsCollectionStateAsync(string collectionName, bool expectedExists)
@@ -39,7 +42,7 @@ public async Task CollectionExistsReturnsCollectionStateAsync(string collectionN
3942
Assert.Equal(expectedExists, actual);
4043
}
4144

42-
[Theory]
45+
[Theory(Skip = SkipReason)]
4346
[InlineData(true)]
4447
[InlineData(false)]
4548
public async Task ItCanCreateACollectionUpsertAndGetAsync(bool useRecordDefinition)
@@ -81,7 +84,7 @@ public async Task ItCanCreateACollectionUpsertAndGetAsync(bool useRecordDefiniti
8184
output.WriteLine(getResult?.ToString());
8285
}
8386

84-
[Fact]
87+
[Fact(Skip = SkipReason)]
8588
public async Task ItCanDeleteCollectionAsync()
8689
{
8790
// Arrange
@@ -101,7 +104,7 @@ public async Task ItCanDeleteCollectionAsync()
101104
Assert.False(await sut.CollectionExistsAsync());
102105
}
103106

104-
[Theory]
107+
[Theory(Skip = SkipReason)]
105108
[InlineData(true)]
106109
[InlineData(false)]
107110
public async Task ItCanUpsertDocumentToVectorStoreAsync(bool useRecordDefinition)
@@ -134,7 +137,7 @@ public async Task ItCanUpsertDocumentToVectorStoreAsync(bool useRecordDefinition
134137
output.WriteLine(getResult?.ToString());
135138
}
136139

137-
[Theory]
140+
[Theory(Skip = SkipReason)]
138141
[InlineData(true)]
139142
[InlineData(false)]
140143
public async Task ItCanUpsertManyDocumentsToVectorStoreAsync(bool useRecordDefinition)
@@ -171,7 +174,7 @@ public async Task ItCanUpsertManyDocumentsToVectorStoreAsync(bool useRecordDefin
171174
}
172175
}
173176

174-
[Theory]
177+
[Theory(Skip = SkipReason)]
175178
[InlineData(true, true)]
176179
[InlineData(true, false)]
177180
[InlineData(false, true)]
@@ -209,7 +212,7 @@ public async Task ItCanGetDocumentFromVectorStoreAsync(bool includeVectors, bool
209212
output.WriteLine(getResult?.ToString());
210213
}
211214

212-
[Fact]
215+
[Fact(Skip = SkipReason)]
213216
public async Task ItCanGetManyDocumentsFromVectorStoreAsync()
214217
{
215218
// Arrange
@@ -232,7 +235,7 @@ public async Task ItCanGetManyDocumentsFromVectorStoreAsync()
232235
}
233236
}
234237

235-
[Theory]
238+
[Theory(Skip = SkipReason)]
236239
[InlineData(true)]
237240
[InlineData(false)]
238241
public async Task ItCanRemoveDocumentFromVectorStoreAsync(bool useRecordDefinition)
@@ -264,7 +267,7 @@ public async Task ItCanRemoveDocumentFromVectorStoreAsync(bool useRecordDefiniti
264267
Assert.Null(await sut.GetAsync("Remove-1"));
265268
}
266269

267-
[Fact]
270+
[Fact(Skip = SkipReason)]
268271
public async Task ItCanRemoveManyDocumentsFromVectorStoreAsync()
269272
{
270273
// Arrange
@@ -284,7 +287,7 @@ public async Task ItCanRemoveManyDocumentsFromVectorStoreAsync()
284287
Assert.Null(await sut.GetAsync("RemoveMany-3", new GetRecordOptions { IncludeVectors = true }));
285288
}
286289

287-
[Fact]
290+
[Fact(Skip = SkipReason)]
288291
public async Task ItReturnsNullWhenGettingNonExistentRecordAsync()
289292
{
290293
// Arrange
@@ -295,7 +298,7 @@ public async Task ItReturnsNullWhenGettingNonExistentRecordAsync()
295298
Assert.Null(await sut.GetAsync("BaseSet-5", new GetRecordOptions { IncludeVectors = true }));
296299
}
297300

298-
[Fact]
301+
[Fact(Skip = SkipReason)]
299302
public async Task ItThrowsMappingExceptionForFailedMapperAsync()
300303
{
301304
// Arrange

dotnet/src/IntegrationTests/Connectors/Memory/Redis/RedisJsonVectorStoreRecordCollectionTests.cs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ namespace SemanticKernel.IntegrationTests.Connectors.Memory.Redis;
2222
[Collection("RedisVectorStoreCollection")]
2323
public sealed class RedisJsonVectorStoreRecordCollectionTests(ITestOutputHelper output, RedisVectorStoreFixture fixture)
2424
{
25+
// If null, all tests will be enabled
26+
private const string SkipReason = "Requires Redis docker container up and running";
27+
2528
private const string TestCollectionName = "jsonhotels";
2629

27-
[Theory]
30+
[Theory(Skip = SkipReason)]
2831
[InlineData(TestCollectionName, true)]
2932
[InlineData("nonexistentcollection", false)]
3033
public async Task CollectionExistsReturnsCollectionStateAsync(string collectionName, bool expectedExists)
@@ -39,7 +42,7 @@ public async Task CollectionExistsReturnsCollectionStateAsync(string collectionN
3942
Assert.Equal(expectedExists, actual);
4043
}
4144

42-
[Theory]
45+
[Theory(Skip = SkipReason)]
4346
[InlineData(true)]
4447
[InlineData(false)]
4548
public async Task ItCanCreateACollectionUpsertAndGetAsync(bool useRecordDefinition)
@@ -86,7 +89,7 @@ public async Task ItCanCreateACollectionUpsertAndGetAsync(bool useRecordDefiniti
8689
output.WriteLine(getResult?.ToString());
8790
}
8891

89-
[Fact]
92+
[Fact(Skip = SkipReason)]
9093
public async Task ItCanDeleteCollectionAsync()
9194
{
9295
// Arrange
@@ -106,7 +109,7 @@ public async Task ItCanDeleteCollectionAsync()
106109
Assert.False(await sut.CollectionExistsAsync());
107110
}
108111

109-
[Theory]
112+
[Theory(Skip = SkipReason)]
110113
[InlineData(true)]
111114
[InlineData(false)]
112115
public async Task ItCanUpsertDocumentToVectorStoreAsync(bool useRecordDefinition)
@@ -144,7 +147,7 @@ public async Task ItCanUpsertDocumentToVectorStoreAsync(bool useRecordDefinition
144147
output.WriteLine(getResult?.ToString());
145148
}
146149

147-
[Theory]
150+
[Theory(Skip = SkipReason)]
148151
[InlineData(true)]
149152
[InlineData(false)]
150153
public async Task ItCanUpsertManyDocumentsToVectorStoreAsync(bool useRecordDefinition)
@@ -181,7 +184,7 @@ public async Task ItCanUpsertManyDocumentsToVectorStoreAsync(bool useRecordDefin
181184
}
182185
}
183186

184-
[Theory]
187+
[Theory(Skip = SkipReason)]
185188
[InlineData(true, true)]
186189
[InlineData(true, false)]
187190
[InlineData(false, true)]
@@ -223,7 +226,7 @@ public async Task ItCanGetDocumentFromVectorStoreAsync(bool includeVectors, bool
223226
output.WriteLine(getResult?.ToString());
224227
}
225228

226-
[Fact]
229+
[Fact(Skip = SkipReason)]
227230
public async Task ItCanGetManyDocumentsFromVectorStoreAsync()
228231
{
229232
// Arrange
@@ -246,7 +249,7 @@ public async Task ItCanGetManyDocumentsFromVectorStoreAsync()
246249
}
247250
}
248251

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

260-
[Theory]
263+
[Theory(Skip = SkipReason)]
261264
[InlineData(true)]
262265
[InlineData(false)]
263266
public async Task ItCanRemoveDocumentFromVectorStoreAsync(bool useRecordDefinition)
@@ -290,7 +293,7 @@ public async Task ItCanRemoveDocumentFromVectorStoreAsync(bool useRecordDefiniti
290293
Assert.Null(await sut.GetAsync("Remove-1"));
291294
}
292295

293-
[Fact]
296+
[Fact(Skip = SkipReason)]
294297
public async Task ItCanRemoveManyDocumentsFromVectorStoreAsync()
295298
{
296299
// Arrange
@@ -310,7 +313,7 @@ public async Task ItCanRemoveManyDocumentsFromVectorStoreAsync()
310313
Assert.Null(await sut.GetAsync("RemoveMany-3", new GetRecordOptions { IncludeVectors = true }));
311314
}
312315

313-
[Fact]
316+
[Fact(Skip = SkipReason)]
314317
public async Task ItReturnsNullWhenGettingNonExistentRecordAsync()
315318
{
316319
// Arrange
@@ -321,7 +324,7 @@ public async Task ItReturnsNullWhenGettingNonExistentRecordAsync()
321324
Assert.Null(await sut.GetAsync("BaseSet-5", new GetRecordOptions { IncludeVectors = true }));
322325
}
323326

324-
[Fact]
327+
[Fact(Skip = SkipReason)]
325328
public async Task ItThrowsMappingExceptionForFailedMapperAsync()
326329
{
327330
// Arrange

dotnet/src/IntegrationTests/Connectors/Memory/Redis/RedisVectorStoreTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ namespace SemanticKernel.IntegrationTests.Connectors.Memory.Redis;
1616
[Collection("RedisVectorStoreCollection")]
1717
public class RedisVectorStoreTests(ITestOutputHelper output, RedisVectorStoreFixture fixture)
1818
{
19-
[Fact]
19+
// If null, all tests will be enabled
20+
private const string SkipReason = "Requires Redis docker container up and running";
21+
22+
[Fact(Skip = SkipReason)]
2023
public async Task ItCanGetAListOfExistingCollectionNamesAsync()
2124
{
2225
// Arrange

0 commit comments

Comments
 (0)