|
2 | 2 |
|
3 | 3 | set -eu
|
4 | 4 |
|
| 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 | + |
5 | 12 | # WORKING_DIR = $ROOT_DIR/semantic-kernel-csharp/semantic-kernel
|
6 | 13 |
|
7 | 14 | # Install .NET
|
8 | 15 | DOTNET_SDK_PATH=./.dotnet
|
9 | 16 | mkdir -p "$DOTNET_SDK_PATH"
|
10 |
| - |
11 | 17 | echo "Downloading .NET SDK installer into $DOTNET_SDK_PATH folder..."
|
12 | 18 | curl -Lfo "$DOTNET_SDK_PATH"/dotnet-install.sh https://dot.net/v1/dotnet-install.sh
|
13 | 19 | echo "Installing .NET 9.0 SDK..."
|
14 | 20 | bash "$DOTNET_SDK_PATH"/dotnet-install.sh --channel 9.0 --install-dir "$DOTNET_SDK_PATH" --no-path
|
15 | 21 | echo "Installing .NET 8.0 runtime..."
|
16 | 22 | bash "$DOTNET_SDK_PATH"/dotnet-install.sh --channel 8.0 --install-dir "$DOTNET_SDK_PATH" --no-path --runtime dotnet
|
17 | 23 |
|
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 |
30 | 26 |
|
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 |
33 | 29 |
|
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