Permalink
Browse files

WebDAV tests are reintroduced in a seperate scheme

travis is directed to initial scheme
  • Loading branch information...
mgmart committed May 3, 2017
1 parent 033eff6 commit 83b74dfbdf2ba657ac0017eb9d5ed5a2fe4994ea
View
@@ -20,7 +20,7 @@ language: objective-c
osx_image: xcode8.3
# xcode_project: MobileOrg.xcodeproj
# xcode_scheme: MobileOrg
xcode_scheme: MobileOrg
script:
xcodebuild test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -workspace MobileOrg.xcworkspace -scheme MobileOrg -destination 'platform=iOS Simulator,name=iPhone 6,OS=9.3'|xcpretty
@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "MobileOrg.app"
BlueprintName = "MobileOrg"
ReferencedContainer = "container:MobileOrg.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Start WebDAV Server"
scriptText = "# exec &gt; ~/prebuild.log 2&gt;&amp;1&#10;testfolder=${SRCROOT}/MobileOrgTests/Resources/WebDavTests&#10;if $(docker inspect phylor/webdav-ssl &gt;/dev/null 2&gt;&amp;1); then&#10;echo &quot;Image does exist&quot;;&#10;else&#10;echo &quot;Image does not exist&quot;&#10;docker pull phylor/webdav-ssl&#10;fi&#10;&#10;docker run -d --name mobileOrg-webDAV -v $testfolder/htpasswd:/htpasswd -v $testfolder/certs:/certs -v $testfolder/content:/var/www -h mobileOrgWebDav.schnuddelhuddel.de -p 32773:443 phylor/webdav-ssl&#10;"
shellToInvoke = "/bin/sh">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "747BF9961DFD719400E800FB"
BuildableName = "MobileOrgTests.xctest"
BlueprintName = "MobileOrgTests"
ReferencedContainer = "container:MobileOrg.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<PostActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Stop WebDAV Server"
scriptText = "docker stop mobileOrg-webDAV&#10;docker rm mobileOrg-webDAV&#10;"
shellToInvoke = "/bin/sh">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "747BF9961DFD719400E800FB"
BuildableName = "MobileOrgTests.xctest"
BlueprintName = "MobileOrgTests"
ReferencedContainer = "container:MobileOrg.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PostActions>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "747BF9961DFD719400E800FB"
BuildableName = "MobileOrgTests.xctest"
BlueprintName = "MobileOrgTests"
ReferencedContainer = "container:MobileOrg.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "MobileOrg.app"
BlueprintName = "MobileOrg"
ReferencedContainer = "container:MobileOrg.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "MobileOrg.app"
BlueprintName = "MobileOrg"
ReferencedContainer = "container:MobileOrg.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "disable"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Debug"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "MobileOrg.app"
BlueprintName = "MobileOrg"
ReferencedContainer = "container:MobileOrg.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "AppStore"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -37,6 +37,11 @@
BlueprintName = "MobileOrgTests"
ReferencedContainer = "container:MobileOrg.xcodeproj">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "WebDavTests">
</Test>
</SkippedTests>
</TestableReference>
</Testables>
<MacroExpansion>
@@ -35,24 +35,24 @@ class WebDavTests: XCTestCase {
super.tearDown()
}
// func testWebDAVSync() {
//
// SyncManager.instance().sync()
//
// // Sync is async, so we have to wait for completion
// sleep(4)
//
// do {
// let fetchRequest = NSFetchRequest<Node>(entityName: "Node")
// // fetchRequest.predicate = NSPredicate (format: "heading == %@", "on Level 1.1.1.5")
//
// let nodes = try self.moc!.fetch(fetchRequest)
//
// XCTAssertEqual(nodes.count, 136)
//
// } catch _ { XCTFail() }
//
// }
func testWebDAVSync() {
SyncManager.instance().sync()
// Sync is async, so we have to wait for completion
sleep(4)
do {
let fetchRequest = NSFetchRequest<Node>(entityName: "Node")
// fetchRequest.predicate = NSPredicate (format: "heading == %@", "on Level 1.1.1.5")
let nodes = try self.moc!.fetch(fetchRequest)
XCTAssertEqual(nodes.count, 136)
} catch _ { XCTFail() }
}
func setUpInMemoryManagedObjectContext() -> NSManagedObjectContext {
let managedObjectModel = NSManagedObjectModel.mergedModel(from: [Bundle.main])!
@@ -0,0 +1,13 @@
#!/bin/sh
# exec > ~/prebuild.log 2>&1
testfolder=${SRCROOT}/MobileOrgTests/Resources/WebDavTests
if $(docker inspect phylor/webdav-ssl >/dev/null 2>&1); then
echo "Image does exist";
else
echo "Image does not exist"
docker pull phylor/webdav-ssl
fi
docker run -d --name mobileOrg-webDAV -v $testfolder/htpasswd:/htpasswd -v $testfolder/certs:/certs -v $testfolder/content:/var/www -h mobileOrgWebDav.schnuddelhuddel.de -p 32773:443 phylor/webdav-ssl
@@ -0,0 +1,4 @@
#!/bin/sh
docker stop mobileOrg-webDAV
docker rm mobileOrg-webDAV

0 comments on commit 83b74df

Please sign in to comment.