Skip to content

Commit

Permalink
Sync for Windows (#1577)
Browse files Browse the repository at this point in the history
* wip

* always look for uwp paths first

* gate sync

* bump sync version

* Jenkinsfile

* fix libuv linking

* fix cmake

* fix sync nuspec

* Don’t set REALM_PLATFORM DotNet

* Try to force the generic event looper

* Force generic event looper take #2

* Update dependencies

* replace download with download_and_extract

* Update to 2.0.1 and add sshagent

* Add nuget packages to Win32 tests

* Update to windows-friendly OS file handling;
Set Realm_PLATFORM to avoid linking libuv

* Make sure to create folders

* Try to reduce folder length on windows

* Fix leftover

* Fix merge issues

* Final touches...

* Unstash win32 binaries on CI

* Try to fix Win32 tests

* Update OS

* Update OS

* Update nunit console to latest
  • Loading branch information
fealebenpae authored and nirinchev committed Oct 16, 2017
1 parent f257663 commit 9be3baa
Show file tree
Hide file tree
Showing 21 changed files with 410 additions and 70 deletions.
13 changes: 7 additions & 6 deletions .nuget/packages.config
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit.ConsoleRunner" version="3.2.1" />
<package id="NUnit.Extension.NUnitProjectLoader" version="3.2.1" />
<package id="NUnit.Extension.NUnitV2Driver" version="3.2.1" />
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.2.1" />
<package id="NUnit.Extension.VSProjectLoader" version="3.2.1" />
<package id="NUnit.Runners" version="3.2.1" />
<package id="NUnit.ConsoleRunner" version="3.7.0" />
<package id="NUnit.Extension.NUnitProjectLoader" version="3.6.0" />
<package id="NUnit.Extension.NUnitV2Driver" version="3.6.0" />
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.5.0" />
<package id="NUnit.Extension.VSProjectLoader" version="3.5.0" />
<package id="NUnit.Runners" version="3.7.0" />
<package id="NUnit.Extension.TeamCityEventListener " version="1.0.2" />
</packages>
85 changes: 73 additions & 12 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ stage('Weavers') {

dir('Weaver/WeaverTests/RealmWeaver.Tests') {
msbuild target: 'Restore,Build', properties: [ Configuration: configuration, SolutionDir: "${env.WORKSPACE}/" ]
sh "${mono} \"${env.WORKSPACE}\"/packages/NUnit.ConsoleRunner.*/tools/nunit3-console.exe RealmWeaver.Tests.csproj --result=TestResult.xml\\;format=nunit2 --config=${configuration} --inprocess"
sh "${mono} \"${env.WORKSPACE}\"/packages/NUnit.ConsoleRunner.3.7.0/tools/nunit3-console.exe RealmWeaver.Tests.csproj --result=TestResult.xml\\;format=nunit2 --config=${configuration} --inprocess"
publishTests 'TestResult.xml'
}
stash includes: "Weaver/RealmWeaver.Fody/bin/${configuration}/RealmWeaver.Fody.dll", name: 'nuget-weaver'
Expand Down Expand Up @@ -138,14 +138,15 @@ stage('Build without sync') {
unstash 'tools-weaver'

dir('wrappers') {
cmake 'build-win32', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'Win32' ]
cmake 'build-x64', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'x64' ]
Map cmakeArgs = [ 'CMAKE_TOOLCHAIN_FILE': 'c:\\src\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake' ]
cmake 'build-win32', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'Win32', 'VCPKG_TARGET_TRIPLET': 'x86-windows-static' ] << cmakeArgs
cmake 'build-x64', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'x64', 'VCPKG_TARGET_TRIPLET': 'x64-windows-static' ] << cmakeArgs
}

archive 'wrappers/build/**/*.pdb'

msbuild project: 'Tests/Tests.Win32/Tests.Win32.csproj', target: 'Restore,Build',
properties: [ Configuration: configuration, SolutionDir: "${env.WORKSPACE}/" ]
properties: [ Configuration: configuration, SolutionDir: "${env.WORKSPACE}/", RealmNoSync: true ]

