Skip to content

Commit 8cbfa52

Browse files
authored
CSHARP-5594: Fix Semantic Kernel Integration Tests (#70)
1 parent d7301f1 commit 8cbfa52

File tree

5 files changed

+18
-174
lines changed

5 files changed

+18
-174
lines changed

.evergreen/config.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,10 @@ tasks:
119119
- func: "setup remote atlas"
120120
- func: "execute tests"
121121

122-
- name: test-semantic-kernel-csharp-local
122+
- name: test-semantic-kernel-csharp
123123
tags: [local]
124124
commands:
125125
- func: "fetch repo"
126-
- func: "setup local atlas"
127-
- func: "execute tests"
128-
129-
- name: test-semantic-kernel-csharp-remote
130-
tags: [remote]
131-
commands:
132-
- func: "fetch repo"
133-
- func: "setup remote atlas"
134126
- func: "execute tests"
135127

136128
- name: test-langchain-python-local
@@ -289,8 +281,7 @@ buildvariants:
289281
run_on:
290282
- rhel87-small
291283
tasks:
292-
- name: test-semantic-kernel-csharp-local
293-
- name: test-semantic-kernel-csharp-remote
284+
- name: test-semantic-kernel-csharp
294285
batchtime: 10080 # 1 week
295286

296287
- name: test-langchain-python-rhel

semantic-kernel-csharp/config.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
REPO_NAME=semantic-kernel
22
REPO_ORG=microsoft
3-
DATABASE=dotnetMSKNearestTest

semantic-kernel-csharp/database/nearestSearch.json

Lines changed: 0 additions & 138 deletions
This file was deleted.

semantic-kernel-csharp/indexes/nearestSearch_default.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

semantic-kernel-csharp/run.sh

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22

33
set -eu
44

5-
# Get the MONGODB_URI.
6-
SCRIPT_DIR=$(realpath "$(dirname ${BASH_SOURCE[0]})")
7-
ROOT_DIR=$(dirname $SCRIPT_DIR)
8-
. $ROOT_DIR/env.sh
9-
10-
. $ROOT_DIR/.evergreen/utils.sh
11-
125
# WORKING_DIR = $ROOT_DIR/semantic-kernel-csharp/semantic-kernel
136

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

16+
# The tests use the TestContainers.Net library which requires docker.
17+
# RHEL 8 and 9 don't support docker so we have the setup below to emulate docker with podman
18+
sudo dnf install -y docker
19+
20+
# Enable and start Podman's socket service to listen for Docker API calls
21+
sudo systemctl enable --now podman.socket
22+
23+
# Point docker commands to use the podman socket
24+
export DOCKER_HOST="unix:///run/podman/podman.sock"
25+
2326
# Set SkipReason to null to enable tests
24-
sed -i -e 's/"MongoDB Atlas cluster is required"/null/g' dotnet/src/IntegrationTests/Connectors/Memory/MongoDB/MongoDBMemoryStoreTests.cs
27+
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
28+
29+
# Remove the attribute blocking tests so we can run them
30+
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
2531

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

0 commit comments

Comments
 (0)