Skip to content

Switch .NET SK tests to vector data suite #92

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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: 11 additions & 2 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,18 @@ tasks:
- func: "setup remote atlas"
- func: "execute tests"

- name: test-semantic-kernel-csharp
- name: test-semantic-kernel-csharp-local
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 @@ -311,7 +319,8 @@ buildvariants:
run_on:
- rhel87-small
tasks:
- name: test-semantic-kernel-csharp
- name: test-semantic-kernel-csharp-local
- name: test-semantic-kernel-csharp-remote
batchtime: 10080 # 1 week

- name: test-langchain-python-rhel
Expand Down
1 change: 1 addition & 0 deletions semantic-kernel-csharp/config.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
REPO_NAME=semantic-kernel
REPO_ORG=microsoft
DATABASE=semantic-kernel
31 changes: 14 additions & 17 deletions semantic-kernel-csharp/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,31 @@

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
DOTNET_SDK_PATH=./.dotnet
mkdir -p "$DOTNET_SDK_PATH"

echo "Downloading .NET SDK installer into $DOTNET_SDK_PATH folder..."
curl -Lfo "$DOTNET_SDK_PATH"/dotnet-install.sh https://dot.net/v1/dotnet-install.sh
echo "Installing .NET 9.0 SDK..."
bash "$DOTNET_SDK_PATH"/dotnet-install.sh --channel 9.0 --install-dir "$DOTNET_SDK_PATH" --no-path
echo "Installing .NET 8.0 runtime..."
bash "$DOTNET_SDK_PATH"/dotnet-install.sh --channel 8.0 --install-dir "$DOTNET_SDK_PATH" --no-path --runtime dotnet
Comment on lines 19 to 22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need to have this duality for these updated tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need both just to be able to build it - this was a recent requirement.


# 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/"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
# Enable MongoDB.ConformanceTests
sed -i -e '/\[assembly: DisableTests/d' dotnet/test/VectorData/MongoDB.ConformanceTests/Properties/AssemblyInfo.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
# Export the MongoDB connection string
export MONGODB__CONNECTIONURL=$MONGODB_URI

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