stash includes: 'wrappers/build/**/*.dll', name: 'win32-wrappers-nosync'
stash includes: "Tests/Tests.Win32/bin/${configuration}/**", name: 'win32-tests-nosync'
Expand All @@ -156,9 +157,13 @@ stage('Build without sync') {
unstash 'dotnet-wrappers-source'

dir('wrappers') {
cmake 'build-win32', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'Win32', 'CMAKE_SYSTEM_NAME': 'WindowsStore', 'CMAKE_SYSTEM_VERSION': '10.0' ]
cmake 'build-x64', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'x64', 'CMAKE_SYSTEM_NAME': 'WindowsStore', 'CMAKE_SYSTEM_VERSION': '10.0' ]
cmake 'build-arm', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'ARM', 'CMAKE_SYSTEM_NAME': 'WindowsStore', 'CMAKE_SYSTEM_VERSION': '10.0' ]
Map cmakeArgs = [
'CMAKE_SYSTEM_NAME': 'WindowsStore', 'CMAKE_SYSTEM_VERSION': '10.0',
'CMAKE_TOOLCHAIN_FILE': 'c:\\src\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake'
]
cmake 'build-win32', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'Win32', 'VCPKG_TARGET_TRIPLET': 'x86-uwp-static' ] << cmakeArgs
cmake 'build-x64', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'x64', 'VCPKG_TARGET_TRIPLET': 'x64-uwp-static' ] << cmakeArgs
cmake 'build-arm', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'ARM', 'VCPKG_TARGET_TRIPLET': 'arm-uwp-static' ] << cmakeArgs
}

archive 'wrappers/build/**/*.pdb'
Expand Down Expand Up @@ -312,6 +317,50 @@ stage('Build with sync') {
}
}
},
'Win32': {
nodeWithCleanup('windows') {
unstash 'dotnet-source'
unstash 'dotnet-wrappers-source'
unstash 'tools-weaver'

dir('wrappers') {
sshagent(['realm-ci-ssh']) {
Map cmakeArgs = [ 'REALM_ENABLE_SYNC': 'ON', 'CMAKE_TOOLCHAIN_FILE': 'c:\\src\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake' ]
cmake 'build-win32', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'Win32', 'VCPKG_TARGET_TRIPLET': 'x86-windows-static' ] << cmakeArgs
cmake 'build-x64', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'x64', 'VCPKG_TARGET_TRIPLET': 'x64-windows-static' ] << cmakeArgs
}
}

archive 'wrappers/build/**/*.pdb'

msbuild project: 'Tests/Tests.Win32/Tests.Win32.csproj', target: 'Restore,Build',
properties: [ Configuration: configuration, SolutionDir: "${env.WORKSPACE}/" ]

stash includes: 'wrappers/build/**/*.dll', name: 'win32-wrappers-sync'
stash includes: "Tests/Tests.Win32/bin/${configuration}/**", name: 'win32-tests-sync'
}
},
'UWP': {
nodeWithCleanup('windows') {
unstash 'dotnet-wrappers-source'

dir('wrappers') {
sshagent(['realm-ci-ssh']) {
Map cmakeArgs = [
'CMAKE_SYSTEM_NAME': 'WindowsStore', 'CMAKE_SYSTEM_VERSION': '10.0',
'REALM_ENABLE_SYNC': 'ON',
'CMAKE_TOOLCHAIN_FILE': 'c:\\src\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake'
]
cmake 'build-win32', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'Win32', 'VCPKG_TARGET_TRIPLET': 'x86-uwp-static' ] << cmakeArgs
cmake 'build-x64', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'x64', 'VCPKG_TARGET_TRIPLET': 'x64-uwp-static' ] << cmakeArgs
cmake 'build-arm', "${pwd()}\\build", configuration, [ 'CMAKE_GENERATOR_PLATFORM': 'ARM', 'VCPKG_TARGET_TRIPLET': 'arm-uwp-static' ] << cmakeArgs
}
}

