|
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 | + |
5 | 10 | # WORKING_DIR = $ROOT_DIR/semantic-kernel-csharp/semantic-kernel
|
6 | 11 |
|
7 | 12 | # Install .NET
|
8 | 13 | DOTNET_SDK_PATH=./.dotnet
|
9 | 14 | mkdir -p "$DOTNET_SDK_PATH"
|
10 |
| - |
11 | 15 | echo "Downloading .NET SDK installer into $DOTNET_SDK_PATH folder..."
|
12 | 16 | curl -Lfo "$DOTNET_SDK_PATH"/dotnet-install.sh https://dot.net/v1/dotnet-install.sh
|
13 | 17 | echo "Installing .NET 9.0 SDK..."
|
14 | 18 | bash "$DOTNET_SDK_PATH"/dotnet-install.sh --channel 9.0 --install-dir "$DOTNET_SDK_PATH" --no-path
|
15 | 19 | echo "Installing .NET 8.0 runtime..."
|
16 | 20 | bash "$DOTNET_SDK_PATH"/dotnet-install.sh --channel 8.0 --install-dir "$DOTNET_SDK_PATH" --no-path --runtime dotnet
|
17 | 21 |
|
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 | 22 | # Enable MongoDB.ConformanceTests
|
29 | 23 | sed -i -e '/\[assembly: DisableTests/d' dotnet/test/VectorData/MongoDB.ConformanceTests/Properties/AssemblyInfo.cs
|
30 | 24 |
|
31 | 25 | # Export the MongoDB connection string
|
32 | 26 | export MONGODB__CONNECTIONURL=$MONGODB_URI
|
33 | 27 |
|
| 28 | +# Run tests |
34 | 29 | echo "Running MongoDB.ConformanceTests"
|
35 |
| -sudo $DOTNET_SDK_PATH/dotnet test dotnet/test/VectorData/MongoDB.ConformanceTests/MongoDB.ConformanceTests.csproj --framework net8.0 |
| 30 | +$DOTNET_SDK_PATH/dotnet test dotnet/test/VectorData/MongoDB.ConformanceTests/MongoDB.ConformanceTests.csproj --framework net8.0 |
0 commit comments