Skip to content

Commit

Permalink
.Net: Enable the InMemoryTextSearchTests (#9255)
Browse files Browse the repository at this point in the history
### Motivation and Context

`InMemoryTextSearchTests` are currently disabled, removing the code
which disables them.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### 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
markwallace-microsoft authored Oct 15, 2024
1 parent e23d636 commit 183bae1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 48 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/dotnet-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ jobs:
OpenAIAudioToText__ModelId: ${{ vars.OPENAIAUDIOTOTEXT__MODELID }}
OpenAITextToImage__ApiKey: ${{ secrets.OPENAITEXTTOIMAGE__APIKEY }}
OpenAITextToImage__ModelId: ${{ vars.OPENAITEXTTOIMAGE__MODELID }}
OpenAIEmbeddings__ApiKey: ${{ secrets.OPENAIEMBEDDINGS__APIKEY }}
OpenAIEmbeddings__ModelId: ${{ vars.OPENAIEMBEDDINGS__MODELID }}
AzureOpenAITextToAudio__ApiKey: ${{ secrets.AZUREOPENAITEXTTOAUDIO__APIKEY }}
AzureOpenAITextToAudio__Endpoint: ${{ secrets.AZUREOPENAITEXTTOAUDIO__ENDPOINT }}
AzureOpenAITextToAudio__DeploymentName: ${{ vars.AZUREOPENAITEXTTOAUDIO__DEPLOYMENTNAME }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,70 +6,26 @@
using Microsoft.SemanticKernel.Connectors.InMemory;
using Microsoft.SemanticKernel.Connectors.OpenAI;
using Microsoft.SemanticKernel.Data;
using SemanticKernel.IntegrationTests.Data;
using SemanticKernel.IntegrationTests.TestSettings;
using Xunit;

namespace SemanticKernel.IntegrationTests.Data;
namespace SemanticKernel.IntegrationTests.Connectors.Memory.InMemory;

/// <summary>
/// Integration tests for using <see cref="InMemoryVectorStore"/> with <see cref="ITextSearch"/>.
/// </summary>
public class InMemoryVectorStoreTextSearchTests : BaseVectorStoreTextSearchTests
{
// If null, all tests will be enabled
private const string SkipReason = "Failing in integration test pipeline so disabling while investigating a fix (issue 9168)";

[Fact(Skip = SkipReason)]
public override async Task CanSearchAsync()
{
await base.CanSearchAsync();
}

[Fact(Skip = SkipReason)]
public override async Task CanGetTextSearchResultsAsync()
{
await base.CanGetTextSearchResultsAsync();
}

[Fact(Skip = SkipReason)]
public override async Task CanGetSearchResultsAsync()
{
await base.CanGetSearchResultsAsync();
}

[Fact(Skip = SkipReason)]
public override async Task UsingTextSearchWithAFilterAsync()
{
await base.UsingTextSearchWithAFilterAsync();
}

[Fact(Skip = SkipReason)]
public override async Task FunctionCallingUsingCreateWithSearchAsync()
{
await base.FunctionCallingUsingCreateWithSearchAsync();
}

[Fact(Skip = SkipReason)]
public override async Task FunctionCallingUsingCreateWithGetSearchResultsAsync()
{
await base.FunctionCallingUsingCreateWithGetSearchResultsAsync();
}

[Fact(Skip = SkipReason)]
public override async Task FunctionCallingUsingGetTextSearchResultsAsync()
{
await base.FunctionCallingUsingGetTextSearchResultsAsync();
}

/// <inheritdoc/>
public async override Task<ITextSearch> CreateTextSearchAsync()
{
if (this.VectorStore is null)
{
OpenAIConfiguration? openAIConfiguration = this.Configuration.GetSection("OpenAIEmbeddings").Get<OpenAIConfiguration>();
Assert.NotNull(openAIConfiguration);
Assert.NotEmpty(openAIConfiguration.ModelId);
Assert.NotEmpty(openAIConfiguration.ApiKey);
Assert.NotNull(openAIConfiguration.ModelId);
Assert.NotNull(openAIConfiguration.ApiKey);
this.EmbeddingGenerator = new OpenAITextEmbeddingGenerationService(openAIConfiguration.ModelId, openAIConfiguration.ApiKey);

// Delegate which will create a record.
Expand Down

0 comments on commit 183bae1

Please sign in to comment.