archive 'wrappers/build/**/*.pdb'
stash includes: 'wrappers/build/**/*.dll', name: 'uwp-wrappers-sync'
}
},
'macOS': {
nodeWithCleanup('osx') {
unstash 'dotnet-wrappers-source'
Expand Down Expand Up @@ -374,6 +423,7 @@ stage ('Build .NET Core') {
unstash 'dotnet-source'
unstash 'macos-wrappers-sync'
unstash 'linux-wrappers-sync'
unstash 'win32-wrappers-sync'
unstash 'tools-weaver'

archiveNetCore('sync')
Expand All @@ -385,22 +435,31 @@ stage ('Build .NET Core') {

msbuild project: 'Tests/Tests.NetCore/Tests.NetCore.csproj', target: 'Publish',
properties: properties + [ RuntimeIdentifier: 'osx.10.10-x64', OutputPath: "bin/${configuration}/macos" ]

stash includes: "Tests/Tests.NetCore/bin/${configuration}/macospublish/**", name: 'netcore-macos-tests-sync'

msbuild project: 'Tests/Tests.NetCore/Tests.NetCore.csproj', target: 'Publish',
properties: properties + [ RuntimeIdentifier: 'debian.8-x64', OutputPath: "bin/${configuration}/linux" ]

stash includes: "Tests/Tests.NetCore/bin/${configuration}/linuxpublish/**", name: 'netcore-linux-tests-sync'

msbuild project: 'Tests/Tests.NetCore/Tests.NetCore.csproj', target: 'Publish',
properties: properties + [ RuntimeIdentifier: 'win81-x64', OutputPath: "bin/${configuration}/win32" ]

stash includes: "Tests/Tests.NetCore/bin/${configuration}/win32publish/**", name: 'netcore-win32-tests-sync'
}
}

stage('Test with sync') {
parallel(
'iOS': iOSTest('ios-tests-sync'),
'Android': AndroidTest('android-tests-sync'),
// For some reason, tests lock on CI
// TODO: investigate and reenable
// 'Win32': Win32Test('win32-tests-sync'),
'Linux': NetCoreTest('docker', 'linux', 'sync'),
'macOS': NetCoreTest('osx || macos', 'macos', 'sync'),
'Win32-NetCore': NetCoreTest('windows', 'win32', 'sync'),
'XamarinMac': XamarinMacTest('xamarinmac-tests-sync')
)
}
Expand Down Expand Up @@ -440,14 +499,14 @@ def Win32Test(stashName) {
unstash 'dotnet-source'
unstash stashName

def nunit = "${env.WORKSPACE}\\packages\\NUnit.ConsoleRunner.3.2.1\\tools\\nunit3-console.exe"
def nunit = "${env.WORKSPACE}\\packages\\NUnit.ConsoleRunner.3.7.0\\tools\\nunit3-console.exe"
dir("Tests/Tests.Win32/bin/${configuration}") {
try {
withEnv(["TMP=${env.WORKSPACE}\\temp"]) {
bat """
mkdir "%TMP%"
"${nunit}" Tests.Win32.dll --result=${stashName}-x86.xml;transform=nunit3-junit.xslt --x86
"${nunit}" Tests.Win32.dll --result=${stashName}-x64.xml;transform=nunit3-junit.xslt
"${nunit}" Tests.Win32.dll --result=${stashName}-x86.xml;transform=nunit3-junit.xslt --x86 --labels=After
"${nunit}" Tests.Win32.dll --result=${stashName}-x64.xml;transform=nunit3-junit.xslt --labels=After
"""
}
} finally {
Expand Down Expand Up @@ -652,6 +711,8 @@ stage('NuGet') {
unstash 'android-wrappers-sync'
unstash 'macos-wrappers-sync'
unstash 'linux-wrappers-sync'
unstash 'win32-wrappers-sync'
unstash 'uwp-wrappers-sync'

dir('NuGet/Realm') {
nugetPack('Realm', versionString)
Expand Down
10 changes: 5 additions & 5 deletions NuGet/Realm.Database/Realm.Database.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@
<file src="../../wrappers/build/Android/$Configuration$-x86/librealm-wrappers.so" target="native/android/x86" />
<file src="../../wrappers/build/Android/$Configuration$-x86_64/librealm-wrappers.so" target="native/android/x86_64" />
<!-- Win32 files -->
<file src="../../wrappers/build/Windows/$Configuration$-Win32/realm-wrappers.dll" target="runtimes/win81-x86/native" />
<file src="../../wrappers/build/Windows/$Configuration$-x64/realm-wrappers.dll" target="runtimes/win81-x64/native" />
<file src="../../wrappers/build/Windows/$Configuration$-Win32/*.dll" target="runtimes/win81-x86/native" />
<file src="../../wrappers/build/Windows/$Configuration$-x64/*.dll" target="runtimes/win81-x64/native" />
<!-- UWP files -->
<file src="../../wrappers/build/WindowsStore/$Configuration$-Win32/realm-wrappers.dll" target="runtimes/win10-x86/nativeassets/uap10.0" />
<file src="../../wrappers/build/WindowsStore/$Configuration$-x64/realm-wrappers.dll" target="runtimes/win10-x64/nativeassets/uap10.0" />
<file src="../../wrappers/build/WindowsStore/$Configuration$-ARM/realm-wrappers.dll" target="runtimes/win10-arm/nativeassets/uap10.0" />
<file src="../../wrappers/build/WindowsStore/$Configuration$-Win32/*.dll" target="runtimes/win10-x86/nativeassets/uap10.0" />
<file src="../../wrappers/build/WindowsStore/$Configuration$-x64/*.dll" target="runtimes/win10-x64/nativeassets/uap10.0" />
<file src="../../wrappers/build/WindowsStore/$Configuration$-ARM/*.dll" target="runtimes/win10-arm/nativeassets/uap10.0" />
<!-- .NET Core files -->
<file src="../../wrappers/build/Darwin/$Configuration$/librealm-wrappers.dylib" target="runtimes/osx.10.10-x64/native" />
<file src="../../wrappers/build/Linux/$Configuration$/librealm-wrappers.so" target="runtimes/linux-x64/native" />
Expand Down
7 changes: 7 additions & 0 deletions NuGet/Realm/Realm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
<file src="../../wrappers/build/Android/$Configuration$-arm64-v8a/librealm-wrappers.so" target="native/android/arm64-v8a" />
<file src="../../wrappers/build/Android/$Configuration$-x86/librealm-wrappers.so" target="native/android/x86" />
<file src="../../wrappers/build/Android/$Configuration$-x86_64/librealm-wrappers.so" target="native/android/x86_64" />
<!-- Win32 files -->
<file src="../../wrappers/build/Windows/$Configuration$-Win32/*.dll" target="runtimes/win81-x86/native" />
<file src="../../wrappers/build/Windows/$Configuration$-x64/*.dll" target="runtimes/win81-x64/native" />
<!-- UWP files -->
<file src="../../wrappers/build/WindowsStore/$Configuration$-Win32/*.dll" target="runtimes/win10-x86/nativeassets/uap10.0" />
<file src="../../wrappers/build/WindowsStore/$Configuration$-x64/*.dll" target="runtimes/win10-x64/nativeassets/uap10.0" />
<file src="../../wrappers/build/WindowsStore/$Configuration$-ARM/*.dll" target="runtimes/win10-arm/nativeassets/uap10.0" />
<!-- .NET Core files -->
<file src="../../wrappers/build/Darwin/$Configuration$/librealm-wrappers.dylib" target="runtimes/osx.10.10-x64/native" />
<file src="../../wrappers/build/Linux/$Configuration$/librealm-wrappers.so" target="runtimes/linux-x64/native" />
Expand Down
2 changes: 2 additions & 0 deletions Realm.sln
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Global
Tests\Tests.Shared\Tests.Shared.projitems*{06146619-d21c-414c-bfe3-2f59acba412e}*SharedItemsImports = 13
DataBinding\Realm.DataBinding.TypeDelegator\DataBinding.TypeDelegator.projitems*{0a266cac-ef4a-4bb0-a3d9-f2084f1b1012}*SharedItemsImports = 4
Tests\Tests.Shared\Tests.Shared.projitems*{159a55af-9531-4107-8444-ca9c96107ef5}*SharedItemsImports = 4
Tests\Tests.Sync.Shared\Tests.Sync.Shared.projitems*{159a55af-9531-4107-8444-ca9c96107ef5}*SharedItemsImports = 4
DataBinding\Realm.DataBinding.TypeDelegator\DataBinding.TypeDelegator.projitems*{336ed3ca-5344-4f04-966c-ca170afc3348}*SharedItemsImports = 4
Tests\Tests.Shared\Tests.Shared.projitems*{3a6cc342-40d0-4487-9964-ddaeba628199}*SharedItemsImports = 4
Tests\Tests.Sync.Shared\Tests.Sync.Shared.projitems*{3a6cc342-40d0-4487-9964-ddaeba628199}*SharedItemsImports = 4
Expand All @@ -83,6 +84,7 @@ Global
Tests\Tests.Sync.Shared\Tests.Sync.Shared.projitems*{ad7b78b0-ae51-4fb7-9b11-4e22a2b538ca}*SharedItemsImports = 4
DataBinding\Realm.DataBinding.TypeDelegator\DataBinding.TypeDelegator.projitems*{af2979c9-8cc6-4d0e-ba15-10d616ec35c3}*SharedItemsImports = 4
Tests\Tests.Shared\Tests.Shared.projitems*{bfc1c1b7-2864-4456-9dec-309a3f006b66}*SharedItemsImports = 4
Tests\Tests.Sync.Shared\Tests.Sync.Shared.projitems*{bfc1c1b7-2864-4456-9dec-309a3f006b66}*SharedItemsImports = 4
Tests\Tests.Sync.Shared\Tests.Sync.Shared.projitems*{c81983e0-58a0-4d67-b0d0-ae91aba71a2c}*SharedItemsImports = 13
Tests\Tests.Shared\Tests.Shared.projitems*{d2ced8f0-7a76-454d-b5f7-9e8b9fe6a58e}*SharedItemsImports = 4
Tests\Tests.Sync.Shared\Tests.Sync.Shared.projitems*{d2ced8f0-7a76-454d-b5f7-9e8b9fe6a58e}*SharedItemsImports = 4
Expand Down
7 changes: 5 additions & 2 deletions Realm/Realm.Sync/Handles/SharedRealmHandleExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,18 @@ public static void DoInitialFileSystemConfiguration()
}
}

public static unsafe void ConfigureFileSystem(UserPersistenceMode? userPersistenceMode, byte[] encryptionKey, bool resetMetadataOnError)
public static unsafe void ConfigureFileSystem(UserPersistenceMode? userPersistenceMode, byte[] encryptionKey, bool resetMetadataOnError, string basePath = null)
{
// mark the file system as configured in case this is called directly
// so that it isn't reconfigured with default values in DoInitialFileSystemConfiguration
Interlocked.Exchange(ref _fileSystemConfigured, 1);

RealmException.AddOverrider(RealmExceptionCodes.RealmIncompatibleSyncedFile, (message, path) => new IncompatibleSyncedFileException(message, path));

var basePath = InteropConfig.DefaultStorageFolder;
if (basePath == null)
{
basePath = InteropConfig.DefaultStorageFolder;
}

UserPersistenceMode mode;
UserPersistenceMode* modePtr = null;
Expand Down
2 changes: 1 addition & 1 deletion Realm/Realm.Sync/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
[assembly: InternalsVisibleTo("Tests.Android")]
[assembly: InternalsVisibleTo("Tests.UWP")]
[assembly: InternalsVisibleTo("Tests.NetCore")]
[assembly: InternalsVisibleTo("Tests.XamarinMac")]
[assembly: InternalsVisibleTo("Tests.XamarinMac")]
34 changes: 17 additions & 17 deletions Realm/Realm/InteropConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,6 @@ internal static class InteropConfig
{
private static readonly Lazy<string> _defaultStorageFolder = new Lazy<string>(() =>
{
try
{
var specialFolderType = typeof(Environment).GetNestedType("SpecialFolder", BindingFlags.Public);
if (specialFolderType != null)
{
var getFolderPath = typeof(Environment).GetMethod("GetFolderPath", new[] { specialFolderType });
if (getFolderPath != null)
{
var personalField = specialFolderType.GetField("Personal");
return (string)getFolderPath.Invoke(null, new[] { personalField.GetValue(null) });
}
}
}
catch
{
}

try
{
// On UWP, the sandbox folder is obtained by:
Expand All @@ -63,6 +46,23 @@ internal static class InteropConfig
{
}

try
{
var specialFolderType = typeof(Environment).GetNestedType("SpecialFolder", BindingFlags.Public);
if (specialFolderType != null)
{
var getFolderPath = typeof(Environment).GetMethod("GetFolderPath", new[] { specialFolderType });
if (getFolderPath != null)
{
var personalField = specialFolderType.GetField("Personal");
return (string)getFolderPath.Invoke(null, new[] { personalField.GetValue(null) });
}
}
}
catch
{
}

var currentDirectory = Directory.GetCurrentDirectory();
if (!IsDirectoryWritable(currentDirectory))
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Tests.Sync.Shared/SessionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void Session_DivergingHistories_ShouldRaiseClientResetException()

var error = result.Item2;
Assert.That(error.BackupFilePath, Is.Not.Null);
Assert.That(error.BackupFilePath, Does.Contain("io.realm.object-server-recovered-realms/recovered_realm"));
Assert.That(error.BackupFilePath, Does.Contain(Path.Combine("io.realm.object-server-recovered-realms", "recovered_realm")));
Assert.That(File.Exists(error.BackupFilePath), Is.False);

var clientResetSuccess = error.InitiateClientReset();
Expand Down
21 changes: 20 additions & 1 deletion Tests/Tests.Sync.Shared/SyncTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
//
////////////////////////////////////////////////////////////////////////////

using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Realms;
using Realms.Sync;
Expand All @@ -41,7 +43,24 @@ protected override void CustomSetUp()
SyncConfiguration.SetFeatureToken(SyncTestHelpers.ProfessionalFeatureToken);
}

SharedRealmHandleExtensions.ConfigureFileSystem(persistence, null, false);
var defaultFolder = InteropConfig.DefaultStorageFolder;
if (TestHelpers.IsWindows)
{
// We do this to reduce the length of the folders in Windows
var testsIndex = defaultFolder.IndexOf("\\Tests\\");
var docsIndex = defaultFolder.IndexOf("\\Documents") + 1;

if (testsIndex > -1 && docsIndex > testsIndex)
{
defaultFolder = Path.Combine(defaultFolder.Substring(0, testsIndex), defaultFolder.Substring(docsIndex))
.Replace("\\Documents", "\\D");

Console.WriteLine($"Creating {defaultFolder}...");
Directory.CreateDirectory(defaultFolder);
}
}

SharedRealmHandleExtensions.ConfigureFileSystem(persistence, null, false, defaultFolder);
}

protected override void CustomTearDown()
Expand Down
Loading

0 comments on commit 9be3baa

Please sign in to comment.