Skip to content

Commit a33498c

Browse files
authored
Switch .NET SK tests to vector data suite (#92)
1 parent b5b6348 commit a33498c

File tree

3 files changed

+26
-19
lines changed

3 files changed

+26
-19
lines changed

.evergreen/config.yml

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

122-
- name: test-semantic-kernel-csharp
122+
- name: test-semantic-kernel-csharp-local
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"
126134
- func: "execute tests"
127135

128136
- name: test-langchain-python-local
@@ -325,7 +333,8 @@ buildvariants:
325333
run_on:
326334
- rhel87-small
327335
tasks:
328-
- name: test-semantic-kernel-csharp
336+
- name: test-semantic-kernel-csharp-local
337+
- name: test-semantic-kernel-csharp-remote
329338
batchtime: 10080 # 1 week
330339

331340
- name: test-langchain-python-rhel

semantic-kernel-csharp/config.env

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

semantic-kernel-csharp/run.sh

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,31 @@
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+
512
# WORKING_DIR = $ROOT_DIR/semantic-kernel-csharp/semantic-kernel
613

714
# Install .NET
815
DOTNET_SDK_PATH=./.dotnet
916
mkdir -p "$DOTNET_SDK_PATH"
10-
1117
echo "Downloading .NET SDK installer into $DOTNET_SDK_PATH folder..."
1218
curl -Lfo "$DOTNET_SDK_PATH"/dotnet-install.sh https://dot.net/v1/dotnet-install.sh
1319
echo "Installing .NET 9.0 SDK..."
1420
bash "$DOTNET_SDK_PATH"/dotnet-install.sh --channel 9.0 --install-dir "$DOTNET_SDK_PATH" --no-path
1521
echo "Installing .NET 8.0 runtime..."
1622
bash "$DOTNET_SDK_PATH"/dotnet-install.sh --channel 8.0 --install-dir "$DOTNET_SDK_PATH" --no-path --runtime dotnet
1723

18-
# The tests use the TestContainers.Net library which requires docker.
19-
# RHEL 8 and 9 don't support docker so we have the setup below to emulate docker with podman
20-
sudo dnf install -y docker
21-
22-
# Enable and start Podman's socket service to listen for Docker API calls
23-
sudo systemctl enable --now podman.socket
24-
25-
# Point docker commands to use the podman socket
26-
export DOCKER_HOST="unix:///run/podman/podman.sock"
27-
28-
# Set SkipReason to null to enable tests
29-
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
24+
# Enable MongoDB.ConformanceTests
25+
sed -i -e '/\[assembly: DisableTests/d' dotnet/test/VectorData/MongoDB.ConformanceTests/Properties/AssemblyInfo.cs
3026

31-
# Remove the attribute blocking tests so we can run them
32-
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
27+
# Export the MongoDB connection string
28+
export MONGODB__CONNECTIONURL=$MONGODB_URI
3329

34-
echo "Running MongoDBVectorStoreTests"
35-
sudo $DOTNET_SDK_PATH/dotnet test dotnet/src/IntegrationTests/IntegrationTests.csproj --filter "SemanticKernel.IntegrationTests.Connectors.MongoDB.MongoDBVectorStoreTests"
30+
# Run tests
31+
echo "Running MongoDB.ConformanceTests"
32+
$DOTNET_SDK_PATH/dotnet test dotnet/test/VectorData/MongoDB.ConformanceTests/MongoDB.ConformanceTests.csproj --framework net8.0

0 commit comments

Comments
 (0)