diff --git a/.github/actions/run-android-device-farm-test/action.yml b/.github/actions/run-android-device-farm-test/action.yml
index 659d94a001..deee639ace 100644
--- a/.github/actions/run-android-device-farm-test/action.yml
+++ b/.github/actions/run-android-device-farm-test/action.yml
@@ -54,7 +54,8 @@ runs:
Customer Artifacts.zip
- run: |
Expand-Archive 'Customer Artifacts.zip' -DestinationPath artifacts
- echo "results-path=${{ github.workspace }}/artifacts/Host_Machine_Files/`$DEVICEFARM_LOG_DIR/TestResults.Android.xml" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
+ Move-Item -Path artifacts/Host_Machine_Files/`$DEVICEFARM_LOG_DIR/TestResults.Android.xml -Destination TestResults.Android.xml
+ echo "results-path=TestResults.Android.xml" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
name: Fetch test artifacts
shell: pwsh
id: get-test-results
diff --git a/.github/templates/build-packages.yml b/.github/templates/build-packages.yml
index 5854261d0b..5337ee4153 100644
--- a/.github/templates/build-packages.yml
+++ b/.github/templates/build-packages.yml
@@ -15,7 +15,7 @@
Invoke-WebRequest -Uri https://github.com/dotnet/docfx/releases/download/v2.75.2/docfx-win-x64-v2.75.2.zip -OutFile C:\docfx.zip
Expand-Archive -Path C:\docfx.zip -DestinationPath C:\docfx
shell: powershell
- - _: #@ template.replace(setupDotnet("7.0.x", ifCondition = "inputs.build-docs"))
+ - _: #@ template.replace(setupDotnet(ifCondition = "inputs.build-docs"))
- name: Build docs
if: inputs.build-docs
env:
diff --git a/.github/templates/common.lib.yml b/.github/templates/common.lib.yml
index b2b14e3845..cd4e6cb582 100644
--- a/.github/templates/common.lib.yml
+++ b/.github/templates/common.lib.yml
@@ -8,14 +8,14 @@
#@ actionUploadArtifact = "actions/upload-artifact@v3"
#@ actionDownloadArtifact = "actions/download-artifact@v3"
#@ actionSetupMSBuild = "microsoft/setup-msbuild@0b44c6745b7e81956596964100aadb92d667c497"
-#@ actionSetupDotnet = "actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a"
+#@ actionSetupDotnet = "actions/setup-dotnet@3e6b9fe3930cac7c59c651af5de1514b47a805b9" #! 4.0.0
#@ actionCodeQLInit = "github/codeql-action/init@40542d38bc4936c2ca7da883aeb050a6081b4b31"
#@ actionCodeQLAnalyze = "github/codeql-action/analyze@40542d38bc4936c2ca7da883aeb050a6081b4b31"
#@ actionSetupNode = "actions/setup-node@16352bb09bc672a073e326c2cc1d3d7d2a3e577e"
#@ actionAWSConfigureCredentials = "aws-actions/configure-aws-credentials@v1-node16"
-#@ actionRuniOSSimulator = "realm/ci-actions/run-ios-simulator@fa20eb972b9f018654fdb4e2c7afb52b0532f907"
-#@ actionReleaseToSlack = "realm/ci-actions/release-to-slack@fa20eb972b9f018654fdb4e2c7afb52b0532f907"
-#@ actionSetupXcode = "maxim-lobanov/setup-xcode@9a697e2b393340c3cacd97468baa318e4c883d98"
+#@ actionRuniOSSimulator = "realm/ci-actions/run-ios-simulator@6418e15ed9bbdb19b7d456a347e5623779f95cdf"
+#@ actionReleaseToSlack = "realm/ci-actions/release-to-slack@6418e15ed9bbdb19b7d456a347e5623779f95cdf"
+#@ actionSetupXcode = "maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd"
#@ actionSetupAndroid = "android-actions/setup-android@7c5672355aaa8fde5f97a91aa9a99616d1ace6bc"
#@ actionSetupJDK = "actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0"
@@ -190,7 +190,7 @@ with:
if-no-files-found: error
#@ end
---
-#@ def setupDotnet(version = "6.0.x", ifCondition = ""):
+#@ def setupDotnet(version = "8.0.x", ifCondition = ""):
name: Configure .NET
uses: #@ actionSetupDotnet
#@ if (ifCondition != ""):
@@ -201,10 +201,10 @@ with:
#@ end
---
#@ def setupXcode(version = "14.0.1"):
-- name: Setup Xcode
- uses: #@ actionSetupXcode
- with:
- xcode-version: #@ version
+name: Setup Xcode
+uses: #@ actionSetupXcode
+with:
+ xcode-version: #@ version
#@ end
---
#@ def uploadToNpm(tag = "latest", versionExpression = "steps.get-version.outputs.version", expectShortPath = False):
@@ -231,7 +231,7 @@ with:
#@ end
---
#@ def setupWorkloads(workloads = 'maui'):
- - _: #@ template.replace(setupDotnet("7.0.x"))
+ - _: #@ template.replace(setupDotnet())
- name: Setup workloads
run: #@ "dotnet workload install " + workloads
#@ end
diff --git a/.github/templates/main.yml b/.github/templates/main.yml
index 9110d80fc4..10cfc77bd4 100644
--- a/.github/templates/main.yml
+++ b/.github/templates/main.yml
@@ -45,7 +45,7 @@ jobs:
_: #@ template.replace(buildUnity())
_: #@ template.replace(runTests(".NET Framework"))
_: #@ template.replace(runTests("UWP Managed", additionalSecrets = ["Pfx_Password", "Base64_Encoded_Pfx"]))
- _: #@ template.replace(runNetCoreTests("[\"net6.0\", \"net7.0\"]"))
+ _: #@ template.replace(runNetCoreTests("[\"net6.0\", \"net8.0\"]"))
_: #@ template.replace(runTests("macOS"))
_: #@ template.replace(runTests("iOS"))
_: #@ template.replace(runTests("tvOS", runSyncTests = False))
diff --git a/.github/templates/pr.yml b/.github/templates/pr.yml
index 22f71ff66e..759ccc769b 100644
--- a/.github/templates/pr.yml
+++ b/.github/templates/pr.yml
@@ -44,7 +44,7 @@ jobs:
_: #@ template.replace(testUnity('["Mono-Net4"]', '[{ "os": "windows", "testPlatform": "Windows64" }, { "os": "linux", "testPlatform": "Linux64" }]'))
_: #@ template.replace(runTests(".NET Framework", runSyncTests = False))
_: #@ template.replace(runTests("UWP Managed", runSyncTests = False, additionalSecrets = ["Pfx_Password", "Base64_Encoded_Pfx"]))
- _: #@ template.replace(runNetCoreTests('["net7.0"]'))
+ _: #@ template.replace(runNetCoreTests('["net8.0"]'))
_: #@ template.replace(runTests("macOS", runSyncTests = False))
_: #@ template.replace(runTests("iOS", runSyncTests = False))
_: #@ template.replace(runTests("tvOS", runSyncTests = False))
diff --git a/.github/templates/test-android.yml b/.github/templates/test-android.yml
index 1671ca899f..b9188d306c 100644
--- a/.github/templates/test-android.yml
+++ b/.github/templates/test-android.yml
@@ -25,7 +25,7 @@ jobs:
project-arn: ${{ secrets.DEVICEFARM_PROJECT_ARN }}
device-pool-arn: ${{ secrets.DEVICEFARM_ANDROID_POOL_ARN }}
arguments: (@= baasTestArgs('android') @)
- - #@ publishTestsResults("${{ steps.run_tests.outputs.test-results-path }}", "Xamarin.Android")
+ - #@ template.replace(publishTestsResults("${{ steps.run_tests.outputs.test-results-path }}", "Xamarin.Android"))
test-maui:
runs-on: windows-latest
name: Maui.Android
@@ -36,14 +36,14 @@ jobs:
- #@ template.replace(setupWorkloads())
- #@ setupJDK()
- name: Build the tests
- run: #@ "dotnet publish Tests/Tests.Maui -c Release -f net6.0-android -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}"
+ run: #@ "dotnet publish Tests/Tests.Maui -c Release -f net8.0-android -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}"
- #@ template.replace(configureAWSCredentials("AWS_DEVICEFARM_ACCESS_KEY_ID", "AWS_DEVICEFARM_SECRET_ACCESS_KEY", "us-west-2"))
- name: Run the tests
uses: ./.github/actions/run-android-device-farm-test
id: run_tests
with:
- apk-path: ${{ github.workspace }}/Tests/Tests.Maui/bin/Release/net6.0-android/publish/io.realm.mauitests-Signed.apk
+ apk-path: ${{ github.workspace }}/Tests/Tests.Maui/bin/Release/net8.0-android/publish/io.realm.mauitests-Signed.apk
app-id: io.realm.mauitests
project-arn: ${{ secrets.DEVICEFARM_PROJECT_ARN }}
device-pool-arn: ${{ secrets.DEVICEFARM_ANDROID_POOL_ARN }}
- - #@ publishTestsResults("${{ steps.run_tests.outputs.test-results-path }}", "Maui.Android")
\ No newline at end of file
+ - #@ template.replace(publishTestsResults("${{ steps.run_tests.outputs.test-results-path }}", "Maui.Android", run_transform=True))
\ No newline at end of file
diff --git a/.github/templates/test-code-coverage.yml b/.github/templates/test-code-coverage.yml
index 8c934b378c..5e01ad8d95 100644
--- a/.github/templates/test-code-coverage.yml
+++ b/.github/templates/test-code-coverage.yml
@@ -17,7 +17,7 @@ jobs:
dotnet tool install coverlet.console --tool-path tools
dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools
echo "${{ github.workspace }}/tools" >> $GITHUB_PATH
- - #@ template.replace(dotnetPublish("Tests/Realm.Tests", "net7.0", "linux-x64", { "RealmTestsStandaloneExe": "true" }))
+ - #@ template.replace(dotnetPublish("Tests/Realm.Tests", "net8.0", "linux-x64", { "RealmTestsStandaloneExe": "true" }))
- name: Run the tests
env:
DOTNET_DbgEnableMiniDump: 1
@@ -39,4 +39,4 @@ jobs:
compare-sha: ${{ github.event.pull_request.base.sha }}
- name: Output Coveralls response
run: echo ${{ steps.publish-coveralls.outputs.coveralls-api-result }}
- - #@ publishTestsResults("TestResults.Linux.xml", "Code Coverage")
+ - #@ template.replace(publishTestsResults("TestResults.Linux.xml", "Code Coverage"))
diff --git a/.github/templates/test-ios.yml b/.github/templates/test-ios.yml
index 1ed5d149fb..930e591cfa 100644
--- a/.github/templates/test-ios.yml
+++ b/.github/templates/test-ios.yml
@@ -1,5 +1,5 @@
#@ load("@ytt:template", "template")
-#@ load("common.lib.yml", "checkoutCode", "configuration", "actionRuniOSSimulator", "fetchPackageArtifacts", "setupWorkloads")
+#@ load("common.lib.yml", "checkoutCode", "configuration", "actionRuniOSSimulator", "fetchPackageArtifacts", "setupWorkloads", "setupXcode")
#@ load("test.lib.yml", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "prepareTest")
---
@@ -20,7 +20,7 @@ jobs:
bundleId: 'io.realm.dotnettests'
iphoneToSimulate: 'iPhone-8'
arguments: #@ "--headless --result=${{ github.workspace }}/TestResults.iOS.xml" + baasTestArgs("ios")
- - #@ publishTestsResults("TestResults.iOS.xml", "Xamarin.iOS")
+ - #@ template.replace(publishTestsResults("TestResults.iOS.xml", "Xamarin.iOS"))
test-maui:
runs-on: macos-13
@@ -29,19 +29,15 @@ jobs:
steps:
- #@ template.replace(checkoutCode())
- #@ template.replace(fetchPackageArtifacts())
- - name: Set XCode Version
- shell: bash
- run: |
- sudo xcode-select -s "/Applications/Xcode_14.3.app"
- echo "MD_APPLE_SDK_ROOT=/Applications/Xcode_14.3.app" >> $GITHUB_ENV
+ - #@ setupXcode("latest-stable")
- #@ template.replace(setupWorkloads())
- name: Build the tests
- run: #@ "dotnet build Tests/Tests.Maui -c " + configuration + " -f net6.0-ios -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}"
+ run: #@ "dotnet build Tests/Tests.Maui -c " + configuration + " -f net8.0-ios -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}"
- name: Run the tests
uses: #@ actionRuniOSSimulator
with:
- appPath: #@ "Tests/Tests.Maui/bin/" + configuration + "/net6.0-ios/iossimulator-x64/Tests.Maui.app"
+ appPath: #@ "Tests/Tests.Maui/bin/" + configuration + "/net8.0-ios/iossimulator-x64/Tests.Maui.app"
bundleId: 'io.realm.mauitests'
- iphoneToSimulate: 'iPhone-8'
+ iphoneToSimulate: 'iPhone-15'
arguments: #@ "--headless --result=${{ github.workspace }}/TestResults.iOS.xml --labels=After"
- - #@ publishTestsResults("TestResults.iOS.xml", "Maui.iOS")
\ No newline at end of file
+ - #@ template.replace(publishTestsResults("TestResults.iOS.xml", "Maui.iOS", run_transform=True))
\ No newline at end of file
diff --git a/.github/templates/test-macos.yml b/.github/templates/test-macos.yml
index 2dd1bae7e3..4d4cb0ca72 100644
--- a/.github/templates/test-macos.yml
+++ b/.github/templates/test-macos.yml
@@ -1,5 +1,5 @@
#@ load("@ytt:template", "template")
-#@ load("common.lib.yml", "checkoutCode", "configuration", "fetchPackageArtifacts", "setupWorkloads")
+#@ load("common.lib.yml", "checkoutCode", "configuration", "fetchPackageArtifacts", "setupWorkloads", "setupXcode")
#@ load("test.lib.yml", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "prepareTest")
---
@@ -15,7 +15,7 @@ jobs:
- #@ template.replace(buildTests("Tests/Tests.XamarinMac"))
- name: Run the tests
run: #@ "Tests/Tests.XamarinMac/bin/" + configuration + "/Tests.XamarinMac.app/Contents/MacOS/Tests.XamarinMac --headless --result=${{ github.workspace }}/TestResults.XamarinMac.xml --labels=All" + baasTestArgs("xamarinmacos")
- - #@ publishTestsResults("TestResults.XamarinMac.xml", "Xamarin.macOS")
+ - #@ template.replace(publishTestsResults("TestResults.XamarinMac.xml", "Xamarin.macOS"))
test-maui:
runs-on: macos-13
name: Maui.MacCatalyst
@@ -23,9 +23,10 @@ jobs:
steps:
- #@ template.replace(checkoutCode())
- #@ template.replace(fetchPackageArtifacts())
+ - #@ setupXcode("latest-stable")
- #@ template.replace(setupWorkloads())
- name: Build the tests
- run: #@ "dotnet build Tests/Tests.Maui -c " + configuration + " -f net6.0-maccatalyst -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}"
+ run: #@ "dotnet build Tests/Tests.Maui -c " + configuration + " -f net8.0-maccatalyst -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}"
- name: Run the tests
- run: #@ "Tests/Tests.Maui/bin/" + configuration + "/net6.0-maccatalyst/maccatalyst-x64/Tests.Maui.app/Contents/MacOS/Tests.Maui --headless --result=${{ github.workspace }}/TestResults.MacCatalyst.xml --labels=All" + baasTestArgs("maccatalyst")
- - #@ publishTestsResults("TestResults.MacCatalyst.xml", "Maui.MacCatalyst")
\ No newline at end of file
+ run: #@ "Tests/Tests.Maui/bin/" + configuration + "/net8.0-maccatalyst/maccatalyst-x64/Tests.Maui.app/Contents/MacOS/Tests.Maui --headless --result=${{ github.workspace }}/TestResults.MacCatalyst.xml --labels=All" + baasTestArgs("maccatalyst")
+ - #@ template.replace(publishTestsResults("TestResults.MacCatalyst.xml", "Maui.MacCatalyst", run_transform=True))
\ No newline at end of file
diff --git a/.github/templates/test-net-core.yml b/.github/templates/test-net-core.yml
index 875583ebc3..c2dc524126 100644
--- a/.github/templates/test-net-core.yml
+++ b/.github/templates/test-net-core.yml
@@ -1,5 +1,5 @@
#@ load("@ytt:template", "template")
-#@ load("common.lib.yml", "checkoutCode", "uploadArtifacts")
+#@ load("common.lib.yml", "checkoutCode", "uploadArtifacts", "setupDotnet")
#@ load("test.lib.yml", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "dotnetBuildTests", "prepareTest")
---
@@ -22,14 +22,14 @@ jobs:
runtime: osx-x64
framework: ${{ fromJson(inputs.framework) }}
include:
- - framework: net7.0
+ - framework: net8.0
os:
runner: macos-14
runtime: osx-arm64
- - framework: net7.0
- os:
- runner: win81
- runtime: win-x64
+ #! - framework: net6.0 // Need to install net8 sdk to the win81 runner
+ #! os:
+ #! runner: win81
+ #! runtime: win-x64
steps:
- #@ template.replace(prepareTest(cleanupWorkspace = True))
@@ -37,6 +37,7 @@ jobs:
- name: Clear nuget cache
run: dotnet nuget locals all --clear
if: ${{ matrix.os.runner == 'win81' }}
+ - _: #@ template.replace(setupDotnet())
- #@ template.replace(dotnetBuildTests("Tests/Realm.Tests", "${{ matrix.framework }}", "${{ matrix.os.runtime }}"))
- name: Run the tests
env:
@@ -49,4 +50,4 @@ jobs:
with:
name: crash-report-net-core-${{ matrix.runner }}-${{ matrix.runtime }}
path: /tmp/coredump*
- - #@ publishTestsResults("TestResults.xml", ".NET (${{ matrix.os.runner }}, ${{ matrix.framework }})")
+ - #@ template.replace(publishTestsResults("TestResults.xml", ".NET (${{ matrix.os.runner }}, ${{ matrix.framework }})"))
diff --git a/.github/templates/test-net-framework.yml b/.github/templates/test-net-framework.yml
index 558b48d925..3afe46653e 100644
--- a/.github/templates/test-net-framework.yml
+++ b/.github/templates/test-net-framework.yml
@@ -15,4 +15,4 @@ jobs:
- #@ template.replace(buildTests("Tests/Realm.Tests", TargetFramework="net461", RealmTestsStandaloneExe="true"))
- name: Run the tests
run: #@ "./Tests/Realm.Tests/bin/" + configuration + "/net461/Realm.Tests.exe --result=TestResults.Windows.xml --labels=After" + baasTestArgs("net-framework")
- - #@ publishTestsResults("TestResults.Windows.xml", ".NET Framework")
+ - #@ template.replace(publishTestsResults("TestResults.Windows.xml", ".NET Framework"))
diff --git a/.github/templates/test-source-generation.yml b/.github/templates/test-source-generation.yml
index 39eb311a04..56b06b3525 100644
--- a/.github/templates/test-source-generation.yml
+++ b/.github/templates/test-source-generation.yml
@@ -17,4 +17,4 @@ jobs:
- #@ template.replace(dotnetPublish("Tests/SourceGenerators/Realm.SourceGenerator.Tests", "net6.0", "win-x64"))
- name: Run the tests
run: #@ "${{ steps.dotnet-publish.outputs.executable-path }}/Realm.SourceGenerator.Tests --result=TestResults.SourceGeneration.xml"
- - #@ publishTestsResults("TestResults.SourceGeneration.xml", "Source Generation")
+ - #@ template.replace(publishTestsResults("TestResults.SourceGeneration.xml", "Source Generation"))
diff --git a/.github/templates/test-tvos.yml b/.github/templates/test-tvos.yml
index e5bcf537c7..1000a24a78 100644
--- a/.github/templates/test-tvos.yml
+++ b/.github/templates/test-tvos.yml
@@ -21,4 +21,4 @@ jobs:
iphoneToSimulate: 'Apple-TV-1080p'
arguments: #@ "--headless --result=${{ github.workspace }}/TestResults.tvOS.xml --labels=All" + baasTestArgs("tvos")
os: 'tvOS'
- - #@ publishTestsResults("TestResults.tvOS.xml", "Xamarin.tvOS")
\ No newline at end of file
+ - #@ template.replace(publishTestsResults("TestResults.tvOS.xml", "Xamarin.tvOS"))
\ No newline at end of file
diff --git a/.github/templates/test-unity.yml b/.github/templates/test-unity.yml
index f3ccb8f6f4..18ce107bd9 100644
--- a/.github/templates/test-unity.yml
+++ b/.github/templates/test-unity.yml
@@ -72,7 +72,7 @@ jobs:
run: |
chmod +x ${{ github.workspace }}/TestRunner/PlayerWithTests.x86_64
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' ${{ github.workspace }}/TestRunner/PlayerWithTests.x86_64 -logFile - --result=${{ github.workspace }}/TestResults.xml
- - #@ publishTestsResults("TestResults.xml", "Unity Linux Mono_Net4")
+ - #@ template.replace(publishTestsResults("TestResults.xml", "Unity Linux Mono_Net4"))
run-tests-windows:
runs-on: windows-latest
@@ -93,4 +93,4 @@ jobs:
Start-Process ${{ github.workspace }}\TestRunner\PlayerWithTests.exe -Wait -ArgumentList "-logFile","${{ github.workspace }}\test.log","--result=${{ github.workspace }}\TestResults.xml"
cat ${{ github.workspace }}\test.log
shell: powershell
- - #@ publishTestsResults("TestResults.xml", "Unity Windows Mono_Net4")
+ - #@ template.replace(publishTestsResults("TestResults.xml", "Unity Windows Mono_Net4"))
diff --git a/.github/templates/test-uwp-managed.yml b/.github/templates/test-uwp-managed.yml
index 8b95ef43c0..402023fc66 100644
--- a/.github/templates/test-uwp-managed.yml
+++ b/.github/templates/test-uwp-managed.yml
@@ -23,4 +23,4 @@ jobs:
- name: Run the tests
run: #@ "./Tests/Tests.UWP/RunTests.ps1 -ExtraAppArgs '" + baasTestArgs("uwp-managed") + "'"
shell: powershell
- - #@ publishTestsResults("${{ env.TEST_RESULTS }}", "UWP Managed")
+ - #@ template.replace(publishTestsResults("${{ env.TEST_RESULTS }}", "UWP Managed"))
diff --git a/.github/templates/test-weaver.yml b/.github/templates/test-weaver.yml
index d774c7ace7..07b30f0ca7 100644
--- a/.github/templates/test-weaver.yml
+++ b/.github/templates/test-weaver.yml
@@ -30,4 +30,4 @@ jobs:
- #@ template.replace(dotnetPublish("Tests/Weaver/Realm.Fody.Tests", "net6.0", "${{ matrix.os.runtime }}"))
- name: Run Tests
run: ${{ steps.dotnet-publish.outputs.executable-path }}/Realm.Fody.Tests --result=TestResults.Weaver.xml --labels=After
- - #@ publishTestsResults("TestResults.Weaver.xml", "Weaver ${{ matrix.os.runtime }}")
+ - #@ template.replace(publishTestsResults("TestResults.Weaver.xml", "Weaver ${{ matrix.os.runtime }}"))
diff --git a/.github/templates/test-woven-classes.yml b/.github/templates/test-woven-classes.yml
index 3343b9587d..741014778d 100644
--- a/.github/templates/test-woven-classes.yml
+++ b/.github/templates/test-woven-classes.yml
@@ -13,7 +13,7 @@ jobs:
steps:
- #@ template.replace(checkoutCode())
- #@ template.replace(fetchPackageArtifacts())
- - #@ template.replace(wovenClassesBuildTests("Tests/Realm.Tests", "net7.0", "win-x64"))
+ - #@ template.replace(wovenClassesBuildTests("Tests/Realm.Tests", "net8.0", "win-x64"))
- name: Run the tests
run: #@ "${{ steps.dotnet-publish.outputs.executable-path }}/Realm.Tests --result=TestResults.WovenClasses.xml --labels=After"
- - #@ publishTestsResults("TestResults.WovenClasses.xml", "Woven classes")
+ - #@ template.replace(publishTestsResults("TestResults.WovenClasses.xml", "Woven classes"))
diff --git a/.github/templates/test.lib.yml b/.github/templates/test.lib.yml
index 719b8b42de..57690ae568 100644
--- a/.github/templates/test.lib.yml
+++ b/.github/templates/test.lib.yml
@@ -5,18 +5,25 @@
#@ return " --baasaas-api-key=${{ secrets.BaaSaasApiKey}} --baas-differentiator=" + differentiator + "-${{ github.run_id }}-${{ github.run_attempt }}"
#@ end
---
-#@ def publishTestsResults(files, test_title):
-name: Publish Unit Test Results
-uses: LaPeste/test-reporter@510caf50a955b1003bec48a6494be4d6537f3a0b
-if: always()
-with:
- name: #@ "Results " + test_title
- path: #@ files
- reporter: java-junit
- list-suites: failed
- list-tests: failed
- path-replace-backslashes: true
- fail-on-error: false
+#@ def publishTestsResults(file, test_title, run_transform=False):
+ #@ output_file = file
+ #@ if run_transform:
+ #@ output_file = file + "_transformed.xml"
+ - name: Transform Results
+ run: #@ "xsltproc --output " + output_file + " Tests/Realm.Tests/EmbeddedResources/nunit3-junit.xslt " + file
+ shell: bash
+ #@ end
+ - name: Publish Unit Test Results
+ uses: LaPeste/test-reporter@510caf50a955b1003bec48a6494be4d6537f3a0b
+ if: always()
+ with:
+ name: #@ "Results " + test_title
+ path: #@ output_file
+ reporter: java-junit
+ list-suites: failed
+ list-tests: failed
+ path-replace-backslashes: true
+ fail-on-error: false
#@ end
---
#@ def testDefinition(additionalSecrets = [], additionalInputs = []):
diff --git a/.github/templates/wrappers.yml b/.github/templates/wrappers.yml
index 3d3ffcd51c..60d57ae2dc 100644
--- a/.github/templates/wrappers.yml
+++ b/.github/templates/wrappers.yml
@@ -36,6 +36,10 @@ with:
if: #@ wrappersCacheCondition
#@ end
---
+#@ def setupXcodeStep():
+ - #@ setupXcode()
+#@ end
+---
#@ def buildWrappers(cmd, outputVar, intermediateSteps = [], enableLto = True, artifactsPath = "wrappers/build/**", cacheVariable = ""):
#@ if cacheVariable == "":
#@ cacheVariable = outputVar
@@ -105,7 +109,7 @@ jobs:
matrix:
platform: #@ applePlatforms
target: [ 'Device', 'Simulator' ]
- _: #@ template.replace(buildWrappers("pwsh ./wrappers/build-apple-platform.ps1 ${{ matrix.platform }} -Targets ${{ matrix.target }}", "wrappers-${{ matrix.platform }}-${{ matrix.target }}", enableLto = False, intermediateSteps = [setupXcode()]))
+ _: #@ template.replace(buildWrappers("pwsh ./wrappers/build-apple-platform.ps1 ${{ matrix.platform }} -Targets ${{ matrix.target }}", "wrappers-${{ matrix.platform }}-${{ matrix.target }}", enableLto = False, intermediateSteps = [setupXcodeStep()]))
#@yaml/map-key-override
if: #@ " || ".join([ "needs.check-cache.outputs.wrappers-" + x + "-Device != 'true'" for x in applePlatforms ] + [ "needs.check-cache.outputs.wrappers-" + x + "-Simulator != 'true'" for x in applePlatforms ])
linux:
diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml
index 89283c2877..051719deb3 100755
--- a/.github/workflows/build-packages.yml
+++ b/.github/workflows/build-packages.yml
@@ -39,9 +39,9 @@ jobs:
distribution: microsoft
java-version: 11
- name: Configure .NET
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
+ uses: actions/setup-dotnet@3e6b9fe3930cac7c59c651af5de1514b47a805b9
with:
- dotnet-version: 7.0.x
+ dotnet-version: 8.0.x
- name: Setup workloads
run: dotnet workload install tvos ios maccatalyst android
- name: Set version suffix
@@ -227,10 +227,10 @@ jobs:
Expand-Archive -Path C:\docfx.zip -DestinationPath C:\docfx
shell: powershell
- name: Configure .NET
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
+ uses: actions/setup-dotnet@3e6b9fe3930cac7c59c651af5de1514b47a805b9
if: inputs.build-docs
with:
- dotnet-version: 7.0.x
+ dotnet-version: 8.0.x
- name: Build docs
if: inputs.build-docs
env:
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index a1e5cfe7cd..533a060bec 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -51,9 +51,9 @@ jobs:
distribution: microsoft
java-version: 11
- name: Configure .NET
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
+ uses: actions/setup-dotnet@3e6b9fe3930cac7c59c651af5de1514b47a805b9
with:
- dotnet-version: 7.0.x
+ dotnet-version: 8.0.x
- name: Setup workloads
run: dotnet workload install tvos ios maccatalyst android
- name: Add msbuild to PATH
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index a4b9d58f00..573602e82a 100755
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -54,9 +54,9 @@ jobs:
name: Realm.${{ needs.build-packages.outputs.package_version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Configure .NET
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
+ uses: actions/setup-dotnet@3e6b9fe3930cac7c59c651af5de1514b47a805b9
with:
- dotnet-version: 6.0.x
+ dotnet-version: 8.0.x
- name: Install sleet
run: dotnet tool install -g sleet
- name: Configure AWS Credentials
@@ -109,7 +109,7 @@ jobs:
uses: ./.github/workflows/test-net-core.yml
with:
version: ${{ needs.build-packages.outputs.package_version }}
- framework: '["net6.0", "net7.0"]'
+ framework: '["net6.0", "net8.0"]'
test-macos:
uses: ./.github/workflows/test-macos.yml
name: Test
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index 6a9889f38f..6529e3a712 100755
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -86,7 +86,7 @@ jobs:
uses: ./.github/workflows/test-net-core.yml
with:
version: ${{ needs.build-packages.outputs.package_version }}
- framework: '["net7.0"]'
+ framework: '["net8.0"]'
test-macos:
uses: ./.github/workflows/test-macos.yml
name: Test
diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml
index 14588ea237..9957bdf409 100644
--- a/.github/workflows/prepare-release.yml
+++ b/.github/workflows/prepare-release.yml
@@ -31,7 +31,7 @@ jobs:
include: Realm/Realm.Weaver/Analytics/Analytics.cs
- name: Update Changelog
id: update-changelog
- uses: realm/ci-actions/update-changelog@fa20eb972b9f018654fdb4e2c7afb52b0532f907
+ uses: realm/ci-actions/update-changelog@6418e15ed9bbdb19b7d456a347e5623779f95cdf
with:
changelog: ${{ github.workspace }}/CHANGELOG.md
version: ${{ inputs.version }}
diff --git a/.github/workflows/publish-prerelease.yml b/.github/workflows/publish-prerelease.yml
index 98b3abf6f8..f5c9a36f02 100644
--- a/.github/workflows/publish-prerelease.yml
+++ b/.github/workflows/publish-prerelease.yml
@@ -25,9 +25,9 @@ jobs:
echo "version=$pkgVersion" >> $GITHUB_OUTPUT
shell: bash
- name: Configure .NET
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
+ uses: actions/setup-dotnet@3e6b9fe3930cac7c59c651af5de1514b47a805b9
with:
- dotnet-version: 6.0.x
+ dotnet-version: 8.0.x
- name: Install sleet
run: dotnet tool install -g sleet
- name: Configure AWS Credentials
diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml
index 12cbd47de4..cda9bc4d06 100755
--- a/.github/workflows/publish-release.yml
+++ b/.github/workflows/publish-release.yml
@@ -106,7 +106,7 @@ jobs:
number: ${{ steps.vnext-pr.outputs.pull-request-number }}
method: squash
- name: 'Post to #realm-releases'
- uses: realm/ci-actions/release-to-slack@fa20eb972b9f018654fdb4e2c7afb52b0532f907
+ uses: realm/ci-actions/release-to-slack@6418e15ed9bbdb19b7d456a347e5623779f95cdf
with:
changelog: Realm/packages/ExtractedChangelog/ExtractedChangelog.md
sdk: .NET
diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml
index bc85c7912c..8f5457f0c8 100755
--- a/.github/workflows/test-android.yml
+++ b/.github/workflows/test-android.yml
@@ -111,9 +111,9 @@ jobs:
name: Realm.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Configure .NET
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
+ uses: actions/setup-dotnet@3e6b9fe3930cac7c59c651af5de1514b47a805b9
with:
- dotnet-version: 7.0.x
+ dotnet-version: 8.0.x
- name: Setup workloads
run: dotnet workload install maui
- name: Setup JDK
@@ -122,7 +122,7 @@ jobs:
distribution: microsoft
java-version: 11
- name: Build the tests
- run: dotnet publish Tests/Tests.Maui -c Release -f net6.0-android -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}
+ run: dotnet publish Tests/Tests.Maui -c Release -f net8.0-android -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
@@ -133,16 +133,19 @@ jobs:
uses: ./.github/actions/run-android-device-farm-test
id: run_tests
with:
- apk-path: ${{ github.workspace }}/Tests/Tests.Maui/bin/Release/net6.0-android/publish/io.realm.mauitests-Signed.apk
+ apk-path: ${{ github.workspace }}/Tests/Tests.Maui/bin/Release/net8.0-android/publish/io.realm.mauitests-Signed.apk
app-id: io.realm.mauitests
project-arn: ${{ secrets.DEVICEFARM_PROJECT_ARN }}
device-pool-arn: ${{ secrets.DEVICEFARM_ANDROID_POOL_ARN }}
+ - name: Transform Results
+ run: xsltproc --output ${{ steps.run_tests.outputs.test-results-path }}_transformed.xml Tests/Realm.Tests/EmbeddedResources/nunit3-junit.xslt ${{ steps.run_tests.outputs.test-results-path }}
+ shell: bash
- name: Publish Unit Test Results
uses: LaPeste/test-reporter@510caf50a955b1003bec48a6494be4d6537f3a0b
if: always()
with:
name: Results Maui.Android
- path: ${{ steps.run_tests.outputs.test-results-path }}
+ path: ${{ steps.run_tests.outputs.test-results-path }}_transformed.xml
reporter: java-junit
list-suites: failed
list-tests: failed
diff --git a/.github/workflows/test-code-coverage.yml b/.github/workflows/test-code-coverage.yml
index 762397a5cc..b6570ac016 100755
--- a/.github/workflows/test-code-coverage.yml
+++ b/.github/workflows/test-code-coverage.yml
@@ -138,10 +138,10 @@ jobs:
dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools
echo "${{ github.workspace }}/tools" >> $GITHUB_PATH
- name: Publish Tests/Realm.Tests
- run: dotnet publish Tests/Realm.Tests -c Release -f net7.0 -r linux-x64 -p:RealmTestsStandaloneExe=true --no-self-contained
+ run: dotnet publish Tests/Realm.Tests -c Release -f net8.0 -r linux-x64 -p:RealmTestsStandaloneExe=true --no-self-contained
- name: Output executable path
id: dotnet-publish
- run: echo 'executable-path=./Tests/Realm.Tests/bin/Release/net7.0/linux-x64' >> $GITHUB_OUTPUT
+ run: echo 'executable-path=./Tests/Realm.Tests/bin/Release/net8.0/linux-x64' >> $GITHUB_OUTPUT
shell: bash
- name: Run the tests
env:
diff --git a/.github/workflows/test-ios.yml b/.github/workflows/test-ios.yml
index b6ac7b0b81..8548ee23d8 100755
--- a/.github/workflows/test-ios.yml
+++ b/.github/workflows/test-ios.yml
@@ -48,7 +48,7 @@ jobs:
- name: Build Tests/Tests.iOS
run: msbuild Tests/Tests.iOS -p:Configuration=Release -restore -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} -p:Platform=iPhoneSimulator
- name: Run the tests
- uses: realm/ci-actions/run-ios-simulator@fa20eb972b9f018654fdb4e2c7afb52b0532f907
+ uses: realm/ci-actions/run-ios-simulator@6418e15ed9bbdb19b7d456a347e5623779f95cdf
with:
appPath: Tests/Tests.iOS/bin/iPhoneSimulator/Release/Tests.iOS.app
bundleId: io.realm.dotnettests
@@ -89,32 +89,34 @@ jobs:
with:
name: Realm.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- - name: Set XCode Version
- shell: bash
- run: |
- sudo xcode-select -s "/Applications/Xcode_14.3.app"
- echo "MD_APPLE_SDK_ROOT=/Applications/Xcode_14.3.app" >> $GITHUB_ENV
+ - name: Setup Xcode
+ uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
+ with:
+ xcode-version: latest-stable
- name: Configure .NET
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
+ uses: actions/setup-dotnet@3e6b9fe3930cac7c59c651af5de1514b47a805b9
with:
- dotnet-version: 7.0.x
+ dotnet-version: 8.0.x
- name: Setup workloads
run: dotnet workload install maui
- name: Build the tests
- run: dotnet build Tests/Tests.Maui -c Release -f net6.0-ios -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}
+ run: dotnet build Tests/Tests.Maui -c Release -f net8.0-ios -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}
- name: Run the tests
- uses: realm/ci-actions/run-ios-simulator@fa20eb972b9f018654fdb4e2c7afb52b0532f907
+ uses: realm/ci-actions/run-ios-simulator@6418e15ed9bbdb19b7d456a347e5623779f95cdf
with:
- appPath: Tests/Tests.Maui/bin/Release/net6.0-ios/iossimulator-x64/Tests.Maui.app
+ appPath: Tests/Tests.Maui/bin/Release/net8.0-ios/iossimulator-x64/Tests.Maui.app
bundleId: io.realm.mauitests
- iphoneToSimulate: iPhone-8
+ iphoneToSimulate: iPhone-15
arguments: --headless --result=${{ github.workspace }}/TestResults.iOS.xml --labels=After
+ - name: Transform Results
+ run: xsltproc --output TestResults.iOS.xml_transformed.xml Tests/Realm.Tests/EmbeddedResources/nunit3-junit.xslt TestResults.iOS.xml
+ shell: bash
- name: Publish Unit Test Results
uses: LaPeste/test-reporter@510caf50a955b1003bec48a6494be4d6537f3a0b
if: always()
with:
name: Results Maui.iOS
- path: TestResults.iOS.xml
+ path: TestResults.iOS.xml_transformed.xml
reporter: java-junit
list-suites: failed
list-tests: failed
diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml
index 37b90a3db5..079ee24b69 100755
--- a/.github/workflows/test-macos.yml
+++ b/.github/workflows/test-macos.yml
@@ -84,22 +84,29 @@ jobs:
with:
name: Realm.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
+ - name: Setup Xcode
+ uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
+ with:
+ xcode-version: latest-stable
- name: Configure .NET
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
+ uses: actions/setup-dotnet@3e6b9fe3930cac7c59c651af5de1514b47a805b9
with:
- dotnet-version: 7.0.x
+ dotnet-version: 8.0.x
- name: Setup workloads
run: dotnet workload install maui
- name: Build the tests
- run: dotnet build Tests/Tests.Maui -c Release -f net6.0-maccatalyst -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}
+ run: dotnet build Tests/Tests.Maui -c Release -f net8.0-maccatalyst -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}
- name: Run the tests
- run: Tests/Tests.Maui/bin/Release/net6.0-maccatalyst/maccatalyst-x64/Tests.Maui.app/Contents/MacOS/Tests.Maui --headless --result=${{ github.workspace }}/TestResults.MacCatalyst.xml --labels=All --baasaas-api-key=${{ secrets.BaaSaasApiKey}} --baas-differentiator=maccatalyst-${{ github.run_id }}-${{ github.run_attempt }}
+ run: Tests/Tests.Maui/bin/Release/net8.0-maccatalyst/maccatalyst-x64/Tests.Maui.app/Contents/MacOS/Tests.Maui --headless --result=${{ github.workspace }}/TestResults.MacCatalyst.xml --labels=All --baasaas-api-key=${{ secrets.BaaSaasApiKey}} --baas-differentiator=maccatalyst-${{ github.run_id }}-${{ github.run_attempt }}
+ - name: Transform Results
+ run: xsltproc --output TestResults.MacCatalyst.xml_transformed.xml Tests/Realm.Tests/EmbeddedResources/nunit3-junit.xslt TestResults.MacCatalyst.xml
+ shell: bash
- name: Publish Unit Test Results
uses: LaPeste/test-reporter@510caf50a955b1003bec48a6494be4d6537f3a0b
if: always()
with:
name: Results Maui.MacCatalyst
- path: TestResults.MacCatalyst.xml
+ path: TestResults.MacCatalyst.xml_transformed.xml
reporter: java-junit
list-suites: failed
list-tests: failed
diff --git a/.github/workflows/test-net-core.yml b/.github/workflows/test-net-core.yml
index af8804c199..cd7da6b802 100755
--- a/.github/workflows/test-net-core.yml
+++ b/.github/workflows/test-net-core.yml
@@ -31,14 +31,10 @@ jobs:
runtime: osx-x64
framework: ${{ fromJson(inputs.framework) }}
include:
- - framework: net7.0
+ - framework: net8.0
os:
runner: macos-14
runtime: osx-arm64
- - framework: net7.0
- os:
- runner: win81
- runtime: win-x64
steps:
- name: Checkout code
uses: actions/checkout@v3
@@ -64,6 +60,10 @@ jobs:
- name: Clear nuget cache
run: dotnet nuget locals all --clear
if: ${{ matrix.os.runner == 'win81' }}
+ - name: Configure .NET
+ uses: actions/setup-dotnet@3e6b9fe3930cac7c59c651af5de1514b47a805b9
+ with:
+ dotnet-version: 8.0.x
- name: Publish Tests/Realm.Tests
run: dotnet publish Tests/Realm.Tests -c Release -f ${{ matrix.framework }} -r ${{ matrix.os.runtime }} -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} -p:RealmTestsStandaloneExe=true --no-self-contained
- name: Output executable path
diff --git a/.github/workflows/test-source-generation.yml b/.github/workflows/test-source-generation.yml
index 11de3d0de5..6a612b0aa8 100644
--- a/.github/workflows/test-source-generation.yml
+++ b/.github/workflows/test-source-generation.yml
@@ -17,9 +17,9 @@ jobs:
- name: Register msvc problem matcher
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Configure .NET
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
+ uses: actions/setup-dotnet@3e6b9fe3930cac7c59c651af5de1514b47a805b9
with:
- dotnet-version: 7.0.x
+ dotnet-version: 8.0.x
- name: Setup workloads
run: dotnet workload install tvos ios maccatalyst android
- name: Publish Tests/SourceGenerators/Realm.SourceGenerator.Tests
diff --git a/.github/workflows/test-tvos.yml b/.github/workflows/test-tvos.yml
index ca734dc36a..394f72ef81 100755
--- a/.github/workflows/test-tvos.yml
+++ b/.github/workflows/test-tvos.yml
@@ -42,7 +42,7 @@ jobs:
- name: Build Tests/Tests.XamarinTVOS
run: msbuild Tests/Tests.XamarinTVOS -p:Configuration=Release -restore -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} -p:Platform=iPhoneSimulator
- name: Run the tests
- uses: realm/ci-actions/run-ios-simulator@fa20eb972b9f018654fdb4e2c7afb52b0532f907
+ uses: realm/ci-actions/run-ios-simulator@6418e15ed9bbdb19b7d456a347e5623779f95cdf
with:
appPath: Tests/Tests.XamarinTVOS/bin/iPhoneSimulator/Release/Tests.XamarinTVOS.app
bundleId: io.realm.Tests-XamarinTVOS
diff --git a/.github/workflows/test-weaver.yml b/.github/workflows/test-weaver.yml
index d527b3eafb..b139235b64 100755
--- a/.github/workflows/test-weaver.yml
+++ b/.github/workflows/test-weaver.yml
@@ -29,15 +29,15 @@ jobs:
- name: Register msvc problem matcher
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Configure .NET
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
+ uses: actions/setup-dotnet@3e6b9fe3930cac7c59c651af5de1514b47a805b9
with:
- dotnet-version: 7.0.x
+ dotnet-version: 8.0.x
- name: Setup workloads
run: dotnet workload install android ${{ (matrix.os.runner != 'ubuntu-latest' && 'tvos ios maccatalyst') || '' }}
- name: Configure .NET
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
+ uses: actions/setup-dotnet@3e6b9fe3930cac7c59c651af5de1514b47a805b9
with:
- dotnet-version: 6.0.x
+ dotnet-version: 8.0.x
- name: Publish Tests/Weaver/Realm.Fody.Tests
run: dotnet publish Tests/Weaver/Realm.Fody.Tests -c Release -f net6.0 -r ${{ matrix.os.runtime }} --no-self-contained
- name: Output executable path
diff --git a/.github/workflows/test-woven-classes.yml b/.github/workflows/test-woven-classes.yml
index 48d08a5e96..abf4eb74bf 100644
--- a/.github/workflows/test-woven-classes.yml
+++ b/.github/workflows/test-woven-classes.yml
@@ -37,10 +37,10 @@ jobs:
name: Realm.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Publish Tests/Realm.Tests
- run: dotnet publish Tests/Realm.Tests -c Release -f net7.0 -r win-x64 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} -p:TestWeavedClasses=true -p:RealmTestsStandaloneExe=true --no-self-contained
+ run: dotnet publish Tests/Realm.Tests -c Release -f net8.0 -r win-x64 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} -p:TestWeavedClasses=true -p:RealmTestsStandaloneExe=true --no-self-contained
- name: Output executable path
id: dotnet-publish
- run: echo 'executable-path=./Tests/Realm.Tests/bin/Release/net7.0/win-x64' >> $GITHUB_OUTPUT
+ run: echo 'executable-path=./Tests/Realm.Tests/bin/Release/net8.0/win-x64' >> $GITHUB_OUTPUT
shell: bash
- name: Run the tests
run: ${{ steps.dotnet-publish.outputs.executable-path }}/Realm.Tests --result=TestResults.WovenClasses.xml --labels=After
diff --git a/.github/workflows/wipe-clusters.yml b/.github/workflows/wipe-clusters.yml
index 5a87e46fc9..7393299d67 100644
--- a/.github/workflows/wipe-clusters.yml
+++ b/.github/workflows/wipe-clusters.yml
@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
name: Wipe all clusters and apps
steps:
- - uses: realm/ci-actions/mdb-realm/deleteAllClusters@fa20eb972b9f018654fdb4e2c7afb52b0532f907
+ - uses: realm/ci-actions/mdb-realm/deleteAllClusters@6418e15ed9bbdb19b7d456a347e5623779f95cdf
with:
realmUrl: https://realm-qa.mongodb.com
atlasUrl: https://cloud-qa.mongodb.com
diff --git a/.github/workflows/wrappers.yml b/.github/workflows/wrappers.yml
index fe45ebe2c2..ea7020c00f 100755
--- a/.github/workflows/wrappers.yml
+++ b/.github/workflows/wrappers.yml
@@ -467,7 +467,7 @@ jobs:
path: ./wrappers/build/**
key: wrappers-${{ matrix.platform }}-${{ matrix.target }}-Release-${{hashFiles('./wrappers/**')}}
- name: Setup Xcode
- uses: maxim-lobanov/setup-xcode@9a697e2b393340c3cacd97468baa318e4c883d98
+ uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: 14.0.1
- name: Build wrappers
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ea10719e35..bd8a0ca18d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
## vNext (TBD)
+### Breaking Changes
+* Added automatic serialization and deserialization of Realm classes when using methods on `MongoClient.Collection`, without the need to annotate classes with `MongoDB.Bson`attributes. This feature required to change the default serialization for various types (including `DateTimeOffset`). If you prefer to use the previous serialization, you need to call `Realm.SetLegacySerialization` before any kind of serialization is done, otherwise it may not work as epxected. [#3459](https://github.com/realm/realm-dotnet/pull/3459)
+* The returned value from `MongoClient.Collection.FindOneAsync` is now a nullable document to more explicitly convey that `null` may be returned in case no object matched the filter.
+
### Enhancements
* None
diff --git a/Realm.sln.DotSettings b/Realm.sln.DotSettings
index 40903ac831..9e64533eaf 100644
--- a/Realm.sln.DotSettings
+++ b/Realm.sln.DotSettings
@@ -97,6 +97,7 @@
True
True
True
+ True
True
True
True
diff --git a/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj b/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj
index d976a3ba86..b04840911b 100644
--- a/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj
+++ b/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj
@@ -10,7 +10,7 @@
netstandard2.0
- $(TargetFrameworks);net6.0-ios;net6.0-android;net6.0-maccatalyst;net6.0-tvos
+ $(TargetFrameworks);net7.0-ios;net7.0-android;net7.0-maccatalyst;net7.0-tvos
@@ -44,11 +44,11 @@
-
+
-
+
diff --git a/Realm/Realm/Realm.csproj b/Realm/Realm/Realm.csproj
index 4634c63aff..93e7caa304 100644
--- a/Realm/Realm/Realm.csproj
+++ b/Realm/Realm/Realm.csproj
@@ -1,12 +1,12 @@
- netstandard2.0;net6.0
+ netstandard2.0;net6.0;net8.0
Realms
true
true
true
- 10.0
+ 12
Realm
https://docs.mongodb.com/realm-sdks/dotnet/latest/CHANGELOG.html
$(ProjectDir)..\..\global.ruleset
diff --git a/Realm/Realm/Sync/MongoClient.cs b/Realm/Realm/Sync/MongoClient.cs
index 289b1057ee..dd5f7dcb04 100644
--- a/Realm/Realm/Sync/MongoClient.cs
+++ b/Realm/Realm/Sync/MongoClient.cs
@@ -345,8 +345,8 @@ public Task FindAsync(object? filter = null, object? sort = null, o
/// An awaitable representing the remote find one operation. The result of the task is the first document that matches the find criteria.
///
///
- public Task FindOneAsync(object? filter = null, object? sort = null, object? projection = null)
- => InvokeOperationAsync("findOne", "query", filter, "project", projection, "sort", sort);
+ public Task FindOneAsync(object? filter = null, object? sort = null, object? projection = null)
+ => InvokeOperationAsync("findOne", "query", filter, "project", projection, "sort", sort);
///
/// Finds the first document in the collection that satisfies the query criteria.
@@ -435,8 +435,8 @@ public async Task FindOneAndReplaceAsync(object? filter, TDocument re
/// An awaitable representing the remote find one operation. The result of the task is the first document that matches the find criteria.
///
///
- public Task FindOneAndDeleteAsync(object? filter = null, object? sort = null, object? projection = null)
- => InvokeOperationAsync("findOneAndDelete", "filter", filter, "projection", projection, "sort", sort);
+ public Task FindOneAndDeleteAsync(object? filter = null, object? sort = null, object? projection = null)
+ => InvokeOperationAsync("findOneAndDelete", "filter", filter, "projection", projection, "sort", sort);
///
/// Executes an aggregation pipeline on the collection and returns the results as a array.
diff --git a/Tests/Realm.Tests/Realm.Tests.csproj b/Tests/Realm.Tests/Realm.Tests.csproj
index f0874b632d..dc7fa2dacc 100644
--- a/Tests/Realm.Tests/Realm.Tests.csproj
+++ b/Tests/Realm.Tests/Realm.Tests.csproj
@@ -6,7 +6,7 @@
in the project file, but the NUnit test adapter doesn't support .NET Standard 2.0, so it should never be
first in the list.
-->
- $(TargetFrameworks);net6.0;net7.0
+ $(TargetFrameworks);net6.0;net8.0
$(TargetFrameworks);net461
$(TargetFrameworks);netstandard2.0
9.0
diff --git a/Tests/Realm.Tests/Sync/MongoClientTests.cs b/Tests/Realm.Tests/Sync/MongoClientTests.cs
index d6eb2e553a..6dc426b85a 100644
--- a/Tests/Realm.Tests/Sync/MongoClientTests.cs
+++ b/Tests/Realm.Tests/Sync/MongoClientTests.cs
@@ -797,6 +797,9 @@ public void MongoCollection_FindOne()
{
var collection = await GetCollection();
+ var nonexistent = await collection.FindOneAsync();
+ Assert.That(nonexistent, Is.Null);
+
var inserted = await InsertSomeData(collection, 3);
var result = await collection.FindOneAsync();
@@ -2105,7 +2108,8 @@ public void MongoCollection_FindOneAndDelete_FilterSortProjection()
var projection = BsonDocument.Parse("{ LongValue: 1 }");
var result = await collection.FindOneAndDeleteAsync(filter, sort, projection);
- Assert.That(result.Id, Is.EqualTo(inserted[1].Id));
+ Assert.That(result, Is.Not.Null);
+ Assert.That(result!.Id, Is.EqualTo(inserted[1].Id));
Assert.That(result.StringValue, Is.Null);
Assert.That(result.LongValue, Is.EqualTo(inserted[1].LongValue));
@@ -2123,7 +2127,8 @@ public void MongoCollection_FindOne_Remapped()
var inserted = await InsertRemappedData(collection);
var result = await collection.FindOneAsync();
- Assert.That(result.Id, Is.EqualTo(inserted[0].Id));
+ Assert.That(result, Is.Not.Null);
+ Assert.That(result!.Id, Is.EqualTo(inserted[0].Id));
Assert.That(result.StringValue, Is.EqualTo(inserted[0].StringValue));
Assert.That(result.MappedLink!.Id, Is.EqualTo(inserted[1].Id));
Assert.That(result.MappedList[0].Id, Is.EqualTo(inserted[2].Id));
diff --git a/Tests/Realm.Tests/Sync/StaticQueriesTests.cs b/Tests/Realm.Tests/Sync/StaticQueriesTests.cs
index 0879cd696e..f4864edec7 100644
--- a/Tests/Realm.Tests/Sync/StaticQueriesTests.cs
+++ b/Tests/Realm.Tests/Sync/StaticQueriesTests.cs
@@ -28,7 +28,6 @@
using Realms.Schema;
using Realms.Sync;
using Realms.Sync.Exceptions;
-
using static Realms.Tests.TestHelpers;
namespace Realms.Tests.Sync
@@ -63,15 +62,15 @@ public void RealmObjectAPI_Collections()
var syncObj1 = syncObjects.Single();
- AssertProps(obj1, syncObj1);
+ AssertCollectionProps(obj1, syncObj1);
realm.Write(() => realm.Add(syncObj2));
var filter = new { _id = syncObj2.Id };
- var obj2 = await WaitForConditionAsync(() => collection.FindOneAsync(filter), item => Task.FromResult(item != null));
+ var obj2 = await WaitForNonNullObjectAsync(() => collection.FindOneAsync(filter));
- AssertProps(syncObj2, obj2);
+ AssertCollectionProps(syncObj2, obj2);
void FillCollectionProps(SyncCollectionsObject obj)
{
@@ -81,7 +80,7 @@ void FillCollectionProps(SyncCollectionsObject obj)
}
}
- void AssertProps(SyncCollectionsObject expected, SyncCollectionsObject actual)
+ void AssertCollectionProps(SyncCollectionsObject expected, SyncCollectionsObject actual)
{
foreach (var prop in props)
{
@@ -94,7 +93,7 @@ void AssertProps(SyncCollectionsObject expected, SyncCollectionsObject actual)
}, timeout: 120000);
}
- public static readonly object[] PrimitiveTestCases = new[]
+ public static readonly object[] PrimitiveTestCases =
{
new object[] { CreateTestCase("Empty object", new SyncAllTypesObject()) },
new object[]
@@ -175,7 +174,7 @@ public void RealmObjectAPI_Primitive_RealmToAtlas(TestCaseData collection.FindOneAsync(filter), item => Task.FromResult(item != null));
+ var syncObj = await WaitForNonNullObjectAsync(() => collection.FindOneAsync(filter));
AssertProps(props, obj, syncObj);
}, timeout: 120000);
@@ -189,7 +188,7 @@ public void RealmObjectAPI_Primitive_RealmToAtlas(TestCaseData te
}, timeout: 120000);
}
- public static readonly object[] DateTimeTestCasesRealmToAtlas = new[]
+ public static readonly object[] DateTimeTestCasesRealmToAtlas =
{
new object[] { CreateTestCase("PostEpoch", new DateTimeOffset(638404890727190000, TimeSpan.Zero)) },
new object[] { CreateTestCase("PostEpoch-subprecision", new DateTimeOffset(638404890727196472, TimeSpan.Zero)) },
@@ -238,7 +237,7 @@ public void RealmObjectAPI_DateTime_RealmToAtlas(TestCaseData te
var filter = new { _id = obj.Id };
- var syncObj = await WaitForConditionAsync(() => collection.FindOneAsync(filter), item => Task.FromResult(item != null));
+ var syncObj = await WaitForNonNullObjectAsync(() => collection.FindOneAsync(filter));
AssertAreEqual(syncObj.DateTimeOffsetProperty, obj.DateTimeOffsetProperty);
}, timeout: 120000);
@@ -261,7 +260,7 @@ public void RealmObjectAPI_DateTime_RealmToAtlas_SpecialCase()
var filter = new { _id = obj.Id };
- var syncObj = await WaitForConditionAsync(() => collection.FindOneAsync(filter), item => Task.FromResult(item != null));
+ var syncObj = await WaitForNonNullObjectAsync(() => collection.FindOneAsync(filter));
var originalUnixMs = obj.DateTimeOffsetProperty.ToUnixTimeMilliseconds();
var expectedUnixMs = syncObj.DateTimeOffsetProperty.ToUnixTimeMilliseconds();
@@ -270,7 +269,7 @@ public void RealmObjectAPI_DateTime_RealmToAtlas_SpecialCase()
}, timeout: 120000);
}
- public static readonly object[] CounterTestCases = new[]
+ public static readonly object[] CounterTestCases =
{
new object[]
{
@@ -342,13 +341,13 @@ public void RealmObjectAPI_Counter_RealmToAtlas(TestCaseData test
var filter = new { _id = obj.Id };
- var syncObj = await WaitForConditionAsync(() => collection.FindOneAsync(filter), item => Task.FromResult(item != null));
+ var syncObj = await WaitForNonNullObjectAsync(() => collection.FindOneAsync(filter));
AssertProps(props, obj, syncObj);
}, timeout: 120000);
}
- public static readonly object[] AsymmetricTestCases = new[]
+ public static readonly object[] AsymmetricTestCases =
{
new object[]
{
@@ -370,13 +369,13 @@ public void RealmObjectAPI_Asymmetric_RealmToAtlas(TestCaseData realm.Add(obj));
- var syncObj = await WaitForConditionAsync(() => collection.FindOneAsync(filter), item => Task.FromResult(item != null));
+ var syncObj = await WaitForNonNullObjectAsync(() => collection.FindOneAsync(filter));
Assert.That(stringProperty, Is.EqualTo(syncObj.PartitionLike));
}, timeout: 120000);
}
- public static readonly object[] ObjectTestCases = new[]
+ public static readonly object[] ObjectTestCases =
{
new object[]
{
@@ -433,8 +432,8 @@ public void RealmObjectAPI_Object_RealmToAtlas(TestCaseData
await realm.All().Where(o => o.Id == obj.ObjectProperty!.Id).SubscribeAsync();
realm.Write(() => realm.Add(obj));
- var syncAllTypeObj = await WaitForConditionAsync(() => syncAllTypesCollection.FindOneAsync(new { _id = obj.Id }), item => Task.FromResult(item != null));
- var intPropertyObj = await WaitForConditionAsync(() => intPropertyCollection.FindOneAsync(new { _id = obj.ObjectProperty!.Id }), item => Task.FromResult(item != null));
+ var syncAllTypeObj = await WaitForNonNullObjectAsync(() => syncAllTypesCollection.FindOneAsync(new { _id = obj.Id }));
+ var intPropertyObj = await WaitForNonNullObjectAsync(() => intPropertyCollection.FindOneAsync(new { _id = obj.ObjectProperty!.Id }));
Assert.That(syncAllTypeObj.ObjectProperty!.Id, Is.EqualTo(obj.ObjectProperty!.Id));
Assert.That(syncAllTypeObj.ObjectProperty!.Int, Is.Not.EqualTo(obj.ObjectProperty!.Int));
@@ -444,7 +443,7 @@ public void RealmObjectAPI_Object_RealmToAtlas(TestCaseData
}, timeout: 120000);
}
- public static readonly object[] LinksTestCases = new[]
+ public static readonly object[] LinksTestCases =
{
new object[]
{
@@ -536,7 +535,7 @@ public void RealmObjectAPI_Links_AtlasToRealm(TestCaseData testCase
await collection.InsertManyAsync(elementsToInsert!);
// How many objects we expect
- var totalCount = obj.List.Count + obj.Set.Count + obj.Dictionary.Where(d => d.Value != null).Count() + 1 + (obj.Link is null ? 0 : 1);
+ var totalCount = obj.List.Count + obj.Set.Count + obj.Dictionary.Count(d => d.Value != null) + 1 + (obj.Link is null ? 0 : 1);
using var realm = await GetFLXIntegrationRealmAsync();
var linkObjs = await realm.All().SubscribeAsync();
@@ -582,8 +581,8 @@ static void AssertEqual(LinksObject? retrieved, LinksObject? original)
else
{
Assert.That(retrieved, Is.Not.Null);
- Assert.That(retrieved!.Id, Is.EqualTo(original!.Id));
- Assert.That(retrieved!.Value, Is.EqualTo(original!.Value));
+ Assert.That(retrieved!.Id, Is.EqualTo(original.Id));
+ Assert.That(retrieved.Value, Is.EqualTo(original.Value));
}
}
}, timeout: 120000);
@@ -606,7 +605,7 @@ public void RealmObjectAPI_Links_RealmToAtlas(TestCaseData testCase
realm.Write(() => realm.Add(obj));
await WaitForUploadAsync(realm);
- var linkObj = await WaitForConditionAsync(() => collection.FindOneAsync(new { _id = obj.Id }), item => Task.FromResult(item != null));
+ var linkObj = await WaitForNonNullObjectAsync(() => collection.FindOneAsync(new { _id = obj.Id }));
await AssertEqual(collection, linkObj.Link, obj.Link);
@@ -646,7 +645,7 @@ static async Task AssertEqual(MongoClient.Collection collection, Li
Assert.That(partiallyRetrieved!.Id, Is.EqualTo(original.Id));
Assert.That(partiallyRetrieved.Value, Is.Not.EqualTo(original.Value));
- var fullyRetrieved = await WaitForConditionAsync(() => collection.FindOneAsync(new { _id = original.Id }), item => Task.FromResult(item != null));
+ var fullyRetrieved = await WaitForNonNullObjectAsync(() => collection.FindOneAsync(new { _id = original.Id }));
Assert.That(fullyRetrieved.Id, Is.EqualTo(original.Id));
Assert.That(fullyRetrieved.Value, Is.EqualTo(original.Value));
@@ -654,7 +653,7 @@ static async Task AssertEqual(MongoClient.Collection collection, Li
}, timeout: 120000);
}
- public static readonly object[] RealmValueLinkTestCases = new[]
+ public static readonly object[] RealmValueLinkTestCases =
{
new object[]
{
@@ -734,18 +733,18 @@ public void RealmObjectAPI_RealmValueLinks_AtlasToRealm(TestCaseData o.As())
- .Concat(obj.RealmValueSet.Select(o => o.As())
- .Concat(obj.RealmValueDictionary.Values.Select(o => o.As()).Where(v => v is not null)));
+ .Concat(obj.RealmValueSet.Select(o => o.As())
+ .Concat(obj.RealmValueDictionary.Values.Select(o => o.As()).Where(v => v is not null)));
if (obj.RealmValueProperty != RealmValue.Null)
{
elementsToInsert = elementsToInsert.Concat(new[] { obj.RealmValueProperty.As() });
}
- await intCollection.InsertManyAsync(elementsToInsert!);
+ await intCollection.InsertManyAsync(elementsToInsert);
// How many objects we expect
- var totalCount = obj.RealmValueList.Count + obj.RealmValueSet.Count + obj.RealmValueDictionary.Where(d => d.Value != RealmValue.Null).Count();
+ var totalCount = obj.RealmValueList.Count + obj.RealmValueSet.Count + obj.RealmValueDictionary.Count(d => d.Value != RealmValue.Null);
using var realm = await GetFLXIntegrationRealmAsync();
var intObjs = await realm.All().SubscribeAsync();
@@ -820,7 +819,7 @@ public void RealmObjectAPI_RealmValueLinks_RealmToAtlas(TestCaseData realm.Add(obj));
await WaitForUploadAsync(realm);
- var realmValObj = await WaitForConditionAsync(() => realmValCollection.FindOneAsync(new { _id = obj.Id }), item => Task.FromResult(item != null));
+ var realmValObj = await WaitForNonNullObjectAsync(() => realmValCollection.FindOneAsync(new { _id = obj.Id }));
await AssertEqual(intCollection, realmValObj.RealmValueProperty, obj.RealmValueProperty);
@@ -864,7 +863,7 @@ static async Task AssertEqual(MongoClient.Collection collecti
Assert.That(retrievedAsObj.Id, Is.EqualTo(originalAsObj.Id));
Assert.That(retrievedAsObj.Int, Is.Not.EqualTo(originalAsObj.Int));
- var fullyRetrieved = await WaitForConditionAsync(() => collection.FindOneAsync(new { _id = originalAsObj.Id }), item => Task.FromResult(item != null));
+ var fullyRetrieved = await WaitForNonNullObjectAsync(() => collection.FindOneAsync(new { _id = originalAsObj.Id }));
Assert.That(fullyRetrieved.Id, Is.EqualTo(originalAsObj.Id));
Assert.That(fullyRetrieved.Int, Is.EqualTo(originalAsObj.Int));
@@ -1059,7 +1058,7 @@ public void RealmObjectAPI_Embedded_RealmToAtlas(TestCaseData realm.Add(obj));
await WaitForUploadAsync(realm);
- var syncObj = await WaitForConditionAsync(() => collection.FindOneAsync(new { _id = obj.PrimaryKey }), item => Task.FromResult(item != null));
+ var syncObj = await WaitForNonNullObjectAsync(() => collection.FindOneAsync(new { _id = obj.PrimaryKey }));
AssertEmbedded(syncObj, obj);
}, timeout: 120000);
@@ -1132,7 +1131,7 @@ public void RealmObjectAPI_ExtraFields_IgnoredWhenUsingTypedCollection()
var retrieved = await typedCollection.FindOneAsync(new { _id = primaryKey });
Assert.That(retrieved, Is.Not.Null);
- Assert.That(retrieved.Value, Is.EqualTo(doc["Value"].AsString));
+ Assert.That(retrieved!.Value, Is.EqualTo(doc["Value"].AsString));
}, timeout: 120000);
}
@@ -1151,7 +1150,7 @@ public void RealmObjectAPI_MismatchedType_ThrowsOnInsertWhenCollectionInSchema()
{ "Value", ObjectId.GenerateNewId() }, // Wrong type
};
- var ex = await TestHelpers.AssertThrows(() => collection.InsertOneAsync(doc));
+ var ex = await AssertThrows(() => collection.InsertOneAsync(doc));
Assert.That(ex.Message, Does.Contain("insert not permitted"));
}, timeout: 120000);
}
@@ -1206,7 +1205,7 @@ public void RealmObjectAPI_MissingField_ThrowsOnInsertWhenCollectionInSchema()
{ "Int", 23 }, // Missing the GuidProperty field
};
- var ex = await TestHelpers.AssertThrows(() => collection.InsertOneAsync(doc));
+ var ex = await AssertThrows(() => collection.InsertOneAsync(doc));
Assert.That(ex.Message, Does.Contain("insert not permitted"));
}, timeout: 120000);
}
@@ -1242,7 +1241,8 @@ public void RealmObjectAPI_MissingField_GetsDefaultValueWhenDeserialized()
var typedCollection = db.GetCollection(collectionName);
var retrieved = await typedCollection.FindOneAsync(new { _id = primaryKey });
- Assert.That(retrieved.Id, Is.EqualTo(primaryKey));
+ Assert.That(retrieved, Is.Not.Null);
+ Assert.That(retrieved!.Id, Is.EqualTo(primaryKey));
Assert.That(retrieved.Int, Is.EqualTo(doc["Int"].AsInt32));
Assert.That(retrieved.GuidProperty, Is.EqualTo(default(Guid)));
}, timeout: 120000);
diff --git a/Tests/Realm.Tests/Sync/SyncTestHelpers.cs b/Tests/Realm.Tests/Sync/SyncTestHelpers.cs
index 54d4c81c42..27e473e21d 100644
--- a/Tests/Realm.Tests/Sync/SyncTestHelpers.cs
+++ b/Tests/Realm.Tests/Sync/SyncTestHelpers.cs
@@ -34,6 +34,8 @@ public static class SyncTestHelpers
public const string DefaultPassword = "123456";
private const string DummyAppId = "myapp-123";
+ private static readonly string? _baaSaasApiKey;
+
private static IDictionary _apps = new Dictionary
{
[AppConfigType.Default] = new(string.Empty, DummyAppId, AppConfigType.Default),
@@ -41,7 +43,6 @@ public static class SyncTestHelpers
public static Uri? BaasUri;
private static BaasClient? _baasClient;
- private static string? _baaSaasApiKey;
static SyncTestHelpers()
{
diff --git a/Tests/Realm.Tests/TestHelpers.cs b/Tests/Realm.Tests/TestHelpers.cs
index aa1d5f7f65..f7ed5966de 100644
--- a/Tests/Realm.Tests/TestHelpers.cs
+++ b/Tests/Realm.Tests/TestHelpers.cs
@@ -286,6 +286,13 @@ public static async Task WaitForConditionAsync(Func> producer, Fun
return value;
}
+ public static async Task WaitForNonNullObjectAsync(Func> producer)
+ {
+ var value = await WaitForConditionAsync(producer, v => Task.FromResult(v != null));
+ Assert.That(value, Is.Not.Null);
+ return value!;
+ }
+
public static void RunAsyncTest(Func testFunc, int timeout = 30000, Task? errorTask = null)
{
AsyncContext.Run(async () =>
diff --git a/Tests/Tests.Maui/MainPage.xaml.cs b/Tests/Tests.Maui/MainPage.xaml.cs
index 5776457dd2..4951620b43 100644
--- a/Tests/Tests.Maui/MainPage.xaml.cs
+++ b/Tests/Tests.Maui/MainPage.xaml.cs
@@ -93,15 +93,7 @@ private async Task RunTests()
}
});
});
- var failed = autorun.Execute(arguments.Where(a => a != "--headless").ToArray(), writer, reader);
-
- var resultPath = TestHelpers.GetResultsPath(MauiProgram.Args);
- if (!string.IsNullOrEmpty(resultPath))
- {
- TestHelpers.TransformTestResults(resultPath);
- }
-
- return failed;
+ return autorun.Execute(arguments.Where(a => a != "--headless").ToArray(), writer, reader);
});
ResultsLabel.Text = $"Test run complete. Failed: {result}";
diff --git a/Tests/Tests.Maui/Tests.Maui.csproj b/Tests/Tests.Maui/Tests.Maui.csproj
index 13047ffd2b..43aa5e08dc 100644
--- a/Tests/Tests.Maui/Tests.Maui.csproj
+++ b/Tests/Tests.Maui/Tests.Maui.csproj
@@ -1,7 +1,7 @@
- net6.0-android;net6.0-ios;net6.0-maccatalyst
+ net8.0-android;net8.0-ios;net8.0-maccatalyst
$(TargetFrameworks);net6.0-windows10.0.19041
Exe
Tests.Maui
diff --git a/global.json b/global.json
deleted file mode 100644
index 1c7274b725..0000000000
--- a/global.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "sdk": {
- "version": "7.0.100",
- "rollForward": "latestFeature"
- }
-}
\ No newline at end of file