Skip to content

Commit

Permalink
.Net: Temporarily disable MongoDB integration tests (#9411)
Browse files Browse the repository at this point in the history
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

Currently, we use `mongodb/mongodb-atlas-local` Docker image to perform
integration tests in our CI pipeline for MongoDB connector. It appeared
that sometimes vector search doesn't return any results, so the tests
are failing, and PR merge is blocked:

![Image](https://github.com/user-attachments/assets/3e1126dc-e219-46a0-89aa-6c5e898678bb)

This PR temporarily disables these integration tests until the root
cause will be found. Related issue:
#9410.

### Contribution Checklist

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

- [x] The code builds clean without any errors or warnings
- [x] 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
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

Co-authored-by: Mark Wallace <[email protected]>
  • Loading branch information
dmytrostruk and markwallace-microsoft authored Oct 24, 2024
1 parent 9b67edf commit 18aa431
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ namespace SemanticKernel.IntegrationTests.Connectors.MongoDB;
[Collection("MongoDBVectorStoreCollection")]
public class MongoDBVectorStoreRecordCollectionTests(MongoDBVectorStoreFixture fixture)
{
[Theory]
// If null, all tests will be enabled
private const string? SkipReason = "The tests are for manual verification.";

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

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

[Theory]
[Theory(Skip = SkipReason)]
[InlineData(true, true)]
[InlineData(true, false)]
[InlineData(false, true)]
Expand Down Expand Up @@ -98,7 +101,7 @@ public async Task ItCanCreateCollectionUpsertAndGetAsync(bool includeVectors, bo
}
}

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

[Fact]
[Fact(Skip = SkipReason)]
public async Task ItCanGetAndDeleteRecordAsync()
{
// Arrange
Expand All @@ -140,7 +143,7 @@ public async Task ItCanGetAndDeleteRecordAsync()
Assert.Null(getResult);
}

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

[Fact]
[Fact(Skip = SkipReason)]
public async Task ItCanUpsertRecordAsync()
{
// Arrange
Expand Down Expand Up @@ -200,7 +203,7 @@ public async Task ItCanUpsertRecordAsync()
Assert.Equal(10, getResult.HotelRating);
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task UpsertWithModelWorksCorrectlyAsync()
{
// Arrange
Expand Down Expand Up @@ -232,7 +235,7 @@ public async Task UpsertWithModelWorksCorrectlyAsync()
Assert.Equal("Test Name", getResult.HotelName);
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task UpsertWithVectorStoreModelWorksCorrectlyAsync()
{
// Arrange
Expand All @@ -252,7 +255,7 @@ public async Task UpsertWithVectorStoreModelWorksCorrectlyAsync()
Assert.Equal("Test Name", getResult.HotelName);
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task UpsertWithBsonModelWorksCorrectlyAsync()
{
// Arrange
Expand Down Expand Up @@ -284,7 +287,7 @@ public async Task UpsertWithBsonModelWorksCorrectlyAsync()
Assert.Equal("Test Name", getResult.HotelName);
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task UpsertWithBsonVectorStoreModelWorksCorrectlyAsync()
{
// Arrange
Expand All @@ -304,7 +307,7 @@ public async Task UpsertWithBsonVectorStoreModelWorksCorrectlyAsync()
Assert.Equal("Test Name", getResult.HotelName);
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task UpsertWithBsonVectorStoreWithNameModelWorksCorrectlyAsync()
{
// Arrange
Expand All @@ -324,7 +327,7 @@ public async Task UpsertWithBsonVectorStoreWithNameModelWorksCorrectlyAsync()
Assert.Equal("Test Name", getResult.HotelName);
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task VectorizedSearchReturnsValidResultsByDefaultAsync()
{
// Arrange
Expand Down Expand Up @@ -355,7 +358,7 @@ public async Task VectorizedSearchReturnsValidResultsByDefaultAsync()
Assert.Equal(1, searchResults.First(l => l.Record.HotelId == "key1").Score);
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task VectorizedSearchReturnsValidResultsWithOffsetAsync()
{
// Arrange
Expand Down Expand Up @@ -388,7 +391,7 @@ public async Task VectorizedSearchReturnsValidResultsWithOffsetAsync()
Assert.DoesNotContain("key2", ids);
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task VectorizedSearchReturnsValidResultsWithFilterAsync()
{
// Arrange
Expand Down Expand Up @@ -420,7 +423,7 @@ public async Task VectorizedSearchReturnsValidResultsWithFilterAsync()
Assert.DoesNotContain("key4", ids);
}

[Fact]
[Fact(Skip = SkipReason)]
public async Task ItCanUpsertAndRetrieveUsingTheGenericMapperAsync()
{
// Arrange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ namespace SemanticKernel.IntegrationTests.Connectors.MongoDB;
[Collection("MongoDBVectorStoreCollection")]
public class MongoDBVectorStoreTests(MongoDBVectorStoreFixture fixture)
{
[Fact]
// If null, all tests will be enabled
private const string? SkipReason = "The tests are for manual verification.";

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

0 comments on commit 18aa431

Please sign in to comment.