Skip to content

CSHARP-5594: Fix Semantic Kernel Integration Tests #70

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

Merged
merged 2 commits into from
May 28, 2025
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
13 changes: 2 additions & 11 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,10 @@ tasks:
- func: "setup remote atlas"
- func: "execute tests"

- name: test-semantic-kernel-csharp-local
- name: test-semantic-kernel-csharp
tags: [local]
commands:
- func: "fetch repo"
- func: "setup local atlas"
- func: "execute tests"

- name: test-semantic-kernel-csharp-remote
tags: [remote]
commands:
- func: "fetch repo"
- func: "setup remote atlas"
- func: "execute tests"

- name: test-langchain-python-local
Expand Down Expand Up @@ -270,8 +262,7 @@ buildvariants:
run_on:
- rhel87-small
tasks:
- name: test-semantic-kernel-csharp-local
- name: test-semantic-kernel-csharp-remote
- name: test-semantic-kernel-csharp
batchtime: 10080 # 1 week

- name: test-langchain-python-rhel
Expand Down
1 change: 0 additions & 1 deletion semantic-kernel-csharp/config.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
REPO_NAME=semantic-kernel
REPO_ORG=microsoft
DATABASE=dotnetMSKNearestTest
138 changes: 0 additions & 138 deletions semantic-kernel-csharp/database/nearestSearch.json

This file was deleted.

12 changes: 0 additions & 12 deletions semantic-kernel-csharp/indexes/nearestSearch_default.json

This file was deleted.

28 changes: 16 additions & 12 deletions semantic-kernel-csharp/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

set -eu

# Get the MONGODB_URI.
SCRIPT_DIR=$(realpath "$(dirname ${BASH_SOURCE[0]})")
ROOT_DIR=$(dirname $SCRIPT_DIR)
. $ROOT_DIR/env.sh

. $ROOT_DIR/.evergreen/utils.sh

# WORKING_DIR = $ROOT_DIR/semantic-kernel-csharp/semantic-kernel

# Install .NET
Expand All @@ -20,10 +13,21 @@ curl -Lfo "$DOTNET_SDK_PATH"/dotnet-install.sh https://dot.net/v1/dotnet-install
echo "Installing .NET LTS SDK..."
bash "$DOTNET_SDK_PATH"/dotnet-install.sh --channel 8.0 --install-dir "$DOTNET_SDK_PATH" --no-path

# The tests use the TestContainers.Net library which requires docker.
# RHEL 8 and 9 don't support docker so we have the setup below to emulate docker with podman
sudo dnf install -y docker

# Enable and start Podman's socket service to listen for Docker API calls
sudo systemctl enable --now podman.socket

# Point docker commands to use the podman socket
export DOCKER_HOST="unix:///run/podman/podman.sock"

# Set SkipReason to null to enable tests
sed -i -e 's/"MongoDB Atlas cluster is required"/null/g' dotnet/src/IntegrationTests/Connectors/Memory/MongoDB/MongoDBMemoryStoreTests.cs
sed -i -e 's/"The MongoDB container is intermittently timing out at startup time blocking prs, so these test should be run manually."/null/g' dotnet/src/IntegrationTests/Connectors/Memory/MongoDB/MongoDBVectorStoreRecordCollectionTests.cs

# Remove the attribute blocking tests so we can run them
sed -i -e 's/\[DisableVectorStoreTests(Skip = "The MongoDB container is intermittently timing out at startup time blocking prs, so these test should be run manually.")\]//g' dotnet/src/IntegrationTests/Connectors/Memory/MongoDB/MongoDBVectorStoreTests.cs

# Run tests
echo "Running MongoDBMemoryStoreTests"
MongoDB__ConnectionString=$MONGODB_URI \
$DOTNET_SDK_PATH/dotnet test dotnet/src/IntegrationTests/IntegrationTests.csproj --filter SemanticKernel.IntegrationTests.Connectors.MongoDB.MongoDBMemoryStoreTests
echo "Running MongoDBVectorStoreTests and MongoDBVectorStoreRecordCollectionTests"
sudo $DOTNET_SDK_PATH/dotnet test dotnet/src/IntegrationTests/IntegrationTests.csproj --filter "SemanticKernel.IntegrationTests.Connectors.MongoDB.MongoDBVectorStoreTests | SemanticKernel.IntegrationTests.Connectors.MongoDB.MongoDBVectorStoreRecordCollectionTests"