Skip to content

Commit 6b2537a

Browse files
authored
CSHARP-5075: Add SK test variant to EG (#1320)
1 parent 56d0aba commit 6b2537a

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

evergreen/evergreen.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,19 @@ functions:
768768
FRAMEWORK=${FRAMEWORK} \
769769
evergreen/run-tests.sh
770770
771+
run-test-SK:
772+
- command: shell.exec
773+
params:
774+
shell: bash
775+
working_dir: mongo-csharp-driver
776+
env:
777+
ATLAS_SK: ${ATLAS_SK}
778+
script: |
779+
${PREPARE_SHELL}
780+
echo "cloning sk rep"
781+
git clone https://github.com/microsoft/semantic-kernel.git
782+
./evergreen/run-sk.sh
783+
771784
start-kms-mock-servers:
772785
- command: shell.exec
773786
params:
@@ -1786,6 +1799,11 @@ tasks:
17861799
export GCPKMS_INSTANCENAME=${GCPKMS_INSTANCENAME}
17871800
GCPKMS_CMD="MONGODB_URI='mongodb://localhost:27017' ./evergreen/run-csfle-gcp-tests.sh" $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/run-command.sh
17881801
1802+
- name: test-SK
1803+
commands:
1804+
- func: install-dotnet
1805+
- func: run-test-SK
1806+
17891807
- name: build-packages
17901808
commands:
17911809
- func: install-dotnet
@@ -2638,6 +2656,16 @@ buildvariants:
26382656
variant: ".build-packages"
26392657
## add dependency onto packages smoke test once it implemented
26402658

2659+
- matrix_name: test-SK
2660+
matrix_spec:
2661+
os: "ubuntu-2004"
2662+
display_name: "Semantic Kernel Connector"
2663+
tasks:
2664+
- name: test-SK
2665+
depends_on:
2666+
- name: push-packages-myget
2667+
variant: ".push-packages-myget"
2668+
26412669
- matrix_name: push-packages-nuget
26422670
matrix_spec:
26432671
os: "ubuntu-2004"

evergreen/run-sk.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit # Exit the script with error if any of the commands fail
4+
set +o xtrace # Disable tracing.
5+
6+
cd ./semantic-kernel/dotnet/
7+
8+
# Can't modify packageSourceMapping via command line yet (https://github.com/NuGet/Home/issues/10735), therefore using nuget.custom.config
9+
echo "Creating nuget.custom.config"
10+
cat > nuget.custom.config << EOL
11+
<?xml version="1.0" encoding="utf-8"?>
12+
<configuration>
13+
14+
<packageSources>
15+
<clear />
16+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
17+
<add key="myget.org" value="https://www.myget.org/F/mongodb/api/v3/index.json" />
18+
</packageSources>
19+
20+
</configuration>
21+
EOL
22+
23+
# Update mongodb version
24+
echo Update MongoDB Driver version to "$PACKAGE_VERSION"
25+
sed -i -e 's/PackageVersion Include="MongoDB.Driver" Version=".\+"/PackageVersion Include="MongoDB.Driver" Version="'"$PACKAGE_VERSION"'"/g' Directory.Packages.props
26+
27+
echo "MongoDB Driver version updated"
28+
29+
# Set SkipReason to null to enable integration tests
30+
sed -i -e 's/"MongoDB Atlas cluster is required"/null/g' ./src/IntegrationTests/Connectors/Memory/MongoDB/MongoDBMemoryStoreTests.cs
31+
32+
dotnet clean
33+
dotnet restore --configfile nuget.custom.config
34+
echo "restored"
35+
36+
# Run unit tests
37+
dotnet test ./src/Connectors/Connectors.UnitTests/Connectors.UnitTests.csproj --filter SemanticKernel.Connectors.UnitTests.MongoDB.MongoDBMemoryStoreTests --no-restore
38+
39+
# Run integration tests - Currently Fails
40+
#MongoDB__ConnectionString="$ATLAS_SK"
41+
#dotnet test ./src/IntegrationTests/IntegrationTests.csproj --filter SemanticKernel.IntegrationTests.Connectors.MongoDB.MongoDBMemoryStoreTests

0 commit comments

Comments
 (0)