diff --git a/.gitignore b/.gitignore index a47d5f7..61648e2 100644 --- a/.gitignore +++ b/.gitignore @@ -61,7 +61,7 @@ Pods/ # Carthage # # Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts +Carthage/Checkouts # project files should be checked into the repository, unless a significant # proportion of contributors will probably not be using SublimeText diff --git a/Cartfile b/Cartfile new file mode 100644 index 0000000..e65b46c --- /dev/null +++ b/Cartfile @@ -0,0 +1 @@ +github "czechboy0/DVR" "2742bb80be229da51b1c923c3d3e6eaadc129b8e" diff --git a/Cartfile.resolved b/Cartfile.resolved new file mode 100644 index 0000000..e65b46c --- /dev/null +++ b/Cartfile.resolved @@ -0,0 +1 @@ +github "czechboy0/DVR" "2742bb80be229da51b1c923c3d3e6eaadc129b8e" diff --git a/README.md b/README.md index 4aff730..32660fd 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,9 @@ We're providing a Plaground in which you can easily interact with `XcodeServerSD | _List devices connected to server_ | :white_check_mark: | :white_check_mark: | | _List hosted repositories on server_ | :white_check_mark: | :no_entry: | | _Create a new hosted repository_ | :white_check_mark: | :no_entry: | +| Get supported platforms | :no_entry: | :white_check_mark: | +| Get SCM branches from Blueprint | :no_entry: | :white_check_mark: | +| Verify user can manage server | :no_entry: | :white_check_mark: | Opertions listed in table above in _italics_ are those provided by  in Xcode. Rest of operations are just a product of reverse engineering. @@ -110,6 +113,9 @@ Using hardware buttons to start integrations? Why not! The sky is the limit. # License [MIT](https://github.com/czechboy0/XcodeServerSDK/blob/master/LICENSE) +# Building & Testing +We use [Carthage](https://github.com/Carthage/Carthage) to pull in some dependencies for tests. If you clone this repo and want to run tests, first you have to run `carthage update --no-build` to download the necessary dependencies. + # Contributing Create an issue or (preferably) send a pull request. diff --git a/XcodeServerSDK.xcodeproj/project.pbxproj b/XcodeServerSDK.xcodeproj/project.pbxproj index cee08ac..285858c 100644 --- a/XcodeServerSDK.xcodeproj/project.pbxproj +++ b/XcodeServerSDK.xcodeproj/project.pbxproj @@ -55,26 +55,22 @@ 11FB71B81B34B00000D57A52 /* XcodeServerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A7B48CC1B2A5AC40077ABEA /* XcodeServerTests.swift */; }; 11FB71B91B34B00000D57A52 /* BotParsingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A058A8D1B31595A0077FD47 /* BotParsingTests.swift */; }; 11FB71BA1B34B00000D57A52 /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A058A921B315BB50077FD47 /* TestUtils.swift */; }; - 11FB71BB1B34B01000D57A52 /* bot_ios_xcode7.json in Resources */ = {isa = PBXBuildFile; fileRef = 3AC786741B33626000BBA482 /* bot_ios_xcode7.json */; }; - 11FB71BC1B34B01000D57A52 /* bot_mac_xcode7.json in Resources */ = {isa = PBXBuildFile; fileRef = 3AC786751B33626000BBA482 /* bot_mac_xcode7.json */; }; - 11FB71BD1B34B01000D57A52 /* bot_mac_xcode6_schedule_manual_no_actions_clean_never_all_triggers.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A236F671B335E170042A9B1 /* bot_mac_xcode6_schedule_manual_no_actions_clean_never_all_triggers.json */; }; - 11FB71BE1B34B01000D57A52 /* bot_mac_xcode6_schedule_oncommit_all_actions_clean_onceaweek.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A236F681B335E170042A9B1 /* bot_mac_xcode6_schedule_oncommit_all_actions_clean_onceaweek.json */; }; - 11FB71BF1B34B01000D57A52 /* bot_mac_xcode6_schedule_periodical_daily941_clean_always.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A236F691B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_daily941_clean_always.json */; }; - 11FB71C01B34B01000D57A52 /* bot_mac_xcode6_schedule_periodical_onhour15minsafter_clean_onceaday.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A236F6A1B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_onhour15minsafter_clean_onceaday.json */; }; - 11FB71C11B34B01000D57A52 /* bot_mac_xcode6_schedule_periodical_weeklytuesday941.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A236F6B1B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_weeklytuesday941.json */; }; - 11FB71C21B34B01000D57A52 /* bot_mac_xcode6.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A058A8F1B31596A0077FD47 /* bot_mac_xcode6.json */; }; 3A058A8E1B31595A0077FD47 /* BotParsingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A058A8D1B31595A0077FD47 /* BotParsingTests.swift */; }; - 3A058A901B31596A0077FD47 /* bot_mac_xcode6.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A058A8F1B31596A0077FD47 /* bot_mac_xcode6.json */; }; 3A058A931B315BB50077FD47 /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A058A921B315BB50077FD47 /* TestUtils.swift */; }; 3A06D5FD1B3C184400F0A6C5 /* XcodeServerEntityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709ED67B1B35FD3F00A06038 /* XcodeServerEntityTests.swift */; }; 3A06D5FE1B3C184700F0A6C5 /* XcodeServerConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709ED67F1B3608FC00A06038 /* XcodeServerConfigTests.swift */; }; 3A06D5FF1B3C184D00F0A6C5 /* HTTPUtilsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 705D59A01B3AE502002521BA /* HTTPUtilsTests.swift */; }; 3A06D6001B3C184F00F0A6C5 /* BotConfigurationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70B21FF71B3AFB1D00EAD4EB /* BotConfigurationTests.swift */; }; - 3A236F6C1B335E170042A9B1 /* bot_mac_xcode6_schedule_manual_no_actions_clean_never_all_triggers.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A236F671B335E170042A9B1 /* bot_mac_xcode6_schedule_manual_no_actions_clean_never_all_triggers.json */; }; - 3A236F6D1B335E170042A9B1 /* bot_mac_xcode6_schedule_oncommit_all_actions_clean_onceaweek.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A236F681B335E170042A9B1 /* bot_mac_xcode6_schedule_oncommit_all_actions_clean_onceaweek.json */; }; - 3A236F6E1B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_daily941_clean_always.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A236F691B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_daily941_clean_always.json */; }; - 3A236F6F1B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_onhour15minsafter_clean_onceaday.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A236F6A1B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_onhour15minsafter_clean_onceaday.json */; }; - 3A236F701B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_weeklytuesday941.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A236F6B1B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_weeklytuesday941.json */; }; + 3A13F30B1B404E7500C29D81 /* platforms.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A13F30A1B404E7500C29D81 /* platforms.json */; }; + 3A13F30C1B404E7500C29D81 /* platforms.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A13F30A1B404E7500C29D81 /* platforms.json */; }; + 3A3853A21B4002C900B7F842 /* osx_bot.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A3853A11B4002C900B7F842 /* osx_bot.json */; }; + 3A3853A31B4002C900B7F842 /* osx_bot.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A3853A11B4002C900B7F842 /* osx_bot.json */; }; + 3A3853A71B40046E00B7F842 /* create_ios_bot.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A3853A41B40046E00B7F842 /* create_ios_bot.json */; }; + 3A3853A81B40046E00B7F842 /* create_ios_bot.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A3853A41B40046E00B7F842 /* create_ios_bot.json */; }; + 3A3853A91B40046E00B7F842 /* create_osx_bot.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A3853A51B40046E00B7F842 /* create_osx_bot.json */; }; + 3A3853AA1B40046E00B7F842 /* create_osx_bot.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A3853A51B40046E00B7F842 /* create_osx_bot.json */; }; + 3A3853AB1B40046E00B7F842 /* create_watch_bot.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A3853A61B40046E00B7F842 /* create_watch_bot.json */; }; + 3A3853AC1B40046E00B7F842 /* create_watch_bot.json in Resources */ = {isa = PBXBuildFile; fileRef = 3A3853A61B40046E00B7F842 /* create_watch_bot.json */; }; 3A7B48C01B2A5AC40077ABEA /* XcodeServerSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A7B48BF1B2A5AC40077ABEA /* XcodeServerSDK.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3A7B48C61B2A5AC40077ABEA /* XcodeServerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7B48BA1B2A5AC40077ABEA /* XcodeServerSDK.framework */; }; 3A7B48CD1B2A5AC40077ABEA /* XcodeServerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A7B48CC1B2A5AC40077ABEA /* XcodeServerTests.swift */; }; @@ -94,8 +90,22 @@ 3A7B48F11B2A5B7B0077ABEA /* JSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A7B48F01B2A5B7B0077ABEA /* JSON.swift */; }; 3A7B48F51B2A5BC60077ABEA /* Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A7B48F41B2A5BC60077ABEA /* Logging.swift */; }; 3A7B48F71B2A5BDA0077ABEA /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A7B48F61B2A5BDA0077ABEA /* Errors.swift */; }; - 3AC786761B33626000BBA482 /* bot_ios_xcode7.json in Resources */ = {isa = PBXBuildFile; fileRef = 3AC786741B33626000BBA482 /* bot_ios_xcode7.json */; }; - 3AC786771B33626000BBA482 /* bot_mac_xcode7.json in Resources */ = {isa = PBXBuildFile; fileRef = 3AC786751B33626000BBA482 /* bot_mac_xcode7.json */; }; + 3A80C8061B3B62390065C1C6 /* ContainerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A80C8051B3B62390065C1C6 /* ContainerExtensions.swift */; }; + 3A80C8071B3B62390065C1C6 /* ContainerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A80C8051B3B62390065C1C6 /* ContainerExtensions.swift */; }; + 3A80C8081B3B63790065C1C6 /* ContainerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A80C8051B3B62390065C1C6 /* ContainerExtensions.swift */; }; + 3A80C8091B3B639D0065C1C6 /* DeviceSpecification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ABE68651B3AC3C500FA0A61 /* DeviceSpecification.swift */; }; + 3AA9224B1B3F0E38005A0F73 /* scm_branches_request_no_fingerprint.json in Resources */ = {isa = PBXBuildFile; fileRef = 3AA922391B3F0E2C005A0F73 /* scm_branches_request_no_fingerprint.json */; }; + 3AA9224C1B3F0E38005A0F73 /* scm_branches_request_with_fingerprint.json in Resources */ = {isa = PBXBuildFile; fileRef = 3AA9223A1B3F0E2C005A0F73 /* scm_branches_request_with_fingerprint.json */; }; + 3AA9224E1B3F0E38005A0F73 /* scm_branches_response_success.json in Resources */ = {isa = PBXBuildFile; fileRef = 3AA9223C1B3F0E2C005A0F73 /* scm_branches_response_success.json */; }; + 3AA9224F1B3F0E38005A0F73 /* scm_branches_response_error.json in Resources */ = {isa = PBXBuildFile; fileRef = 3AA9223D1B3F0E2C005A0F73 /* scm_branches_response_error.json */; }; + 3AA922501B3F0E39005A0F73 /* scm_branches_request_no_fingerprint.json in Resources */ = {isa = PBXBuildFile; fileRef = 3AA922391B3F0E2C005A0F73 /* scm_branches_request_no_fingerprint.json */; }; + 3AA922511B3F0E39005A0F73 /* scm_branches_request_with_fingerprint.json in Resources */ = {isa = PBXBuildFile; fileRef = 3AA9223A1B3F0E2C005A0F73 /* scm_branches_request_with_fingerprint.json */; }; + 3AA922531B3F0E39005A0F73 /* scm_branches_response_success.json in Resources */ = {isa = PBXBuildFile; fileRef = 3AA9223C1B3F0E2C005A0F73 /* scm_branches_response_success.json */; }; + 3AA922541B3F0E39005A0F73 /* scm_branches_response_error.json in Resources */ = {isa = PBXBuildFile; fileRef = 3AA9223D1B3F0E2C005A0F73 /* scm_branches_response_error.json */; }; + 3AA922B71B3F4657005A0F73 /* DVR.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA922B21B3F4630005A0F73 /* DVR.framework */; }; + 3AA922BA1B3F4666005A0F73 /* DVR.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA922AC1B3F4630005A0F73 /* DVR.framework */; }; + 3ABE68661B3AC3C500FA0A61 /* DeviceSpecification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ABE68651B3AC3C500FA0A61 /* DeviceSpecification.swift */; }; + 3ABE68671B3AC3C500FA0A61 /* DeviceSpecification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ABE68651B3AC3C500FA0A61 /* DeviceSpecification.swift */; }; 705D59A11B3AE502002521BA /* HTTPUtilsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 705D59A01B3AE502002521BA /* HTTPUtilsTests.swift */; }; 707D08961B2C684C003900F3 /* XcodeServerConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 707D08951B2C684C003900F3 /* XcodeServerConfig.swift */; }; 707D08981B2C6954003900F3 /* EmailConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 707D08971B2C6954003900F3 /* EmailConfiguration.swift */; }; @@ -122,6 +132,55 @@ remoteGlobalIDString = 3A7B48B91B2A5AC40077ABEA; remoteInfo = XcodeServerSDK; }; + 3AA922AB1B3F4630005A0F73 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3AA922A31B3F4630005A0F73 /* DVR.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3647AF9B1B335D5500EF10D4; + remoteInfo = "DVR-iOS"; + }; + 3AA922AD1B3F4630005A0F73 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3AA922A31B3F4630005A0F73 /* DVR.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3647AFA51B335D5500EF10D4; + remoteInfo = "DVRTests-iOS"; + }; + 3AA922AF1B3F4630005A0F73 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3AA922A31B3F4630005A0F73 /* DVR.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3690A06E1B33AA0900731222; + remoteInfo = "DVR-watchOS"; + }; + 3AA922B11B3F4630005A0F73 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3AA922A31B3F4630005A0F73 /* DVR.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3690A07B1B33AA3B00731222; + remoteInfo = "DVR-OSX"; + }; + 3AA922B31B3F4630005A0F73 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3AA922A31B3F4630005A0F73 /* DVR.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3690A0841B33AA3C00731222; + remoteInfo = "DVRTests-OSX"; + }; + 3AA922B51B3F4651005A0F73 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3AA922A31B3F4630005A0F73 /* DVR.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 3690A07A1B33AA3B00731222; + remoteInfo = "DVR-OSX"; + }; + 3AA922B81B3F4661005A0F73 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3AA922A31B3F4630005A0F73 /* DVR.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 3647AF9A1B335D5500EF10D4; + remoteInfo = "DVR-iOS"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -131,14 +190,13 @@ 11FB71891B34AE7F00D57A52 /* XcodeServerSDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = XcodeServerSDK.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 11FB71921B34AE7F00D57A52 /* XcodeServerSDKTest.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XcodeServerSDKTest.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3A058A8D1B31595A0077FD47 /* BotParsingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BotParsingTests.swift; sourceTree = ""; }; - 3A058A8F1B31596A0077FD47 /* bot_mac_xcode6.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = bot_mac_xcode6.json; path = Data/bot_mac_xcode6.json; sourceTree = ""; }; 3A058A921B315BB50077FD47 /* TestUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestUtils.swift; sourceTree = ""; }; - 3A236F671B335E170042A9B1 /* bot_mac_xcode6_schedule_manual_no_actions_clean_never_all_triggers.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = bot_mac_xcode6_schedule_manual_no_actions_clean_never_all_triggers.json; path = Data/bot_mac_xcode6_schedule_manual_no_actions_clean_never_all_triggers.json; sourceTree = ""; }; - 3A236F681B335E170042A9B1 /* bot_mac_xcode6_schedule_oncommit_all_actions_clean_onceaweek.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = bot_mac_xcode6_schedule_oncommit_all_actions_clean_onceaweek.json; path = Data/bot_mac_xcode6_schedule_oncommit_all_actions_clean_onceaweek.json; sourceTree = ""; }; - 3A236F691B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_daily941_clean_always.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = bot_mac_xcode6_schedule_periodical_daily941_clean_always.json; path = Data/bot_mac_xcode6_schedule_periodical_daily941_clean_always.json; sourceTree = ""; }; - 3A236F6A1B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_onhour15minsafter_clean_onceaday.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = bot_mac_xcode6_schedule_periodical_onhour15minsafter_clean_onceaday.json; path = Data/bot_mac_xcode6_schedule_periodical_onhour15minsafter_clean_onceaday.json; sourceTree = ""; }; - 3A236F6B1B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_weeklytuesday941.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = bot_mac_xcode6_schedule_periodical_weeklytuesday941.json; path = Data/bot_mac_xcode6_schedule_periodical_weeklytuesday941.json; sourceTree = ""; }; + 3A13F30A1B404E7500C29D81 /* platforms.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = platforms.json; path = Data/platforms.json; sourceTree = ""; }; 3A25FBBB1B36E2C700897D11 /* XcodeServerSDK.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = XcodeServerSDK.playground; sourceTree = ""; }; + 3A3853A11B4002C900B7F842 /* osx_bot.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = osx_bot.json; sourceTree = ""; }; + 3A3853A41B40046E00B7F842 /* create_ios_bot.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = create_ios_bot.json; path = Data/create_ios_bot.json; sourceTree = ""; }; + 3A3853A51B40046E00B7F842 /* create_osx_bot.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = create_osx_bot.json; path = Data/create_osx_bot.json; sourceTree = ""; }; + 3A3853A61B40046E00B7F842 /* create_watch_bot.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = create_watch_bot.json; path = Data/create_watch_bot.json; sourceTree = ""; }; 3A7B48BA1B2A5AC40077ABEA /* XcodeServerSDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = XcodeServerSDK.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3A7B48BE1B2A5AC40077ABEA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 3A7B48BF1B2A5AC40077ABEA /* XcodeServerSDK.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XcodeServerSDK.h; sourceTree = ""; }; @@ -161,8 +219,13 @@ 3A7B48F01B2A5B7B0077ABEA /* JSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSON.swift; sourceTree = ""; }; 3A7B48F41B2A5BC60077ABEA /* Logging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Logging.swift; sourceTree = ""; }; 3A7B48F61B2A5BDA0077ABEA /* Errors.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Errors.swift; sourceTree = ""; }; - 3AC786741B33626000BBA482 /* bot_ios_xcode7.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = bot_ios_xcode7.json; path = Data/bot_ios_xcode7.json; sourceTree = ""; }; - 3AC786751B33626000BBA482 /* bot_mac_xcode7.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = bot_mac_xcode7.json; path = Data/bot_mac_xcode7.json; sourceTree = ""; }; + 3A80C8051B3B62390065C1C6 /* ContainerExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContainerExtensions.swift; sourceTree = ""; }; + 3AA922391B3F0E2C005A0F73 /* scm_branches_request_no_fingerprint.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = scm_branches_request_no_fingerprint.json; path = Data/scm_branches_request_no_fingerprint.json; sourceTree = ""; }; + 3AA9223A1B3F0E2C005A0F73 /* scm_branches_request_with_fingerprint.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = scm_branches_request_with_fingerprint.json; path = Data/scm_branches_request_with_fingerprint.json; sourceTree = ""; }; + 3AA9223C1B3F0E2C005A0F73 /* scm_branches_response_success.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = scm_branches_response_success.json; path = Data/scm_branches_response_success.json; sourceTree = ""; }; + 3AA9223D1B3F0E2C005A0F73 /* scm_branches_response_error.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = scm_branches_response_error.json; path = Data/scm_branches_response_error.json; sourceTree = ""; }; + 3AA922A31B3F4630005A0F73 /* DVR.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = DVR.xcodeproj; path = Carthage/Checkouts/DVR/DVR.xcodeproj; sourceTree = ""; }; + 3ABE68651B3AC3C500FA0A61 /* DeviceSpecification.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceSpecification.swift; sourceTree = ""; }; 705D59A01B3AE502002521BA /* HTTPUtilsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTTPUtilsTests.swift; sourceTree = ""; }; 707D08951B2C684C003900F3 /* XcodeServerConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XcodeServerConfig.swift; sourceTree = ""; }; 707D08971B2C6954003900F3 /* EmailConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmailConfiguration.swift; sourceTree = ""; }; @@ -193,6 +256,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 3AA922BA1B3F4666005A0F73 /* DVR.framework in Frameworks */, 11FB71931B34AE7F00D57A52 /* XcodeServerSDK.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -208,6 +272,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 3AA922B71B3F4657005A0F73 /* DVR.framework in Frameworks */, 3A7B48C61B2A5AC40077ABEA /* XcodeServerSDK.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -228,14 +293,14 @@ 3A058A911B31596E0077FD47 /* Data */ = { isa = PBXGroup; children = ( - 3AC786741B33626000BBA482 /* bot_ios_xcode7.json */, - 3AC786751B33626000BBA482 /* bot_mac_xcode7.json */, - 3A236F671B335E170042A9B1 /* bot_mac_xcode6_schedule_manual_no_actions_clean_never_all_triggers.json */, - 3A236F681B335E170042A9B1 /* bot_mac_xcode6_schedule_oncommit_all_actions_clean_onceaweek.json */, - 3A236F691B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_daily941_clean_always.json */, - 3A236F6A1B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_onhour15minsafter_clean_onceaday.json */, - 3A236F6B1B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_weeklytuesday941.json */, - 3A058A8F1B31596A0077FD47 /* bot_mac_xcode6.json */, + 3A13F30A1B404E7500C29D81 /* platforms.json */, + 3A3853A41B40046E00B7F842 /* create_ios_bot.json */, + 3A3853A51B40046E00B7F842 /* create_osx_bot.json */, + 3A3853A61B40046E00B7F842 /* create_watch_bot.json */, + 3AA922391B3F0E2C005A0F73 /* scm_branches_request_no_fingerprint.json */, + 3AA9223A1B3F0E2C005A0F73 /* scm_branches_request_with_fingerprint.json */, + 3AA9223C1B3F0E2C005A0F73 /* scm_branches_response_success.json */, + 3AA9223D1B3F0E2C005A0F73 /* scm_branches_response_error.json */, ); name = Data; sourceTree = ""; @@ -246,6 +311,7 @@ 3A7B48BC1B2A5AC40077ABEA /* XcodeServerSDK */, 3A7B48C91B2A5AC40077ABEA /* XcodeServerSDKTests */, 11376BD11B3A2F910005A681 /* XcodeServerSDK - ᴡᴀᴛᴄʜ */, + 3AA922A21B3F460E005A0F73 /* Dependencies */, 70F463351B2B3EF800C3F963 /* Playgrounds */, 3A7B48BB1B2A5AC40077ABEA /* Products */, ); @@ -291,6 +357,7 @@ 3A7B48C91B2A5AC40077ABEA /* XcodeServerSDKTests */ = { isa = PBXGroup; children = ( + 3AD14B771B3F71C600BFDEAA /* Casettes */, 3A058A911B31596E0077FD47 /* Data */, 3A7B48CC1B2A5AC40077ABEA /* XcodeServerTests.swift */, 709ED67F1B3608FC00A06038 /* XcodeServerConfigTests.swift */, @@ -312,18 +379,48 @@ name = "Supporting Files"; sourceTree = ""; }; + 3AA922A21B3F460E005A0F73 /* Dependencies */ = { + isa = PBXGroup; + children = ( + 3AA922A31B3F4630005A0F73 /* DVR.xcodeproj */, + ); + name = Dependencies; + sourceTree = ""; + }; + 3AA922A41B3F4630005A0F73 /* Products */ = { + isa = PBXGroup; + children = ( + 3AA922AC1B3F4630005A0F73 /* DVR.framework */, + 3AA922AE1B3F4630005A0F73 /* DVRTests-iOS.xctest */, + 3AA922B01B3F4630005A0F73 /* DVR.framework */, + 3AA922B21B3F4630005A0F73 /* DVR.framework */, + 3AA922B41B3F4630005A0F73 /* DVRTests-OSX.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 3AD14B771B3F71C600BFDEAA /* Casettes */ = { + isa = PBXGroup; + children = ( + 3A3853A11B4002C900B7F842 /* osx_bot.json */, + ); + name = Casettes; + path = XcodeServerSDKTests/Casettes; + sourceTree = SOURCE_ROOT; + }; 707D089F1B2C6AA1003900F3 /* Server Entities */ = { isa = PBXGroup; children = ( 3A7B48D61B2A5ADE0077ABEA /* Bot.swift */, 3A7B48D71B2A5ADE0077ABEA /* BotConfiguration.swift */, - 707D08971B2C6954003900F3 /* EmailConfiguration.swift */, 707D08991B2C6986003900F3 /* BotSchedule.swift */, - 707D089B1B2C69C4003900F3 /* Trigger.swift */, - 707D089D1B2C6A1F003900F3 /* TriggerConditions.swift */, 3A7B48D91B2A5ADE0077ABEA /* Device.swift */, - 3A7B48DB1B2A5ADE0077ABEA /* SourceControlBlueprint.swift */, + 3ABE68651B3AC3C500FA0A61 /* DeviceSpecification.swift */, + 707D08971B2C6954003900F3 /* EmailConfiguration.swift */, 3A7B48DA1B2A5ADE0077ABEA /* Integration.swift */, + 3A7B48DB1B2A5ADE0077ABEA /* SourceControlBlueprint.swift */, + 707D089B1B2C69C4003900F3 /* Trigger.swift */, + 707D089D1B2C6A1F003900F3 /* TriggerConditions.swift */, ); path = "Server Entities"; sourceTree = ""; @@ -334,6 +431,7 @@ 3A7B48EE1B2A5B520077ABEA /* HTTPUtils.swift */, 3A7B48F01B2A5B7B0077ABEA /* JSON.swift */, 3A7B48F41B2A5BC60077ABEA /* Logging.swift */, + 3A80C8051B3B62390065C1C6 /* ContainerExtensions.swift */, ); path = Utils; sourceTree = ""; @@ -434,6 +532,7 @@ buildRules = ( ); dependencies = ( + 3AA922B91B3F4661005A0F73 /* PBXTargetDependency */, 11FB71951B34AE7F00D57A52 /* PBXTargetDependency */, ); name = "XcodeServerSDK - iOS Tests"; @@ -470,6 +569,7 @@ buildRules = ( ); dependencies = ( + 3AA922B61B3F4651005A0F73 /* PBXTargetDependency */, 3A7B48C81B2A5AC40077ABEA /* PBXTargetDependency */, ); name = "XcodeServerSDK - OS X Tests"; @@ -514,6 +614,12 @@ mainGroup = 3A7B48B01B2A5AC40077ABEA; productRefGroup = 3A7B48BB1B2A5AC40077ABEA /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 3AA922A41B3F4630005A0F73 /* Products */; + ProjectRef = 3AA922A31B3F4630005A0F73 /* DVR.xcodeproj */; + }, + ); projectRoot = ""; targets = ( 3A7B48B91B2A5AC40077ABEA /* XcodeServerSDK - OS X */, @@ -525,6 +631,44 @@ }; /* End PBXProject section */ +/* Begin PBXReferenceProxy section */ + 3AA922AC1B3F4630005A0F73 /* DVR.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = DVR.framework; + remoteRef = 3AA922AB1B3F4630005A0F73 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3AA922AE1B3F4630005A0F73 /* DVRTests-iOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "DVRTests-iOS.xctest"; + remoteRef = 3AA922AD1B3F4630005A0F73 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3AA922B01B3F4630005A0F73 /* DVR.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = DVR.framework; + remoteRef = 3AA922AF1B3F4630005A0F73 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3AA922B21B3F4630005A0F73 /* DVR.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = DVR.framework; + remoteRef = 3AA922B11B3F4630005A0F73 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3AA922B41B3F4630005A0F73 /* DVRTests-OSX.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "DVRTests-OSX.xctest"; + remoteRef = 3AA922B31B3F4630005A0F73 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + /* Begin PBXResourcesBuildPhase section */ 11376BCE1B3A2F910005A681 /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -544,14 +688,15 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 11FB71BB1B34B01000D57A52 /* bot_ios_xcode7.json in Resources */, - 11FB71BC1B34B01000D57A52 /* bot_mac_xcode7.json in Resources */, - 11FB71BD1B34B01000D57A52 /* bot_mac_xcode6_schedule_manual_no_actions_clean_never_all_triggers.json in Resources */, - 11FB71BE1B34B01000D57A52 /* bot_mac_xcode6_schedule_oncommit_all_actions_clean_onceaweek.json in Resources */, - 11FB71BF1B34B01000D57A52 /* bot_mac_xcode6_schedule_periodical_daily941_clean_always.json in Resources */, - 11FB71C01B34B01000D57A52 /* bot_mac_xcode6_schedule_periodical_onhour15minsafter_clean_onceaday.json in Resources */, - 11FB71C11B34B01000D57A52 /* bot_mac_xcode6_schedule_periodical_weeklytuesday941.json in Resources */, - 11FB71C21B34B01000D57A52 /* bot_mac_xcode6.json in Resources */, + 3A13F30C1B404E7500C29D81 /* platforms.json in Resources */, + 3A3853AA1B40046E00B7F842 /* create_osx_bot.json in Resources */, + 3A3853A31B4002C900B7F842 /* osx_bot.json in Resources */, + 3A3853A81B40046E00B7F842 /* create_ios_bot.json in Resources */, + 3A3853AC1B40046E00B7F842 /* create_watch_bot.json in Resources */, + 3AA922511B3F0E39005A0F73 /* scm_branches_request_with_fingerprint.json in Resources */, + 3AA922541B3F0E39005A0F73 /* scm_branches_response_error.json in Resources */, + 3AA922501B3F0E39005A0F73 /* scm_branches_request_no_fingerprint.json in Resources */, + 3AA922531B3F0E39005A0F73 /* scm_branches_response_success.json in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -566,14 +711,15 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 3A236F6C1B335E170042A9B1 /* bot_mac_xcode6_schedule_manual_no_actions_clean_never_all_triggers.json in Resources */, - 3AC786771B33626000BBA482 /* bot_mac_xcode7.json in Resources */, - 3AC786761B33626000BBA482 /* bot_ios_xcode7.json in Resources */, - 3A058A901B31596A0077FD47 /* bot_mac_xcode6.json in Resources */, - 3A236F6F1B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_onhour15minsafter_clean_onceaday.json in Resources */, - 3A236F701B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_weeklytuesday941.json in Resources */, - 3A236F6D1B335E170042A9B1 /* bot_mac_xcode6_schedule_oncommit_all_actions_clean_onceaweek.json in Resources */, - 3A236F6E1B335E170042A9B1 /* bot_mac_xcode6_schedule_periodical_daily941_clean_always.json in Resources */, + 3A13F30B1B404E7500C29D81 /* platforms.json in Resources */, + 3A3853A91B40046E00B7F842 /* create_osx_bot.json in Resources */, + 3A3853A21B4002C900B7F842 /* osx_bot.json in Resources */, + 3A3853A71B40046E00B7F842 /* create_ios_bot.json in Resources */, + 3A3853AB1B40046E00B7F842 /* create_watch_bot.json in Resources */, + 3AA9224C1B3F0E38005A0F73 /* scm_branches_request_with_fingerprint.json in Resources */, + 3AA9224F1B3F0E38005A0F73 /* scm_branches_response_error.json in Resources */, + 3AA9224B1B3F0E38005A0F73 /* scm_branches_request_no_fingerprint.json in Resources */, + 3AA9224E1B3F0E38005A0F73 /* scm_branches_response_success.json in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -585,6 +731,7 @@ buildActionMask = 2147483647; files = ( 11376BEA1B3A2FF40005A681 /* HTTPUtils.swift in Sources */, + 3A80C8081B3B63790065C1C6 /* ContainerExtensions.swift in Sources */, 11376BEB1B3A2FF40005A681 /* JSON.swift in Sources */, 11376BEC1B3A2FF40005A681 /* Logging.swift in Sources */, 11376BDD1B3A2FE30005A681 /* Bot.swift in Sources */, @@ -603,6 +750,7 @@ 11376BD81B3A2FD90005A681 /* XcodeServer.swift in Sources */, 11376BD91B3A2FD90005A681 /* XcodeServerEntity.swift in Sources */, 11376BDA1B3A2FD90005A681 /* XcodeServerConfig.swift in Sources */, + 3A80C8091B3B639D0065C1C6 /* DeviceSpecification.swift in Sources */, 11376BDB1B3A2FD90005A681 /* XcodeServerEndpoints.swift in Sources */, 11376BDC1B3A2FD90005A681 /* XcodeServerFactory.swift in Sources */, ); @@ -623,6 +771,7 @@ 11FB71A81B34AF2400D57A52 /* BotConfiguration.swift in Sources */, 11FB71A91B34AF2400D57A52 /* EmailConfiguration.swift in Sources */, 11FB71AA1B34AF2400D57A52 /* BotSchedule.swift in Sources */, + 3ABE68671B3AC3C500FA0A61 /* DeviceSpecification.swift in Sources */, 11FB71AB1B34AF2400D57A52 /* Trigger.swift in Sources */, 11FB71AC1B34AF2400D57A52 /* TriggerConditions.swift in Sources */, 11FB71AD1B34AF2400D57A52 /* Device.swift in Sources */, @@ -631,6 +780,7 @@ 11FB71A21B34AF1A00D57A52 /* XcodeServer.swift in Sources */, 11FB71A31B34AF1A00D57A52 /* XcodeServerEntity.swift in Sources */, 11FB71A41B34AF1A00D57A52 /* XcodeServerConfig.swift in Sources */, + 3A80C8071B3B62390065C1C6 /* ContainerExtensions.swift in Sources */, 11FB71A51B34AF1A00D57A52 /* XcodeServerEndpoints.swift in Sources */, 11FB71A61B34AF1A00D57A52 /* XcodeServerFactory.swift in Sources */, ); @@ -665,6 +815,7 @@ 707D089C1B2C69C4003900F3 /* Trigger.swift in Sources */, 3A7B48E21B2A5ADE0077ABEA /* BotConfiguration.swift in Sources */, 3A7B48EA1B2A5ADE0077ABEA /* XcodeServerEntity.swift in Sources */, + 3ABE68661B3AC3C500FA0A61 /* DeviceSpecification.swift in Sources */, 707D08961B2C684C003900F3 /* XcodeServerConfig.swift in Sources */, 3A7B48EB1B2A5ADE0077ABEA /* XcodeServerFactory.swift in Sources */, 707D089E1B2C6A1F003900F3 /* TriggerConditions.swift in Sources */, @@ -673,6 +824,7 @@ 3A7B48ED1B2A5B3C0077ABEA /* Server.swift in Sources */, 707D08981B2C6954003900F3 /* EmailConfiguration.swift in Sources */, 3A7B48E41B2A5ADE0077ABEA /* Device.swift in Sources */, + 3A80C8061B3B62390065C1C6 /* ContainerExtensions.swift in Sources */, 707D089A1B2C6986003900F3 /* BotSchedule.swift in Sources */, 3A7B48F51B2A5BC60077ABEA /* Logging.swift in Sources */, ); @@ -705,6 +857,16 @@ target = 3A7B48B91B2A5AC40077ABEA /* XcodeServerSDK - OS X */; targetProxy = 3A7B48C71B2A5AC40077ABEA /* PBXContainerItemProxy */; }; + 3AA922B61B3F4651005A0F73 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "DVR-OSX"; + targetProxy = 3AA922B51B3F4651005A0F73 /* PBXContainerItemProxy */; + }; + 3AA922B91B3F4661005A0F73 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "DVR-iOS"; + targetProxy = 3AA922B81B3F4661005A0F73 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ diff --git a/XcodeServerSDK/Server Entities/Bot.swift b/XcodeServerSDK/Server Entities/Bot.swift index 279c8c3..ebac88a 100644 --- a/XcodeServerSDK/Server Entities/Bot.swift +++ b/XcodeServerSDK/Server Entities/Bot.swift @@ -12,13 +12,13 @@ public class Bot : XcodeServerEntity { public let name: String public let configuration: BotConfiguration - public let integrationsCount: Int! + public let integrationsCount: Int public required init(json: NSDictionary) { self.name = json.stringForKey("name") self.configuration = BotConfiguration(json: json.dictionaryForKey("configuration")) - self.integrationsCount = json.intForKey("integration_counter") + self.integrationsCount = json.optionalIntForKey("integration_counter") ?? 0 super.init(json: json) } @@ -30,7 +30,7 @@ public class Bot : XcodeServerEntity { self.name = name self.configuration = configuration - self.integrationsCount = nil + self.integrationsCount = 0 super.init() } diff --git a/XcodeServerSDK/Server Entities/BotConfiguration.swift b/XcodeServerSDK/Server Entities/BotConfiguration.swift index 4e5d947..bccfe68 100644 --- a/XcodeServerSDK/Server Entities/BotConfiguration.swift +++ b/XcodeServerSDK/Server Entities/BotConfiguration.swift @@ -69,46 +69,8 @@ public class BotConfiguration : XcodeServerEntity { - AllCompatible: All Compatible (default) - for build only */ public enum TestingDestinationIdentifier : Int { - case iOS_AllDevicesAndSimulators = 0 - case iOS_AllDevices = 1 - case iOS_AllSimulators = 2 - case iOS_SelectedDevicesAndSimulators = 3 + case iOSAndWatch = 0 case Mac = 7 - case AllCompatible = 8 - - public func toString() -> String { - switch self { - case .iOS_AllDevicesAndSimulators: - return "iOS: All Devices and Simulators" - case .iOS_AllDevices: - return "iOS: All Devices" - case .iOS_AllSimulators: - return "iOS: All Simulators" - case .iOS_SelectedDevicesAndSimulators: - return "iOS: Selected Devices and Simulators" - case .Mac: - return "Mac" - case .AllCompatible: - return "All Compatible (Mac + iOS)" - } - } - - public func allowedDeviceTypes() -> [DeviceType] { - switch self { - case .iOS_AllDevicesAndSimulators: - return [.iPhone, .Simulator] - case .iOS_AllDevices: - return [.iPhone] - case .iOS_AllSimulators: - return [.Simulator] - case .iOS_SelectedDevicesAndSimulators: - return [.iPhone, .Simulator] - case .Mac: - return [.Mac] - case .AllCompatible: - return [.iPhone, .Simulator, .Mac] - } - } } public let builtFromClean: CleaningPolicy! @@ -118,8 +80,17 @@ public class BotConfiguration : XcodeServerEntity { public let schemeName: String public let schedule: BotSchedule public let triggers: [Trigger] - public let testingDestinationType: TestingDestinationIdentifier? - public let testingDeviceIDs: [String] + public var testingDestinationType: TestingDestinationIdentifier { + get { + if let firstFilter = self.deviceSpecification.filters.first { + if case .OSX = firstFilter.platform.type { + return .Mac + } + } + return .iOSAndWatch + } + } + public let deviceSpecification: DeviceSpecification public let sourceControlBlueprint: SourceControlBlueprint public required init(json: NSDictionary) { @@ -131,10 +102,19 @@ public class BotConfiguration : XcodeServerEntity { self.schemeName = json.stringForKey("schemeName") self.schedule = BotSchedule(json: json) self.triggers = XcodeServerArray(json.arrayForKey("triggers")) - self.testingDestinationType = TestingDestinationIdentifier(rawValue: json.intForKey("testingDestinationType")) - self.testingDeviceIDs = json.arrayForKey("testingDeviceIDs") self.sourceControlBlueprint = SourceControlBlueprint(json: json.dictionaryForKey("sourceControlBlueprint")) + //old bots (xcode 6) only have testingDeviceIds, try to parse those into the new format of DeviceSpecification (xcode 7) + if let deviceSpecJSON = json.optionalDictionaryForKey("deviceSpecification") { + self.deviceSpecification = DeviceSpecification(json: deviceSpecJSON) + } else { + if let testingDeviceIds = json.optionalArrayForKey("testingDeviceIDs") as? [String] { + self.deviceSpecification = DeviceSpecification(testingDeviceIDs: testingDeviceIds) + } else { + self.deviceSpecification = DeviceSpecification(testingDeviceIDs: []) + } + } + super.init(json: json) } @@ -146,8 +126,7 @@ public class BotConfiguration : XcodeServerEntity { schemeName: String, schedule: BotSchedule, triggers: [Trigger], - testingDeviceIDs: [String], - testingDestinationType: TestingDestinationIdentifier, + deviceSpecification: DeviceSpecification, sourceControlBlueprint: SourceControlBlueprint) { self.builtFromClean = builtFromClean @@ -157,9 +136,8 @@ public class BotConfiguration : XcodeServerEntity { self.schemeName = schemeName self.schedule = schedule self.triggers = triggers - self.testingDeviceIDs = testingDeviceIDs + self.deviceSpecification = deviceSpecification self.sourceControlBlueprint = sourceControlBlueprint - self.testingDestinationType = testingDestinationType super.init() } @@ -177,9 +155,9 @@ public class BotConfiguration : XcodeServerEntity { dictionary["triggers"] = self.triggers.map { $0.dictionarify() } dictionary["performsAnalyzeAction"] = self.analyze dictionary["schemeName"] = self.schemeName - dictionary["testingDeviceIDs"] = self.testingDeviceIDs + dictionary["deviceSpecification"] = self.deviceSpecification.dictionarify() dictionary["performsArchiveAction"] = self.archive - dictionary["testingDestinationType"] = self.testingDestinationType?.rawValue //TODO: figure out if we need this + dictionary["testingDestinationType"] = self.testingDestinationType.rawValue //TODO: figure out if we still need this in Xcode 7 let botScheduleDict = self.schedule.dictionarify() //needs to be merged into the main bot config dict dictionary.addEntriesFromDictionary(botScheduleDict as [NSObject : AnyObject]) diff --git a/XcodeServerSDK/Server Entities/DeviceSpecification.swift b/XcodeServerSDK/Server Entities/DeviceSpecification.swift new file mode 100644 index 0000000..b3007e3 --- /dev/null +++ b/XcodeServerSDK/Server Entities/DeviceSpecification.swift @@ -0,0 +1,192 @@ +// +// DeviceSpecification.swift +// XcodeServerSDK +// +// Created by Honza Dvorsky on 24/06/2015. +// Copyright © 2015 Honza Dvorsky. All rights reserved. +// + +import Foundation + +public class DevicePlatform : XcodeServerEntity { + + let displayName: String + let version: String + + public enum PlatformType: String { + case Unknown = "unknown" + case iOS = "com.apple.platform.iphoneos" + case OSX = "com.apple.platform.macosx" + case watchOS = "com.apple.platform.watchos" + } + + public enum SimulatorType: String { + case iPhone = "com.apple.platform.iphonesimulator" + case Watch = "com.apple.platform.watchsimulator" + } + + let type: PlatformType + let simulatorType: SimulatorType? + + public required init(json: NSDictionary) { + + self.displayName = json.stringForKey("displayName") + self.version = json.stringForKey("version") + self.type = PlatformType(rawValue: json.optionalStringForKey("identifier") ?? "") ?? .Unknown + self.simulatorType = SimulatorType(rawValue: json.optionalStringForKey("simulatorIdentifier") ?? "") + + super.init(json: json) + } + + //for just informing the intention - iOS or WatchOS or OS X - and we'll fetch the real ones and replace this placeholder with a fetched one. + public init(type: PlatformType) { + self.type = type + self.displayName = "" + self.version = "" + self.simulatorType = nil + + super.init() + } + + public class func OSX() -> DevicePlatform { + return DevicePlatform(type: DevicePlatform.PlatformType.OSX) + } + + public class func iOS() -> DevicePlatform { + return DevicePlatform(type: DevicePlatform.PlatformType.iOS) + } + + public class func watchOS() -> DevicePlatform { + return DevicePlatform(type: DevicePlatform.PlatformType.watchOS) + } + + public override func dictionarify() -> NSDictionary { + + //in this case we want everything the way we parsed it. + if let original = self.originalJSON { + return original + } + + let dictionary = NSMutableDictionary() + + dictionary["displayName"] = self.displayName + dictionary["version"] = self.version + dictionary["identifier"] = self.type.rawValue + dictionary.optionallyAddValueForKey(self.simulatorType?.rawValue, key: "simulatorIdentifier") + + return dictionary + } +} + +public class DeviceFilter : XcodeServerEntity { + + var platform: DevicePlatform + + public enum FilterType: Int { + case AllAvailableDevicesAndSimulators = 0 + case AllDevices = 1 + case AllSimulators = 2 + case SelectedDevicesAndSimulators = 3 + } + + let filterType: FilterType + + public enum ArchitectureType: Int { + case Unknown = -1 + case iOS_Like = 0 //also watchOS + case OSX_Like = 1 + } + + let architectureType: ArchitectureType //TODO: ditto, find out more. + + public required init(json: NSDictionary) { + + self.platform = DevicePlatform(json: json.dictionaryForKey("platform")) + self.filterType = FilterType(rawValue: json.intForKey("filterType")) ?? .AllAvailableDevicesAndSimulators + self.architectureType = ArchitectureType(rawValue: json.optionalIntForKey("architectureType") ?? -1) ?? .Unknown + + super.init(json: json) + } + + public init(platform: DevicePlatform, filterType: FilterType, architectureType: ArchitectureType) { + self.platform = platform + self.filterType = filterType + self.architectureType = architectureType + + super.init() + } + + public override func dictionarify() -> NSDictionary { + + return [ + "filterType": self.filterType.rawValue, + "architectureType": self.architectureType.rawValue, + "platform": self.platform.dictionarify() + ] + } +} + +public class DeviceSpecification : XcodeServerEntity { + + public let deviceIdentifiers: [String] + public let filters: [DeviceFilter] + + public required init(json: NSDictionary) { + + self.deviceIdentifiers = json.arrayForKey("deviceIdentifiers") + self.filters = XcodeServerArray(json.arrayForKey("filters")) + + super.init(json: json) + } + + public init(filters: [DeviceFilter], deviceIdentifiers: [String]) { + self.deviceIdentifiers = deviceIdentifiers + self.filters = filters + + super.init() + } + + /** + Initializes a new DeviceSpecification object with only a list of tested device ids. + This is a convenience initializer for compatibility with old Xcode 6 bots that are still hanging around on old servers. + */ + public init(testingDeviceIDs: [String]) { + + self.deviceIdentifiers = testingDeviceIDs + self.filters = [] + + super.init() + } + + public override func dictionarify() -> NSDictionary { + + return [ + "deviceIdentifiers": self.deviceIdentifiers, + "filters": self.filters.map({ $0.dictionarify() }) + ] + } + + // MARK: Convenience methods + + public class func OSX() -> DeviceSpecification { + let platform = DevicePlatform.OSX() + let filter = DeviceFilter(platform: platform, filterType: .AllAvailableDevicesAndSimulators, architectureType: .OSX_Like) + let spec = DeviceSpecification(filters: [filter], deviceIdentifiers: []) + return spec + } + + public class func iOS(filterType: DeviceFilter.FilterType, deviceIdentifiers: [String]) -> DeviceSpecification { + let platform = DevicePlatform.iOS() + let filter = DeviceFilter(platform: platform, filterType: filterType, architectureType: .iOS_Like) + let spec = DeviceSpecification(filters: [filter], deviceIdentifiers: deviceIdentifiers) + return spec + } + + public class func watchOS() -> DeviceSpecification { + let platform = DevicePlatform.watchOS() + let filter = DeviceFilter(platform: platform, filterType: .AllAvailableDevicesAndSimulators, architectureType: .iOS_Like) + let spec = DeviceSpecification(filters: [filter], deviceIdentifiers: []) + return spec + } +} + diff --git a/XcodeServerSDK/Server Entities/SourceControlBlueprint.swift b/XcodeServerSDK/Server Entities/SourceControlBlueprint.swift index 76b44eb..cd6eecf 100644 --- a/XcodeServerSDK/Server Entities/SourceControlBlueprint.swift +++ b/XcodeServerSDK/Server Entities/SourceControlBlueprint.swift @@ -27,6 +27,7 @@ public class SourceControlBlueprint : XcodeServerEntity { public let privateSSHKey: String? public let publicSSHKey: String? public let sshPassphrase: String? + public var certificateFingerprint: String? = nil public required init(json: NSDictionary) { @@ -48,21 +49,24 @@ public class SourceControlBlueprint : XcodeServerEntity { let repo = primarys.first! self.projectURL = repo.stringForKey(XcodeBlueprintRemoteRepositoryURLKey) + self.certificateFingerprint = repo.optionalStringForKey(XcodeBlueprintRemoteRepositoryCertFingerprintKey) let locations = json.dictionaryForKey(XcodeBlueprintLocationsKey) let location = locations.dictionaryForKey(primaryRepoId) self.branch = location.optionalStringForKey(XcodeBranchIdentifierKey) ?? "" self.commitSHA = location.optionalStringForKey(XcodeLocationRevisionKey) - self.privateSSHKey = nil - self.publicSSHKey = nil - self.sshPassphrase = nil + let authenticationStrategy = json.optionalDictionaryForKey(XcodeRepositoryAuthenticationStrategiesKey)?.optionalDictionaryForKey(primaryRepoId) + + self.privateSSHKey = authenticationStrategy?.optionalStringForKey(XcodeRepoAuthenticationStrategiesKey) + self.publicSSHKey = authenticationStrategy?.optionalStringForKey(XcodeRepoPublicKeyDataKey) + self.sshPassphrase = authenticationStrategy?.optionalStringForKey(XcodeRepoPasswordKey) super.init(json: json) } public init(branch: String, projectWCCIdentifier: String, wCCName: String, projectName: String, - projectURL: String, projectPath: String, publicSSHKey: String?, privateSSHKey: String?, sshPassphrase: String?) + projectURL: String, projectPath: String, publicSSHKey: String?, privateSSHKey: String?, sshPassphrase: String?, certificateFingerprint: String? = nil) { self.branch = branch self.projectWCCIdentifier = projectWCCIdentifier @@ -74,22 +78,75 @@ public class SourceControlBlueprint : XcodeServerEntity { self.publicSSHKey = publicSSHKey self.privateSSHKey = privateSSHKey self.sshPassphrase = sshPassphrase + self.certificateFingerprint = certificateFingerprint super.init() } //for credentials verification only - public convenience init(projectWCCIdentifier: String, projectURL: String, publicSSHKey: String?, privateSSHKey: String?, sshPassphrase: String?) { + public convenience init(projectURL: String, publicSSHKey: String?, privateSSHKey: String?, sshPassphrase: String?) { - self.init(branch: "", projectWCCIdentifier: projectWCCIdentifier, wCCName: "", projectName: "", projectURL: projectURL, projectPath: "", publicSSHKey: publicSSHKey, privateSSHKey: privateSSHKey, sshPassphrase: sshPassphrase) + self.init(branch: "", projectWCCIdentifier: "", wCCName: "", projectName: "", projectURL: projectURL, projectPath: "", publicSSHKey: publicSSHKey, privateSSHKey: privateSSHKey, sshPassphrase: sshPassphrase) } - public override func dictionarify() -> NSDictionary { + public func dictionarifyRemoteAndCredentials() -> NSDictionary { let dictionary = NSMutableDictionary() - + let repoId = self.projectWCCIdentifier let remoteUrl = self.projectURL + let sshPublicKey = self.publicSSHKey?.base64Encoded ?? "" + let sshPrivateKey = self.privateSSHKey?.base64Encoded ?? "" + let sshPassphrase = self.sshPassphrase ?? "" + let certificateFingerprint = self.certificateFingerprint ?? "" + + //blueprint is not valid without this magic version + dictionary[XcodeBlueprintVersion] = 203 + + //now, a repo is defined by its server location. so let's throw that in. + dictionary[XcodeBlueprintRemoteRepositoriesKey] = [ + [ + XcodeBlueprintRemoteRepositoryURLKey: remoteUrl, + XcodeBlueprintRemoteRepositorySystemKey: "com.apple.dt.Xcode.sourcecontrol.Git", //TODO: add more SCMs + XcodeBlueprintRemoteRepositoryIdentifierKey: repoId, + + //new - certificate fingerprint + XcodeBlueprintRemoteRepositoryCertFingerprintKey: certificateFingerprint, + XcodeBlueprintRemoteRepositoryTrustSelfSignedCertKey: true + ] + ] + + //but since there might be multiple repos (think git submodules), we need to declare + //the primary one. + dictionary[XcodeBlueprintPrimaryRemoteRepositoryKey] = repoId + + //now, this is enough for a valid blueprint. it might not be too useful, but it's valid. + //to make our supported (git) repos work, we also need some credentials. + + //repo authentication + //again, since we can provide information for multiple repos, keep the repo's id close. + dictionary[XcodeRepositoryAuthenticationStrategiesKey] = [ + repoId: [ + XcodeRepoAuthenticationTypeKey: XcodeRepoSSHKeysAuthenticationStrategy, + XcodeRepoUsernameKey: "git", //TODO: see how to add https support? + XcodeRepoPasswordKey: sshPassphrase, + XcodeRepoAuthenticationStrategiesKey: sshPrivateKey, + XcodeRepoPublicKeyDataKey: sshPublicKey + ] + ] + + //up to this is all we need to verify credentials and fingerprint during preflight + //which is now under /api/scm/branches. all the stuff below is useful for actually *creating* + //a bot. + + return dictionary + } + + private func dictionarifyForBotCreation() -> NSDictionary { + + let dictionary = self.dictionarifyRemoteAndCredentials().mutableCopy() as! NSMutableDictionary + + let repoId = self.projectWCCIdentifier var workingCopyPath = self.projectName //ensure a trailing slash if !workingCopyPath.hasSuffix("/") { @@ -98,11 +155,11 @@ public class SourceControlBlueprint : XcodeServerEntity { let relativePathToProject = self.projectPath let blueprintName = self.wCCName let branch = self.branch - let sshPublicKey = self.publicSSHKey?.base64Encoded ?? "" - let sshPrivateKey = self.privateSSHKey?.base64Encoded ?? "" - let sshPassphrase = self.sshPassphrase ?? "" - //locations on the branch + //we're creating a bot now. + + //our bot has to know which code to check out - we declare that by giving it a branch to track. + //in our case it can be "master", for instance. dictionary[XcodeBlueprintLocationsKey] = [ repoId: [ XcodeBranchIdentifierKey: branch, @@ -110,54 +167,47 @@ public class SourceControlBlueprint : XcodeServerEntity { XcodeBlueprintLocationTypeKey: "DVTSourceControlBranch" //TODO: add more types? ] ] - - //primary remote repo - dictionary[XcodeBlueprintPrimaryRemoteRepositoryKey] = repoId - //working copy states? - dictionary[XcodeBlueprintWorkingCopyStatesKey] = [ - repoId: 0 + //once XCS checks out your repo, it also needs to know how to get to your working copy, in case + //you have a complicated multiple-folder repo setup. coming from the repo's root, for us it's + //something like "XcodeServerSDK/" + dictionary[XcodeBlueprintWorkingCopyPathsKey] = [ + repoId: workingCopyPath ] - //blueprint identifier - dictionary[XcodeBlueprintIdentifierKey] = NSUUID().UUIDString + //once we're in our working copy, we need to know which Xcode project/workspace to use! + //this is relative to the working copy above. all coming together, huh? here + //it would be "XcodeServerSDK.xcworkspace" + dictionary[XcodeBlueprintRelativePathToProjectKey] = relativePathToProject - //all remote repos - dictionary[XcodeBlueprintRemoteRepositoriesKey] = [ - [ - XcodeBlueprintRemoteRepositoryURLKey: remoteUrl, - XcodeBlueprintRemoteRepositorySystemKey: "com.apple.dt.Xcode.sourcecontrol.Git", //TODO: add more SCMs - XcodeBlueprintRemoteRepositoryIdentifierKey: repoId - ] - ] + //now we've given it all we knew. what else? - //working copy paths - dictionary[XcodeBlueprintWorkingCopyPathsKey] = [ - repoId: workingCopyPath - ] + //turns out there are a couple more keys that XCS needs to be happy. so let's feed the beast. - //blueprint name + //every nice data structure needs a name. so give the blueprint one as well. this is usually + //the same as the name of your project, "XcodeServerSDK" in our case here dictionary[XcodeBlueprintNameKey] = blueprintName - //blueprint version - dictionary[XcodeBlueprintVersion] = 203 //magic number again + //just feed the beast, ok? this has probably something to do with working copy state, git magic. + //we pass 0. don't ask. + dictionary[XcodeBlueprintWorkingCopyStatesKey] = [ + repoId: 0 + ] - //path from working copy to project - dictionary[XcodeBlueprintRelativePathToProjectKey] = relativePathToProject + //and to uniquely identify this beauty, we also need to give it a UUID. well, technically I think + //Xcode generates a hash from the data somehow, but passing in a random UUID works as well, so what the hell. + //if someone figures out how to generate the same ID as Xcode does, I'm all yours. + //TODO: give this a good investigation. + dictionary[XcodeBlueprintIdentifierKey] = NSUUID().UUIDString - //repo authentication - dictionary[XcodeRepositoryAuthenticationStrategiesKey] = [ - repoId: [ - XcodeRepoAuthenticationTypeKey: XcodeRepoSSHKeysAuthenticationStrategy, - XcodeRepoUsernameKey: "git", //TODO: see how to add https support? - XcodeRepoPasswordKey: sshPassphrase, //this is where the passphrase goes - XcodeRepoAuthenticationStrategiesKey: sshPrivateKey, - XcodeRepoPublicKeyDataKey: sshPublicKey - ] - ] + //and this is the end of our journey to create a new Blueprint. I hope you enjoyed the ride, please return the 3D glasses to the green bucket on your way out. return dictionary - + } + + public override func dictionarify() -> NSDictionary { + + return self.dictionarifyForBotCreation() } } diff --git a/XcodeServerSDK/Server Helpers/XcodeServerConstants.swift b/XcodeServerSDK/Server Helpers/XcodeServerConstants.swift index c12a499..678d856 100644 --- a/XcodeServerSDK/Server Helpers/XcodeServerConstants.swift +++ b/XcodeServerSDK/Server Helpers/XcodeServerConstants.swift @@ -29,6 +29,8 @@ let XcodeBlueprintLocationTypeKey = "DVTSourceControlWorkspaceBlueprintLocationT let XcodeBlueprintRemoteRepositoryURLKey = "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" let XcodeBlueprintRemoteRepositorySystemKey = "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" let XcodeBlueprintRemoteRepositoryIdentifierKey = "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" +let XcodeBlueprintRemoteRepositoryCertFingerprintKey = "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustedCertFingerprintKey" +let XcodeBlueprintRemoteRepositoryTrustSelfSignedCertKey = "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustSelfSignedCertKey" //repo let XcodeRepoUsernameKey = "DVTSourceControlWorkspaceBlueprintRemoteRepositoryUsernameKey" diff --git a/XcodeServerSDK/Utils/ContainerExtensions.swift b/XcodeServerSDK/Utils/ContainerExtensions.swift new file mode 100644 index 0000000..794e2f9 --- /dev/null +++ b/XcodeServerSDK/Utils/ContainerExtensions.swift @@ -0,0 +1,45 @@ +// +// ContainerExtensions.swift +// XcodeServerSDK +// +// Created by Honza Dvorsky on 21/06/2015. +// Copyright © 2015 Honza Dvorsky. All rights reserved. +// + +import Foundation + +extension SequenceType { + + func mapThrows(@noescape transform: (Self.Generator.Element) throws -> T) rethrows -> [T] { + + var out: [T] = [] + for i in self { + out.append(try transform(i)) + } + return out + } + + func filterThrows(@noescape includeElement: (Self.Generator.Element) throws -> Bool) rethrows -> [Self.Generator.Element] { + + var out: [Self.Generator.Element] = [] + for i in self { + if try includeElement(i) { + out.append(i) + } + } + return out + } + + /** + Basically `filter` that stops when it finds the first one. + */ + func findFirst(@noescape test: (Self.Generator.Element) -> Bool) -> Self.Generator.Element? { + + for i in self { + if test(i) { + return i + } + } + return nil + } +} \ No newline at end of file diff --git a/XcodeServerSDK/XcodeServer.swift b/XcodeServerSDK/XcodeServer.swift index d53f72f..76b7c32 100644 --- a/XcodeServerSDK/XcodeServer.swift +++ b/XcodeServerSDK/XcodeServer.swift @@ -53,17 +53,17 @@ extension XcodeServer : NSURLSessionDelegate { switch challenge.protectionSpace.authenticationMethod { - case NSURLAuthenticationMethodServerTrust: - credential = NSURLCredential(forTrust: challenge.protectionSpace.serverTrust!) - default: - credential = self.credential ?? session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace) + case NSURLAuthenticationMethodServerTrust: + credential = NSURLCredential(forTrust: challenge.protectionSpace.serverTrust!) + default: + credential = self.credential ?? session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace) } if credential != nil { disposition = .UseCredential } } - + completionHandler(disposition, credential) } } @@ -137,7 +137,18 @@ public extension XcodeServer { return } - completion(response: response, body: body, error: error) + if case (200...299) = r.statusCode { + //pass on + completion(response: response, body: body, error: error) + } else { + //see if we haven't received a XCS failure in headers + if let xcsStatusMessage = r.allHeaderFields["X-XCSResponse-Status-Message"] as? String { + let e = Error.withInfo(xcsStatusMessage) + completion(response: response, body: body, error: e) + } else { + completion(response: response, body: body, error: error) + } + } }) } else { @@ -186,24 +197,89 @@ public extension XcodeServer { completion(success: false, error: Error.withInfo("Nil response")) } } + + public enum CreateBotResponse { + case Success(bot: Bot) + case BlueprintNeedsFixing(fixedBlueprint: SourceControlBlueprint) + case Error(error: ErrorType) + } + + private func replacePlaceholderPlatformInBot(bot: Bot, platforms: [DevicePlatform]) { + + if let filter = bot.configuration.deviceSpecification.filters.first { + let intendedPlatform = filter.platform + if let platform = platforms.findFirst({ $0.type == intendedPlatform.type }) { + //replace + filter.platform = platform + } else { + fatalError("Couldn't find intended platform in list of platforms: \(platforms)!") + } + } else { + fatalError("Couldn't find device filter!") + } + } + + /** + Creates a new Bot from the passed in information. First validates Bot's Blueprint to make sure + that the credentials are sufficient to access the repository and that the communication between + the client and XCS will work fine. This might take a couple of seconds, depending on your proximity + to your XCS. + */ + public func createBot(botOrder: Bot, completion: (response: CreateBotResponse) -> ()) { + + //first validate Blueprint + let blueprint = botOrder.configuration.sourceControlBlueprint + self.verifyGitCredentialsFromBlueprint(blueprint) { (response) -> () in + + switch response { + case .Error(let error): + completion(response: XcodeServer.CreateBotResponse.Error(error: error)) + return + case .SSHFingerprintFailedToVerify(let fingerprint, _): + blueprint.certificateFingerprint = fingerprint + completion(response: XcodeServer.CreateBotResponse.BlueprintNeedsFixing(fixedBlueprint: blueprint)) + return + case .Success(_, _): break + } - public func createBot(botOrder: Bot, completion: (bot: Bot?, error: NSError?) -> ()) { + //blueprint verified, continue creating our new bot + + //next, we need to fetch all the available platforms and pull out the one intended for this bot. (TODO: this could probably be sped up by smart caching) + self.getPlatforms({ (platforms, error) -> () in + + if let error = error { + completion(response: XcodeServer.CreateBotResponse.Error(error: error)) + return + } + + //we have platforms, find the one in the bot config and replace it + self.replacePlaceholderPlatformInBot(botOrder, platforms: platforms!) + + //cool, let's do it. + self.createBotNoValidation(botOrder, completion: completion) + }) + } + } + + private func createBotNoValidation(botOrder: Bot, completion: (response: CreateBotResponse) -> ()) { let body: NSDictionary = botOrder.dictionarify() self.sendRequestWithMethod(.POST, endpoint: .Bots, params: nil, query: nil, body: body) { (response, body, error) -> () in - - if error != nil { - completion(bot: nil, error: error) + + if let error = error { + completion(response: XcodeServer.CreateBotResponse.Error(error: error)) return } - if let body = body as? NSDictionary { - let bot = Bot(json: body as NSDictionary) - completion(bot: bot, error: nil) - } else { - completion(bot: nil, error: Error.withInfo("Wrong body \(body)")) + guard let dictBody = body as? NSDictionary else { + let e = Error.withInfo("Wrong body \(body)") + completion(response: XcodeServer.CreateBotResponse.Error(error: e)) + return } + + let bot = Bot(json: dictBody) + completion(response: XcodeServer.CreateBotResponse.Success(bot: bot)) } } @@ -237,7 +313,7 @@ public extension XcodeServer { ] self.sendRequestWithMethod(.DELETE, endpoint: .Bots, params: params, query: nil, body: nil) { (response, body, error) -> () in - + if error != nil { completion(success: false, error: error) return @@ -280,7 +356,7 @@ public extension XcodeServer { ] self.sendRequestWithMethod(.GET, endpoint: .Integrations, params: params, query: query, body: nil) { (response, body, error) -> () in - + if error != nil { completion(integrations: nil, error: error) return @@ -296,7 +372,7 @@ public extension XcodeServer { } /** - AKA "Integrate this bot now" + AKA "Integrate this bot now" :param: botId MUST BE the full bot.id, cannot be bot.tinyId! */ @@ -360,7 +436,7 @@ public extension XcodeServer { public func getUserCanCreateBots(completion: (canCreateBots: Bool, error: NSError?) -> ()) { self.sendRequestWithMethod(.GET, endpoint: .UserCanCreateBots, params: nil, query: nil, body: nil) { (response, body, error) -> () in - + if let error = error { completion(canCreateBots: false, error: error) return @@ -378,9 +454,154 @@ public extension XcodeServer { } } -// public func reportQueueSizeAndEstimatedWaitingTime(integration: Integration, completion: ((queueSize: Int, estWait: Double), NSError?) -> ()) { + public func getPlatforms(completion: (platforms: [DevicePlatform]?, error: NSError?) -> ()) { + + self.sendRequestWithMethod(.GET, endpoint: .Platforms, params: nil, query: nil, body: nil) { (response, body, error) -> () in + + if error != nil { + completion(platforms: nil, error: error) + return + } + + if let array = (body as? NSDictionary)?["results"] as? NSArray { + let platforms: [DevicePlatform] = XcodeServerArray(array) + completion(platforms: platforms, error: error) + } else { + completion(platforms: nil, error: Error.withInfo("Wrong body \(body)")) + } + } + } + + //more advanced + + /** + Checks whether the current user has the rights to create bots and perform other similar "write" actions. + Xcode Server offers two tiers of users, ones for reading only ("viewers") and others for management. + Here we check the current user can manage XCS, which is useful for projects like Buildasaur. + */ + public func verifyXCSUserCanCreateBots(completion: (success: Bool, error: NSError?) -> ()) { + + //the way we check availability is first by logging out (does nothing if not logged in) and then + //calling getUserCanCreateBots, which, if necessary, automatically authenticates with Basic auth before resolving to true or false in JSON. + + self.logout { (success, error) -> () in + + if let error = error { + completion(success: false, error: error) + return + } + + self.getUserCanCreateBots { (canCreateBots, error) -> () in + + if let error = error { + completion(success: false, error: error) + return + } + + completion(success: canCreateBots, error: nil) + } + } + } + + /** + Verifies that the blueprint contains valid Git credentials and that the blueprint contains a valid + server certificate fingerprint for client <-> XCS communication. + */ + public func verifyGitCredentialsFromBlueprint(blueprint: SourceControlBlueprint, completion: (response: SCMBranchesResponse) -> ()) { + + //just a proxy with a more explicit name + self.postSCMBranchesWithBlueprint(blueprint, completion: completion) + } + + public enum SCMBranchesResponse { + case Error(ErrorType) + case SSHFingerprintFailedToVerify(fingerprint: String, repository: String) + + //the valid blueprint will have the right certificateFingerprint + case Success(branches: [(name: String, isPrimary: Bool)], validBlueprint: SourceControlBlueprint) + } + + public func postSCMBranchesWithBlueprint(blueprint: SourceControlBlueprint, completion: (response: SCMBranchesResponse) -> ()) { + + let blueprintDict = blueprint.dictionarifyRemoteAndCredentials() + + self.sendRequestWithMethod(.POST, endpoint: .SCM_Branches, params: nil, query: nil, body: blueprintDict) { (response, body, error) -> () in + + if let error = error { + completion(response: XcodeServer.SCMBranchesResponse.Error(error)) + return + } + + guard let responseObject = body as? NSDictionary else { + let e = Error.withInfo("Wrong body: \(body)") + completion(response: XcodeServer.SCMBranchesResponse.Error(e)) + return + } + + //take the primary repository's key. XCS officially supports multiple checkouts (submodules) + let primaryRepoId = blueprint.projectWCCIdentifier + + //communication worked, now let's see what we got + //check for errors first + if + let repoErrors = responseObject["repositoryErrors"] as? [NSDictionary], + let repoErrorWrap = repoErrors.findFirst({ $0["repository"] as? String == primaryRepoId }), + let repoError = repoErrorWrap["error"] as? NSDictionary + where repoErrors.count > 0 { + + if let code = repoError["code"] as? Int { + + //ok, we got an error. do we recognize it? + switch code { + case -1004: + //ok, this is failed fingerprint validation + //pull out the new fingerprint and complete. + if let fingerprint = repoError["fingerprint"] as? String { + + //optionally offer to resolve this issue by adopting the new fingerprint + if self.config.automaticallyTrustSelfSignedCertificates { + + blueprint.certificateFingerprint = fingerprint + self.postSCMBranchesWithBlueprint(blueprint, completion: completion) + return + + } else { + completion(response: XcodeServer.SCMBranchesResponse.SSHFingerprintFailedToVerify(fingerprint: fingerprint, repository: primaryRepoId)) + } + + } else { + completion(response: XcodeServer.SCMBranchesResponse.Error(Error.withInfo("No fingerprint provided in error \(repoError)"))) + } + + default: + completion(response: XcodeServer.SCMBranchesResponse.Error(Error.withInfo("Unrecognized error: \(repoError)"))) + } + } else { + completion(response: XcodeServer.SCMBranchesResponse.Error(Error.withInfo("No code provided in error \(repoError)"))) + } + return + } + + //cool, no errors. now try to parse branches! + guard + let branchesAllRepos = responseObject["branches"] as? NSDictionary, + let branches = branchesAllRepos[primaryRepoId] as? NSArray else { + + completion(response: XcodeServer.SCMBranchesResponse.Error(Error.withInfo("No branches provided for our primary repo id: \(primaryRepoId)."))) + return + } + + //cool, we gots ourselves some branches, let's parse 'em + let parsedBranches = branches.map({ (name: $0["name"] as! String, isPrimary: $0["primary"] as! Bool) }) + completion(response: XcodeServer.SCMBranchesResponse.Success(branches: parsedBranches, validBlueprint: blueprint)) + } + } + + + + // public func reportQueueSizeAndEstimatedWaitingTime(integration: Integration, completion: ((queueSize: Int, estWait: Double), NSError?) -> ()) { //TODO: we need to call getIntegrations() -> filter pending and running Integrations -> get unique bots of these integrations -> query for the average integration time of each bot -> estimate, based on the pending/running integrations, how long it will take for the passed in integration to finish -// } + // } } diff --git a/XcodeServerSDK/XcodeServerConfig.swift b/XcodeServerSDK/XcodeServerConfig.swift index c1e9b21..1db0e4e 100644 --- a/XcodeServerSDK/XcodeServerConfig.swift +++ b/XcodeServerSDK/XcodeServerConfig.swift @@ -32,6 +32,9 @@ public class XcodeServerConfig : JSONSerializable { public let password: String? public let port: Int = 20343 + //if set to false, fails if server certificate is not trusted yet + public let automaticallyTrustSelfSignedCertificates: Bool = true + public var availabilityState: AvailabilityCheckState = .Unchecked public func jsonify() -> NSDictionary { diff --git a/XcodeServerSDK/XcodeServerEndpoints.swift b/XcodeServerSDK/XcodeServerEndpoints.swift index ebc890a..12498e2 100644 --- a/XcodeServerSDK/XcodeServerEndpoints.swift +++ b/XcodeServerSDK/XcodeServerEndpoints.swift @@ -18,6 +18,8 @@ public class XcodeServerEndPoints { case Devices case Login case Logout + case Platforms + case SCM_Branches } let serverConfig: XcodeServerConfig @@ -39,61 +41,71 @@ public class XcodeServerEndPoints { switch endpoint { - case .Bots: - - let bots = "\(base)/bots" - if let bot = params?["bot"] { - let bot = "\(bots)/\(bot)" - if let rev = params?["rev"] { - let rev = "\(bot)/\(rev)" - return rev - } - return bot - } - return bots - - case .Integrations: - - if let _ = params?["bot"] { - //gets a list of integrations for this bot - let bots = self.endpointURL(.Bots, params: params) - return "\(bots)/integrations" - } - - let integrations = "\(base)/integrations" - if let integration = params?["integration"] { - - let oneIntegration = "\(integrations)/\(integration)" - return oneIntegration + case .Bots: + + let bots = "\(base)/bots" + if let bot = params?["bot"] { + let bot = "\(bots)/\(bot)" + if let rev = params?["rev"] { + let rev = "\(bot)/\(rev)" + return rev } - return integrations - - case .CancelIntegration: - - let integration = self.endpointURL(.Integrations, params: params) - let cancel = "\(integration)/cancel" - return cancel - - case .Devices: - - let devices = "\(base)/devices" - return devices - - case .UserCanCreateBots: - - let users = "\(base)/auth/isBotCreator" - return users - - case .Login: - - let login = "\(base)/auth/login" - return login - - case .Logout: - - let logout = "\(base)/auth/logout" - return logout + return bot + } + return bots + + case .Integrations: + + if let _ = params?["bot"] { + //gets a list of integrations for this bot + let bots = self.endpointURL(.Bots, params: params) + return "\(bots)/integrations" + } + + let integrations = "\(base)/integrations" + if let integration = params?["integration"] { + let oneIntegration = "\(integrations)/\(integration)" + return oneIntegration + } + return integrations + + case .CancelIntegration: + + let integration = self.endpointURL(.Integrations, params: params) + let cancel = "\(integration)/cancel" + return cancel + + case .Devices: + + let devices = "\(base)/devices" + return devices + + case .UserCanCreateBots: + + let users = "\(base)/auth/isBotCreator" + return users + + case .Login: + + let login = "\(base)/auth/login" + return login + + case .Logout: + + let logout = "\(base)/auth/logout" + return logout + + case .Platforms: + + let platforms = "\(base)/platforms" + return platforms + + case .SCM_Branches: + + let branches = "\(base)/scm/branches" + return branches + } } diff --git a/XcodeServerSDK/XcodeServerEntity.swift b/XcodeServerSDK/XcodeServerEntity.swift index c50c468..6a8a2e5 100644 --- a/XcodeServerSDK/XcodeServerEntity.swift +++ b/XcodeServerSDK/XcodeServerEntity.swift @@ -18,18 +18,23 @@ public class XcodeServerEntity : XcodeRead { public let rev: String! public let tinyID: String! + //when created from json, let's save the original data here. + public let originalJSON: NSDictionary? + //initializer which takes a dictionary and fills in values for recognized keys public required init(json: NSDictionary) { self.id = json.optionalStringForKey("_id") self.rev = json.optionalStringForKey("_rev") self.tinyID = json.optionalStringForKey("tinyID") + self.originalJSON = json.copy() as? NSDictionary } public init() { self.id = nil self.rev = nil self.tinyID = nil + self.originalJSON = nil } public func dictionarify() -> NSDictionary { diff --git a/XcodeServerSDKTests/BotConfigurationTests.swift b/XcodeServerSDKTests/BotConfigurationTests.swift index e6f5be3..690152b 100644 --- a/XcodeServerSDKTests/BotConfigurationTests.swift +++ b/XcodeServerSDKTests/BotConfigurationTests.swift @@ -40,48 +40,49 @@ class BotConfigurationTests: XCTestCase { // MARK: Testing destination tests func testTestingDestinationToString() { - var destination: BotConfiguration.TestingDestinationIdentifier +// var destination: BotConfiguration.TestingDestinationIdentifier - destination = .iOS_AllDevicesAndSimulators - XCTAssertEqual(destination.toString(), "iOS: All Devices and Simulators") - - destination = .iOS_AllDevices - XCTAssertEqual(destination.toString(), "iOS: All Devices") - - destination = .iOS_AllSimulators - XCTAssertEqual(destination.toString(), "iOS: All Simulators") - - destination = .iOS_SelectedDevicesAndSimulators - XCTAssertEqual(destination.toString(), "iOS: Selected Devices and Simulators") - - destination = .Mac - XCTAssertEqual(destination.toString(), "Mac") - - destination = .AllCompatible - XCTAssertEqual(destination.toString(), "All Compatible (Mac + iOS)") + //TODO: being moved to DeviceSpecification +// destination = .iOS_AllDevicesAndSimulators +// XCTAssertEqual(destination.toString(), "iOS: All Devices and Simulators") +// +// destination = .iOS_AllDevices +// XCTAssertEqual(destination.toString(), "iOS: All Devices") +// +// destination = .iOS_AllSimulators +// XCTAssertEqual(destination.toString(), "iOS: All Simulators") +// +// destination = .iOS_SelectedDevicesAndSimulators +// XCTAssertEqual(destination.toString(), "iOS: Selected Devices and Simulators") +// +// destination = .Mac +// XCTAssertEqual(destination.toString(), "Mac") +// +// destination = .AllCompatible +// XCTAssertEqual(destination.toString(), "All Compatible (Mac + iOS)") } func testAllowedDevicesTypes() { - let allCompatible = BotConfiguration.TestingDestinationIdentifier.AllCompatible - let selected = BotConfiguration.TestingDestinationIdentifier.iOS_SelectedDevicesAndSimulators - let allDevicesAndSimulators = BotConfiguration.TestingDestinationIdentifier.iOS_AllDevicesAndSimulators - let allDevices = BotConfiguration.TestingDestinationIdentifier.iOS_AllDevices - let allSimulators = BotConfiguration.TestingDestinationIdentifier.iOS_AllSimulators - let mac = BotConfiguration.TestingDestinationIdentifier.Mac +// let allCompatible = BotConfiguration.TestingDestinationIdentifier.AllCompatible +// let selected = BotConfiguration.TestingDestinationIdentifier.iOS_SelectedDevicesAndSimulators +// let allDevicesAndSimulators = BotConfiguration.TestingDestinationIdentifier.iOS_AllDevicesAndSimulators +// let allDevices = BotConfiguration.TestingDestinationIdentifier.iOS_AllDevices +// let allSimulators = BotConfiguration.TestingDestinationIdentifier.iOS_AllSimulators +// let mac = BotConfiguration.TestingDestinationIdentifier.Mac - let allCompatibleExpected: [BotConfiguration.DeviceType] = [.iPhone, .Simulator, .Mac] - let selectedExpected: [BotConfiguration.DeviceType] = [.iPhone, .Simulator] - let allDevicesAndSimulatorsExpected: [BotConfiguration.DeviceType] = [.iPhone, .Simulator] - let allDevicesExpected: [BotConfiguration.DeviceType] = [.iPhone] - let allSimulatorsExpected: [BotConfiguration.DeviceType] = [.Simulator] - let macExpected: [BotConfiguration.DeviceType] = [.Mac] +// let allCompatibleExpected: [BotConfiguration.DeviceType] = [.iPhone, .Simulator, .Mac] +// let selectedExpected: [BotConfiguration.DeviceType] = [.iPhone, .Simulator] +// let allDevicesAndSimulatorsExpected: [BotConfiguration.DeviceType] = [.iPhone, .Simulator] +// let allDevicesExpected: [BotConfiguration.DeviceType] = [.iPhone] +// let allSimulatorsExpected: [BotConfiguration.DeviceType] = [.Simulator] +// let macExpected: [BotConfiguration.DeviceType] = [.Mac] - XCTAssertEqual(allCompatible.allowedDeviceTypes(), allCompatibleExpected) - XCTAssertEqual(selected.allowedDeviceTypes(), selectedExpected) - XCTAssertEqual(allDevices.allowedDeviceTypes(), allDevicesExpected) - XCTAssertEqual(allSimulators.allowedDeviceTypes(), allSimulatorsExpected) - XCTAssertEqual(allDevicesAndSimulators.allowedDeviceTypes(), allDevicesAndSimulatorsExpected) - XCTAssertEqual(mac.allowedDeviceTypes(), macExpected) +// XCTAssertEqual(allCompatible.allowedDeviceTypes(), allCompatibleExpected) +// XCTAssertEqual(selected.allowedDeviceTypes(), selectedExpected) +// XCTAssertEqual(allDevices.allowedDeviceTypes(), allDevicesExpected) +// XCTAssertEqual(allSimulators.allowedDeviceTypes(), allSimulatorsExpected) +// XCTAssertEqual(allDevicesAndSimulators.allowedDeviceTypes(), allDevicesAndSimulatorsExpected) +// XCTAssertEqual(mac.allowedDeviceTypes(), macExpected) } } diff --git a/XcodeServerSDKTests/BotParsingTests.swift b/XcodeServerSDKTests/BotParsingTests.swift index 83efc6c..40547d5 100644 --- a/XcodeServerSDKTests/BotParsingTests.swift +++ b/XcodeServerSDKTests/BotParsingTests.swift @@ -7,70 +7,84 @@ // import Foundation -import XCTest import XcodeServerSDK +import DVR +import XCTest class BotParsingTests: XCTestCase { //MARK: shared stuff - func testShared() { - - let bot = self.botInFileWithName("bot_mac_xcode6") - - XCTAssertEqual(bot.id, "6b3de48352a8126ce7e08ecf85093613") - XCTAssertEqual(bot.rev, "16-d1e9e3d7e76a09381ca909d47ac6c18d") - XCTAssertEqual(bot.tinyID, "2CA4EA9") - } - //MARK: bot - func testBot() { + func testParseOSXBot() { - let bot = self.botInFileWithName("bot_mac_xcode6") + let exp = self.expectationWithDescription("Network") + let server = self.getRecordingXcodeServer("osx_bot") - XCTAssertEqual(bot.name, "Builda Archiver") - XCTAssertEqual(bot.integrationsCount, 7) - } - - //MARK: configuration - func testConfiguration() { - - let configuration = self.configurationFromBotWithName("bot_mac_xcode6") + server.getBot("963bc95f1c1a56f69f3392b4aa03302f") { (bots, error) in + exp.fulfill() + } - XCTAssertEqual(configuration.test, true) - XCTAssertEqual(configuration.analyze, true) - XCTAssertEqual(configuration.archive, true) - XCTAssertEqual(configuration.schemeName, "Buildasaur") - } - - //MARK: cleaning policy - func testCleanPolicy() { - //TODO: will be a whole set of tests, add all possible cases - } - - //MARK: test schedule - func testSchedule() { - //TODO: will be a whole set of tests, add all possible cases - } - - //MARK: blueprint (good luck with this one) - func testBlueprint() { - //TODO: will be a whole set of tests, add all possible cases + self.waitForExpectationsWithTimeout(10, handler: nil) } - //MARK: destination type - func testDestinationType() { - //TODO: will be a whole set of tests, add all possible cases + func testShared() { + + let bot = self.botInCassetteWithName("osx_bot") + + XCTAssertEqual(bot.id, "963bc95f1c1a56f69f3392b4aa03302f") + XCTAssertEqual(bot.rev, "10-117b73f201ea103229a2e8cd26a01845") + XCTAssertEqual(bot.tinyID, "4807518") } - //MARK: triggers - func testTriggers() { - //TODO: will be a whole set of tests, add all possible cases - } + //MARK: bot +// func testBot() { +// +// let bot = self.botInFileWithName("bot_mac_xcode6") +// +// XCTAssertEqual(bot.name, "Builda Archiver") +// XCTAssertEqual(bot.integrationsCount, 7) +// } +// +// //MARK: configuration +// func testConfiguration() { +// +// let configuration = self.configurationFromBotWithName("bot_mac_xcode6") +// +// XCTAssertEqual(configuration.test, true) +// XCTAssertEqual(configuration.analyze, true) +// XCTAssertEqual(configuration.archive, true) +// XCTAssertEqual(configuration.schemeName, "Buildasaur") +// } - //MARK: testing device ids (on both Xcode 6 and 7 formats!!!) - func testTestingDeviceIds() { - //TODO: will be a whole set of tests, add all possible cases - } + //MARK: cleaning policy +// func testCleanPolicy() { +// //TODO: will be a whole set of tests, add all possible cases +// } +// +// //MARK: test schedule +// func testSchedule() { +// //TODO: will be a whole set of tests, add all possible cases +// } +// +// //MARK: blueprint (good luck with this one) +// func testBlueprint() { +// //TODO: will be a whole set of tests, add all possible cases +// } +// +// //MARK: destination type +// func testDestinationType() { +// //TODO: will be a whole set of tests, add all possible cases +// } +// +// //MARK: triggers +// func testTriggers() { +// //TODO: will be a whole set of tests, add all possible cases +// } +// +// //MARK: testing device ids (on both Xcode 6 and 7 formats!!!) +// func testTestingDeviceIds() { +// //TODO: will be a whole set of tests, add all possible cases +// } } diff --git a/XcodeServerSDKTests/Casettes/osx_bot.json b/XcodeServerSDKTests/Casettes/osx_bot.json new file mode 100644 index 0000000..3e7beb8 --- /dev/null +++ b/XcodeServerSDKTests/Casettes/osx_bot.json @@ -0,0 +1,192 @@ +{ + "interactions" : [ + { + "recorded_at" : 1435487010.432587, + "response" : { + "body" : { + "_id" : "963bc95f1c1a56f69f3392b4aa03302f", + "tinyID" : "4807518", + "_rev" : "10-117b73f201ea103229a2e8cd26a01845", + "requiresUpgrade" : false, + "integration_counter" : 4, + "lastRevisionBlueprint" : { + "DVTSourceControlWorkspaceBlueprintLocationsKey" : { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" : { + "DVTSourceControlBranchIdentifierKey" : "hd\/tested_devices_xcode_7", + "DVTSourceControlLocationRevisionKey" : "f33492a458777330edcac4c77adbb18d3ba7f1f8", + "DVTSourceControlBranchOptionsKey" : 50, + "DVTSourceControlWorkspaceBlueprintLocationTypeKey" : "DVTSourceControlBranch" + } + }, + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "71FFDDA2-4586-4EE9-AEF2-C798E9E45028", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" : "XcodeServerSDK\/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey" : "XcodeServerSDK", + "DVTSourceControlWorkspaceBlueprintVersion" : 203, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "XcodeServerSDK.xcworkspace", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:czechboy0\/XcodeServerSDK.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" + } + ] + }, + "configuration" : { + "builtFromClean" : 0, + "periodicScheduleInterval" : 1, + "codeCoveragePreference" : 2, + "performsTestAction" : true, + "triggers" : [ + { + "phase" : 1, + "scriptBody" : "echo \"Run before\"\ncarthage update --no-build", + "type" : 1, + "name" : "Run Script" + }, + { + "phase" : 2, + "scriptBody" : "echo \"Run after\"", + "type" : 1, + "name" : "Run Script", + "conditions" : { + "status" : 2, + "onWarnings" : true, + "onBuildErrors" : true, + "onInternalErrors" : true, + "onAnalyzerWarnings" : true, + "onFailingTests" : true, + "onSuccess" : true + } + }, + { + "phase" : 2, + "scriptBody" : "", + "emailConfiguration" : { + "includeCommitMessages" : true, + "additionalRecipients" : [ + "email@committers.yo" + ], + "emailCommitters" : true, + "scmOptions" : { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" : true + }, + "includeIssueDetails" : true + }, + "type" : 2, + "name" : "Send Email Notification", + "conditions" : { + "status" : 2, + "onWarnings" : true, + "onBuildErrors" : true, + "onInternalErrors" : true, + "onAnalyzerWarnings" : true, + "onFailingTests" : true, + "onSuccess" : false + } + } + ], + "performsAnalyzeAction" : true, + "schemeName" : "XcodeServerSDK - OS X", + "exportsProductFromArchive" : true, + "testingDeviceIDs" : [ + + ], + "deviceSpecification" : { + "filters" : [ + { + "platform" : { + "buildNumber" : "15A204f", + "_id" : "a85553a5b26a7c1a4998f3b237000b18", + "_rev" : "12-b005bffe3337cfe101fd597c300b0208", + "displayName" : "OS X", + "identifier" : "com.apple.platform.macosx", + "version" : "1.1" + }, + "filterType" : 0, + "architectureType" : 1 + } + ], + "deviceIdentifiers" : [ + + ] + }, + "weeklyScheduleDay" : 0, + "minutesAfterHourToIntegrate" : 0, + "scheduleType" : 1, + "hourOfIntegration" : 0, + "performsArchiveAction" : true, + "sourceControlBlueprint" : { + "DVTSourceControlWorkspaceBlueprintLocationsKey" : { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" : { + "DVTSourceControlBranchIdentifierKey" : "hd\/tested_devices_xcode_7", + "DVTSourceControlBranchOptionsKey" : 214, + "DVTSourceControlWorkspaceBlueprintLocationTypeKey" : "DVTSourceControlBranch" + } + }, + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { + + }, + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey" : { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" : { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey" : "DVTSourceControlAuthenticationStrategy" + } + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" : 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "92561A51-010F-495B-8ED4-93087A6A8F5B", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" : "XcodeServerSDK\/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey" : "XcodeServerSDK", + "DVTSourceControlWorkspaceBlueprintVersion" : 203, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "XcodeServerSDK.xcworkspace", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustSelfSignedCertKey" : true, + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:czechboy0\/XcodeServerSDK.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustedCertFingerprintKey" : "1627ACA576282D36631B564DEBDFA648", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" + } + ] + }, + "testingDestinationType" : 7 + }, + "group" : { + "name" : "2FDD3BEB-D750-47EE-B386-07EA9BABA98B" + }, + "type" : 1, + "name" : "Default OS X Bot", + "doc_type" : "bot" + }, + "body_format" : "json", + "status" : 200, + "url" : "https:\/\/127.0.0.1:20343\/api\/bots\/963bc95f1c1a56f69f3392b4aa03302f", + "headers" : { + "Connection" : "keep-alive", + "Content-Type" : "application\/json", + "Transfer-Encoding" : "Identity", + "Date" : "Sun, 28 Jun 2015 10:23:30 GMT", + "Content-Encoding" : "gzip", + "X-XCSResponse-Status-Title" : "OK", + "Keep-Alive" : "timeout=5; max=100", + "X-XCSAPIVersion" : "3", + "Vary" : "Accept-Encoding" + } + }, + "request" : { + "method" : "GET", + "url" : "https:\/\/127.0.0.1:20343\/api\/bots\/963bc95f1c1a56f69f3392b4aa03302f", + "headers" : { + "Authorization" : "Basic SUNhbkNyZWF0ZUJvdHM6c3VwZXJTZWNyM3Q=" + } + } + } + ], + "name" : "osx_bot" +} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/bot_ios_xcode7.json b/XcodeServerSDKTests/Data/bot_ios_xcode7.json deleted file mode 100644 index 21745d8..0000000 --- a/XcodeServerSDKTests/Data/bot_ios_xcode7.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_id": "ef18f96409a205451df8a5b9c4031ad5", - "_rev": "4-820c802765bb118721d8ca48e925e977", - "group": { - "name": "F05D9D16-FAE3-4066-9909-08FAE0C69018" - }, - "configuration": { - "builtFromClean": 0, - "periodicScheduleInterval": 1, - "codeCoveragePreference": 2, - "performsTestAction": true, - "triggers": [], - "performsAnalyzeAction": true, - "schemeName": "HelloApp", - "exportsProductFromArchive": true, - "testingDeviceIDs": [], - "deviceSpecification": { - "filters": [ - { - "platform": { - "_id": "a85553a5b26a7c1a4998f3b237000da9", - "displayName": "iOS", - "_rev": "6-6628873592bccc61307b32bd7ea8dd83", - "simulatorIdentifier": "com.apple.platform.iphonesimulator", - "identifier": "com.apple.platform.iphoneos", - "buildNumber": "13A4254u", - "version": "9.0" - }, - "filterType": 3, - "architectureType": 0 - } - ], - "deviceIdentifiers": [ - "a85553a5b26a7c1a4998f3b237001c0e", - "a85553a5b26a7c1a4998f3b2370033f2", - "a85553a5b26a7c1a4998f3b237004afd" - ] - }, - "weeklyScheduleDay": 0, - "minutesAfterHourToIntegrate": 0, - "scheduleType": 1, - "hourOfIntegration": 0, - "performsArchiveAction": true, - "sourceControlBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "33B8ADDFBC86145BD26937EED8BB5679306D7042": { - "DVTSourceControlBranchIdentifierKey": "master", - "DVTSourceControlBranchOptionsKey": 214, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "33B8ADDFBC86145BD26937EED8BB5679306D7042", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey": {}, - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": { - "33B8ADDFBC86145BD26937EED8BB5679306D7042": { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy" - } - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey": { - "33B8ADDFBC86145BD26937EED8BB5679306D7042": 0 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "3275CCE1-A749-432A-83B5-CA57220827A0", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "33B8ADDFBC86145BD26937EED8BB5679306D7042": "HelloApp-iOS/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "HelloApp", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "HelloApp.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/HelloApp-iOS.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustedCertFingerprintKey": "1627ACA576282D36631B564DEBDFA648", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "33B8ADDFBC86145BD26937EED8BB5679306D7042", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustSelfSignedCertKey": true - } - ] - }, - "testingDestinationType": 0 - }, - "requiresUpgrade": false, - "name": "TESTBOT", - "type": 1, - "integration_counter": 2, - "doc_type": "bot", - "tinyID": "C4A26D6" -} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/bot_mac_xcode6.json b/XcodeServerSDKTests/Data/bot_mac_xcode6.json deleted file mode 100644 index 1bbde19..0000000 --- a/XcodeServerSDKTests/Data/bot_mac_xcode6.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_id": "6b3de48352a8126ce7e08ecf85093613", - "_rev": "16-d1e9e3d7e76a09381ca909d47ac6c18d", - "configuration": { - "builtFromClean": 1, - "periodicScheduleInterval": 0, - "performsTestAction": true, - "triggers": [], - "performsAnalyzeAction": true, - "schemeName": "Buildasaur", - "weeklyScheduleDay": 0, - "testingDeviceIDs": [], - "minutesAfterHourToIntegrate": 0, - "hourOfIntegration": 0, - "scheduleType": 3, - "performsArchiveAction": true, - "testingDestinationType": 7, - "sourceControlBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlBranchIdentifierKey": "master", - "DVTSourceControlBranchOptionsKey": 214, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey": {}, - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": { - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy" - } - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey": { - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": 0 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "B47BC98B-D5DC-4932-ADA1-E8F6DDC0D214", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": "Buildasaur/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "Buildasaur", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "Buildasaur.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/Buildasaur.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB" - } - ] - } - }, - "group": { - "name": "52C4BAE5-7A0E-40FB-BF7A-6A3B6BCCC9BE" - }, - "requiresUpgrade": false, - "name": "Builda Archiver", - "type": 1, - "integration_counter": 7, - "doc_type": "bot", - "tinyID": "2CA4EA9", - "lastRevisionBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlBranchIdentifierKey": "master", - "DVTSourceControlLocationRevisionKey": "709439d626342e8ec85f744e3b5ef761feeefa85", - "DVTSourceControlBranchOptionsKey": 50, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB", - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "14B834DA-0A39-4CBC-98B5-D0E98FAFA3E4", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": "Buildasaur" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "Buildasaur", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "Buildasaur.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/Buildasaur.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB" - } - ] - } -} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_manual_no_actions_clean_never_all_triggers.json b/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_manual_no_actions_clean_never_all_triggers.json deleted file mode 100644 index 4f245ee..0000000 --- a/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_manual_no_actions_clean_never_all_triggers.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "_id": "faaeae44305ec0eaf94134b66792ef54", - "_rev": "14-54ab137678d945f41ce62e5acf5666e4", - "group": { - "name": "8BB5C9C6-B762-4EAC-A4F6-837FA3DE45A0" - }, - "configuration": { - "builtFromClean": 0, - "periodicScheduleInterval": 0, - "performsTestAction": false, - "triggers": [ - { - "phase": 1, - "scriptBody": "cd Buildasaur\npod install", - "type": 1, - "name": "Run Script" - }, - { - "phase": 2, - "scriptBody": "", - "type": 2, - "name": "Notify Committers on Failure", - "conditions": { - "status": 2, - "onWarnings": true, - "onBuildErrors": true, - "onInternalErrors": false, - "onAnalyzerWarnings": true, - "onFailingTests": true, - "onSuccess": true - }, - "emailConfiguration": { - "includeCommitMessages": true, - "additionalRecipients": [ - "committer@hello.world", - "yo@mo.com" - ], - "emailCommitters": true, - "includeIssueDetails": true - } - }, - { - "phase": 2, - "scriptBody": "Sample Script After", - "type": 1, - "name": "Run Script", - "conditions": { - "status": 2, - "onWarnings": true, - "onBuildErrors": true, - "onInternalErrors": false, - "onAnalyzerWarnings": true, - "onFailingTests": true, - "onSuccess": true - } - } - ], - "performsAnalyzeAction": false, - "schemeName": "Buildasaur", - "weeklyScheduleDay": 0, - "testingDeviceIDs": [], - "minutesAfterHourToIntegrate": 0, - "hourOfIntegration": 0, - "scheduleType": 3, - "performsArchiveAction": false, - "testingDestinationType": 7, - "sourceControlBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlBranchIdentifierKey": "buildasaur", - "DVTSourceControlBranchOptionsKey": 214, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - }, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlBranchIdentifierKey": "master", - "DVTSourceControlBranchOptionsKey": 214, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey": {}, - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy" - }, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy" - } - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": 0, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": 0 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "48B2E98C-DA87-4B8A-8C5D-CB6FE328F7D2", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "Buildasaur-XcodeServerSDK/", - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": "Buildasaur/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "Buildasaur", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "Buildasaur.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/Buildasaur.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/XcodeServerSDK.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" - } - ] - } - }, - "requiresUpgrade": false, - "name": "TESTBOT", - "type": 1, - "integration_counter": 6, - "doc_type": "bot", - "tinyID": "45FC428", - "lastRevisionBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlBranchIdentifierKey": "master", - "DVTSourceControlLocationRevisionKey": "fe26453fe3776a76292b14e0b74d118d5ef7f0c5", - "DVTSourceControlBranchOptionsKey": 50, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - }, - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlBranchIdentifierKey": "buildasaur", - "DVTSourceControlLocationRevisionKey": "0278e79fe9a901e1a76e0996ef39511168417de7", - "DVTSourceControlBranchOptionsKey": 50, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB", - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "20F0A876-ADD9-4B51-918D-5B46EA5E6007", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": "Buildasaur/", - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "Buildasaur-XcodeServerSDK/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "Buildasaur", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "Buildasaur.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/Buildasaur.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/XcodeServerSDK.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" - } - ] - } -} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_oncommit_all_actions_clean_onceaweek.json b/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_oncommit_all_actions_clean_onceaweek.json deleted file mode 100644 index 7262c77..0000000 --- a/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_oncommit_all_actions_clean_onceaweek.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "_id": "faaeae44305ec0eaf94134b66792ef54", - "_rev": "15-799b7148f50625a7089c3cfc6b52e60d", - "group": { - "name": "8BB5C9C6-B762-4EAC-A4F6-837FA3DE45A0" - }, - "configuration": { - "builtFromClean": 3, - "periodicScheduleInterval": 0, - "performsTestAction": true, - "triggers": [ - { - "phase": 1, - "scriptBody": "cd Buildasaur\npod install", - "type": 1, - "name": "Run Script" - }, - { - "phase": 2, - "scriptBody": "", - "type": 2, - "name": "Notify Committers on Failure", - "conditions": { - "status": 2, - "onWarnings": true, - "onBuildErrors": true, - "onInternalErrors": false, - "onAnalyzerWarnings": true, - "onFailingTests": true, - "onSuccess": true - }, - "emailConfiguration": { - "includeCommitMessages": true, - "additionalRecipients": [ - "committer@hello.world", - "yo@mo.com" - ], - "emailCommitters": true, - "includeIssueDetails": true - } - }, - { - "phase": 2, - "scriptBody": "Sample Script After", - "type": 1, - "name": "Run Script", - "conditions": { - "status": 2, - "onWarnings": true, - "onBuildErrors": true, - "onInternalErrors": false, - "onAnalyzerWarnings": true, - "onFailingTests": true, - "onSuccess": true - } - } - ], - "performsAnalyzeAction": true, - "schemeName": "Buildasaur", - "weeklyScheduleDay": 0, - "testingDeviceIDs": [], - "minutesAfterHourToIntegrate": 0, - "hourOfIntegration": 0, - "scheduleType": 2, - "performsArchiveAction": true, - "testingDestinationType": 7, - "sourceControlBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlBranchIdentifierKey": "buildasaur", - "DVTSourceControlBranchOptionsKey": 214, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - }, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlBranchIdentifierKey": "master", - "DVTSourceControlBranchOptionsKey": 214, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey": {}, - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy" - }, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy" - } - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": 0, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": 0 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "48B2E98C-DA87-4B8A-8C5D-CB6FE328F7D2", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "Buildasaur-XcodeServerSDK/", - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": "Buildasaur/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "Buildasaur", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "Buildasaur.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/Buildasaur.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/XcodeServerSDK.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" - } - ] - } - }, - "requiresUpgrade": false, - "name": "TESTBOT", - "type": 1, - "integration_counter": 6, - "doc_type": "bot", - "tinyID": "45FC428", - "lastRevisionBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlBranchIdentifierKey": "buildasaur", - "DVTSourceControlLocationRevisionKey": "0278e79fe9a901e1a76e0996ef39511168417de7", - "DVTSourceControlBranchOptionsKey": 50, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - }, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlBranchIdentifierKey": "master", - "DVTSourceControlLocationRevisionKey": "fe26453fe3776a76292b14e0b74d118d5ef7f0c5", - "DVTSourceControlBranchOptionsKey": 50, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB", - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "20F0A876-ADD9-4B51-918D-5B46EA5E6007", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "Buildasaur-XcodeServerSDK/", - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": "Buildasaur/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "Buildasaur", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "Buildasaur.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/Buildasaur.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/XcodeServerSDK.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" - } - ] - } -} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_periodical_daily941_clean_always.json b/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_periodical_daily941_clean_always.json deleted file mode 100644 index 1222bfa..0000000 --- a/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_periodical_daily941_clean_always.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "_id": "faaeae44305ec0eaf94134b66792ef54", - "_rev": "17-392a76642a574caabff866b70b22d934", - "group": { - "name": "8BB5C9C6-B762-4EAC-A4F6-837FA3DE45A0" - }, - "configuration": { - "builtFromClean": 1, - "periodicScheduleInterval": 2, - "performsTestAction": true, - "triggers": [ - { - "phase": 1, - "scriptBody": "cd Buildasaur\npod install", - "type": 1, - "name": "Run Script" - }, - { - "phase": 2, - "scriptBody": "", - "type": 2, - "name": "Notify Committers on Failure", - "conditions": { - "status": 2, - "onWarnings": true, - "onBuildErrors": true, - "onInternalErrors": false, - "onAnalyzerWarnings": true, - "onFailingTests": true, - "onSuccess": true - }, - "emailConfiguration": { - "includeCommitMessages": true, - "additionalRecipients": [ - "committer@hello.world", - "yo@mo.com" - ], - "emailCommitters": true, - "includeIssueDetails": true - } - }, - { - "phase": 2, - "scriptBody": "Sample Script After", - "type": 1, - "name": "Run Script", - "conditions": { - "status": 2, - "onWarnings": true, - "onBuildErrors": true, - "onInternalErrors": false, - "onAnalyzerWarnings": true, - "onFailingTests": true, - "onSuccess": true - } - } - ], - "performsAnalyzeAction": true, - "schemeName": "Buildasaur", - "weeklyScheduleDay": 0, - "testingDeviceIDs": [], - "minutesAfterHourToIntegrate": 41, - "hourOfIntegration": 9, - "scheduleType": 1, - "performsArchiveAction": true, - "testingDestinationType": 7, - "sourceControlBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlBranchIdentifierKey": "buildasaur", - "DVTSourceControlBranchOptionsKey": 214, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - }, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlBranchIdentifierKey": "master", - "DVTSourceControlBranchOptionsKey": 214, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey": {}, - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy" - }, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy" - } - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": 0, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": 0 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "48B2E98C-DA87-4B8A-8C5D-CB6FE328F7D2", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "Buildasaur-XcodeServerSDK/", - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": "Buildasaur/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "Buildasaur", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "Buildasaur.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/Buildasaur.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/XcodeServerSDK.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" - } - ] - } - }, - "requiresUpgrade": false, - "name": "TESTBOT", - "type": 1, - "integration_counter": 6, - "doc_type": "bot", - "tinyID": "45FC428", - "lastRevisionBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlBranchIdentifierKey": "buildasaur", - "DVTSourceControlLocationRevisionKey": "0278e79fe9a901e1a76e0996ef39511168417de7", - "DVTSourceControlBranchOptionsKey": 50, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - }, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlBranchIdentifierKey": "master", - "DVTSourceControlLocationRevisionKey": "fe26453fe3776a76292b14e0b74d118d5ef7f0c5", - "DVTSourceControlBranchOptionsKey": 50, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB", - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "20F0A876-ADD9-4B51-918D-5B46EA5E6007", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "Buildasaur-XcodeServerSDK/", - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": "Buildasaur/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "Buildasaur", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "Buildasaur.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/Buildasaur.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/XcodeServerSDK.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" - } - ] - } -} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_periodical_onhour15minsafter_clean_onceaday.json b/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_periodical_onhour15minsafter_clean_onceaday.json deleted file mode 100644 index 8a7be04..0000000 --- a/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_periodical_onhour15minsafter_clean_onceaday.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "_id": "faaeae44305ec0eaf94134b66792ef54", - "_rev": "16-5f7764e3d09ccb3a5679a151d42865c0", - "group": { - "name": "8BB5C9C6-B762-4EAC-A4F6-837FA3DE45A0" - }, - "configuration": { - "builtFromClean": 2, - "periodicScheduleInterval": 1, - "performsTestAction": true, - "triggers": [ - { - "phase": 1, - "scriptBody": "cd Buildasaur\npod install", - "type": 1, - "name": "Run Script" - }, - { - "phase": 2, - "scriptBody": "", - "type": 2, - "name": "Notify Committers on Failure", - "conditions": { - "status": 2, - "onWarnings": true, - "onBuildErrors": true, - "onInternalErrors": false, - "onAnalyzerWarnings": true, - "onFailingTests": true, - "onSuccess": true - }, - "emailConfiguration": { - "includeCommitMessages": true, - "additionalRecipients": [ - "committer@hello.world", - "yo@mo.com" - ], - "emailCommitters": true, - "includeIssueDetails": true - } - }, - { - "phase": 2, - "scriptBody": "Sample Script After", - "type": 1, - "name": "Run Script", - "conditions": { - "status": 2, - "onWarnings": true, - "onBuildErrors": true, - "onInternalErrors": false, - "onAnalyzerWarnings": true, - "onFailingTests": true, - "onSuccess": true - } - } - ], - "performsAnalyzeAction": true, - "schemeName": "Buildasaur", - "weeklyScheduleDay": 0, - "testingDeviceIDs": [], - "minutesAfterHourToIntegrate": 15, - "hourOfIntegration": 0, - "scheduleType": 1, - "performsArchiveAction": true, - "testingDestinationType": 7, - "sourceControlBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlBranchIdentifierKey": "buildasaur", - "DVTSourceControlBranchOptionsKey": 214, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - }, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlBranchIdentifierKey": "master", - "DVTSourceControlBranchOptionsKey": 214, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey": {}, - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy" - }, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy" - } - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": 0, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": 0 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "48B2E98C-DA87-4B8A-8C5D-CB6FE328F7D2", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "Buildasaur-XcodeServerSDK/", - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": "Buildasaur/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "Buildasaur", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "Buildasaur.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/Buildasaur.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/XcodeServerSDK.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" - } - ] - } - }, - "requiresUpgrade": false, - "name": "TESTBOT", - "type": 1, - "integration_counter": 6, - "doc_type": "bot", - "tinyID": "45FC428", - "lastRevisionBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlBranchIdentifierKey": "master", - "DVTSourceControlLocationRevisionKey": "fe26453fe3776a76292b14e0b74d118d5ef7f0c5", - "DVTSourceControlBranchOptionsKey": 50, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - }, - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlBranchIdentifierKey": "buildasaur", - "DVTSourceControlLocationRevisionKey": "0278e79fe9a901e1a76e0996ef39511168417de7", - "DVTSourceControlBranchOptionsKey": 50, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB", - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "20F0A876-ADD9-4B51-918D-5B46EA5E6007", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": "Buildasaur/", - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "Buildasaur-XcodeServerSDK/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "Buildasaur", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "Buildasaur.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/Buildasaur.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/XcodeServerSDK.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" - } - ] - } -} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_periodical_weeklytuesday941.json b/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_periodical_weeklytuesday941.json deleted file mode 100644 index 0fc0680..0000000 --- a/XcodeServerSDKTests/Data/bot_mac_xcode6_schedule_periodical_weeklytuesday941.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "_id": "faaeae44305ec0eaf94134b66792ef54", - "_rev": "18-f5e91dd5c1a6b5cab16741ba0e6ca19f", - "group": { - "name": "8BB5C9C6-B762-4EAC-A4F6-837FA3DE45A0" - }, - "configuration": { - "builtFromClean": 1, - "periodicScheduleInterval": 3, - "performsTestAction": true, - "triggers": [ - { - "phase": 1, - "scriptBody": "cd Buildasaur\npod install", - "type": 1, - "name": "Run Script" - }, - { - "phase": 2, - "scriptBody": "", - "type": 2, - "name": "Notify Committers on Failure", - "conditions": { - "status": 2, - "onWarnings": true, - "onBuildErrors": true, - "onInternalErrors": false, - "onAnalyzerWarnings": true, - "onFailingTests": true, - "onSuccess": true - }, - "emailConfiguration": { - "includeCommitMessages": true, - "additionalRecipients": [ - "committer@hello.world", - "yo@mo.com" - ], - "emailCommitters": true, - "includeIssueDetails": true - } - }, - { - "phase": 2, - "scriptBody": "Sample Script After", - "type": 1, - "name": "Run Script", - "conditions": { - "status": 2, - "onWarnings": true, - "onBuildErrors": true, - "onInternalErrors": false, - "onAnalyzerWarnings": true, - "onFailingTests": true, - "onSuccess": true - } - } - ], - "performsAnalyzeAction": true, - "schemeName": "Buildasaur", - "weeklyScheduleDay": 2, - "testingDeviceIDs": [], - "minutesAfterHourToIntegrate": 41, - "hourOfIntegration": 9, - "scheduleType": 1, - "performsArchiveAction": true, - "testingDestinationType": 7, - "sourceControlBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlBranchIdentifierKey": "buildasaur", - "DVTSourceControlBranchOptionsKey": 214, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - }, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlBranchIdentifierKey": "master", - "DVTSourceControlBranchOptionsKey": 214, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey": {}, - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy" - }, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy" - } - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": 0, - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": 0 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "48B2E98C-DA87-4B8A-8C5D-CB6FE328F7D2", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "Buildasaur-XcodeServerSDK/", - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": "Buildasaur/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "Buildasaur", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "Buildasaur.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/Buildasaur.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/XcodeServerSDK.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" - } - ] - } - }, - "requiresUpgrade": false, - "name": "TESTBOT", - "type": 1, - "integration_counter": 6, - "doc_type": "bot", - "tinyID": "45FC428", - "lastRevisionBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": { - "DVTSourceControlBranchIdentifierKey": "master", - "DVTSourceControlLocationRevisionKey": "fe26453fe3776a76292b14e0b74d118d5ef7f0c5", - "DVTSourceControlBranchOptionsKey": 50, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - }, - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlBranchIdentifierKey": "buildasaur", - "DVTSourceControlLocationRevisionKey": "0278e79fe9a901e1a76e0996ef39511168417de7", - "DVTSourceControlBranchOptionsKey": 50, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB", - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "20F0A876-ADD9-4B51-918D-5B46EA5E6007", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "1C5C2A17EEADA6DBF6678501245487A71FBE28BB": "Buildasaur/", - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "Buildasaur-XcodeServerSDK/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "Buildasaur", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "Buildasaur.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/Buildasaur.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "1C5C2A17EEADA6DBF6678501245487A71FBE28BB" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/XcodeServerSDK.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" - } - ] - } -} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/bot_mac_xcode7.json b/XcodeServerSDKTests/Data/bot_mac_xcode7.json deleted file mode 100644 index c623d21..0000000 --- a/XcodeServerSDKTests/Data/bot_mac_xcode7.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "_id": "ef18f96409a205451df8a5b9c402d36f", - "_rev": "5-ba18e0a7b78aea3dfc125fe541340df7", - "group": { - "name": "F28A6883-FBF6-41AA-BF65-58E916906E96" - }, - "configuration": { - "builtFromClean": 0, - "periodicScheduleInterval": 1, - "codeCoveragePreference": 2, - "performsTestAction": true, - "triggers": [ - { - "phase": 1, - "scriptBody": "Before", - "type": 1, - "name": "Run Script" - }, - { - "phase": 2, - "scriptBody": "After", - "type": 1, - "name": "Run Script", - "conditions": { - "status": 2, - "onWarnings": true, - "onBuildErrors": true, - "onInternalErrors": true, - "onAnalyzerWarnings": true, - "onFailingTests": true, - "onSuccess": true - } - }, - { - "phase": 2, - "scriptBody": "", - "type": 2, - "name": "Send Email Notification", - "conditions": { - "status": 2, - "onWarnings": true, - "onBuildErrors": true, - "onInternalErrors": true, - "onAnalyzerWarnings": true, - "onFailingTests": true, - "onSuccess": true - }, - "emailConfiguration": { - "includeCommitMessages": true, - "additionalRecipients": [ - "email@me.com", - "hello@world.com" - ], - "emailCommitters": true, - "scmOptions": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": true - }, - "includeIssueDetails": true - } - } - ], - "performsAnalyzeAction": true, - "schemeName": "XcodeServerSDK", - "exportsProductFromArchive": true, - "testingDeviceIDs": [], - "deviceSpecification": { - "filters": [ - { - "platform": { - "buildNumber": "15A178w", - "_id": "a85553a5b26a7c1a4998f3b237000b18", - "_rev": "6-ec2620829704318e5207916618d5101b", - "displayName": "OS X", - "identifier": "com.apple.platform.macosx", - "version": "1.1" - }, - "filterType": 0, - "architectureType": 1 - } - ], - "deviceIdentifiers": [] - }, - "weeklyScheduleDay": 0, - "minutesAfterHourToIntegrate": 0, - "scheduleType": 1, - "hourOfIntegration": 0, - "performsArchiveAction": true, - "testingDestinationType": 7, - "sourceControlBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlBranchIdentifierKey": "swift-2", - "DVTSourceControlBranchOptionsKey": 214, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey": {}, - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy" - } - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": 0 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "68B5DED7-3FEF-4D55-A6F7-973537EC51FD", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "XcodeServerSDK/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "XcodeServerSDK", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "XcodeServerSDK.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/XcodeServerSDK.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustedCertFingerprintKey": "1627ACA576282D36631B564DEBDFA648", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustSelfSignedCertKey": true - } - ] - } - }, - "requiresUpgrade": false, - "name": "TESTBOT", - "type": 1, - "integration_counter": 2, - "doc_type": "bot", - "tinyID": "A851ED5", - "lastRevisionBlueprint": { - "DVTSourceControlWorkspaceBlueprintLocationsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { - "DVTSourceControlBranchIdentifierKey": "swift-2", - "DVTSourceControlLocationRevisionKey": "991da08565c38ea9ea7e6bd7db1acce49e4ae701", - "DVTSourceControlBranchOptionsKey": 50, - "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" - } - }, - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", - "DVTSourceControlWorkspaceBlueprintIdentifierKey": "CD185E3B-5B34-4E15-9CFA-9DFB1D715DB5", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { - "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "XcodeServerSDK" - }, - "DVTSourceControlWorkspaceBlueprintNameKey": "XcodeServerSDK", - "DVTSourceControlWorkspaceBlueprintVersion": 203, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "XcodeServerSDK.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "github.com:czechboy0/XcodeServerSDK.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" - } - ] - } -} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/create_ios_bot.json b/XcodeServerSDKTests/Data/create_ios_bot.json new file mode 100644 index 0000000..32d8fb2 --- /dev/null +++ b/XcodeServerSDKTests/Data/create_ios_bot.json @@ -0,0 +1,81 @@ +{ + "group": { + "name": "E4F21264-9C46-4B10-8613-244E48958233" + }, + "configuration": { + "builtFromClean": 0, + "periodicScheduleInterval": 1, + "codeCoveragePreference": 2, + "performsTestAction": true, + "triggers": [], + "performsAnalyzeAction": true, + "schemeName": "XcodeServerSDK - iOS", + "exportsProductFromArchive": true, + "testingDeviceIDs": [], + "deviceSpecification": { + "filters": [ + { + "platform": { + "_id": "a85553a5b26a7c1a4998f3b237000da9", + "displayName": "iOS", + "_rev": "12-162b2b9d57b73b66724426eea53bfcaf", + "simulatorIdentifier": "com.apple.platform.iphonesimulator", + "identifier": "com.apple.platform.iphoneos", + "buildNumber": "13A4280e", + "version": "9.0" + }, + "filterType": 0, + "architectureType": 0 + } + ], + "deviceIdentifiers": [] + }, + "weeklyScheduleDay": 0, + "minutesAfterHourToIntegrate": 0, + "scheduleType": 1, + "hourOfIntegration": 0, + "performsArchiveAction": true, + "sourceControlBlueprint": { + "DVTSourceControlWorkspaceBlueprintLocationsKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { + "DVTSourceControlBranchIdentifierKey": "hd/tested_devices_xcode_7", + "DVTSourceControlBranchOptionsKey": 156, + "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" + } + }, + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryUsernameKey": "git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": "MY_PRIVATE_KEY", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryPublicKeyDataKey": "c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFETUlyMHIyK3pt\r\nZ2JIajhBcnczRDQzZ0N5WURMc3p6ZWtIdTZZK0FKd29xZC8venFXU1FqamxlMkRt\r\nSmFueXNORnRhbFU3U005M2dtYXEzYTI4YjM3aWZnRmMrMXlhSDRNOC9EUk1yaHRR\r\ndk9JSEhYcWNzeUpwU0RWRkl3YjVxRm5LblNGaW96NGdSTkV0R1VOWWdCVTNYNHRs\r\nQzNMQkV1RmZhdS9RVXZZOEY5NmdMS3BGMTF0ZHdaanlDREN5ZWtIT2JaeWU2RS9R\r\nelRKZXppWjF5RXdHcXdvS3Q1NlpoZ1JHNG5yRHMwaEU2dDYxUG90WkdiMEpSbVRm\r\nYThFM05Mckp5ZklreS9DK2hpQ2tsSmZRelZndGk2MWtwMDJuZFN1ODlHK3dBY0xJ\r\nUjJ2Qzk2TndWRW9pZG1MTnN0bXlrMlhEbG1jVzB2Z0ZHVmptNWx2ZkljWVYgaG9u\r\nemFAc3dpZnRrZXkubmV0Cg==", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryPasswordKey": "" + } + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey": "B67842EF-128D-4AB7-A3C7-7E560085550A", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "XcodeServerSDK/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey": "XcodeServerSDK", + "DVTSourceControlWorkspaceBlueprintVersion": 203, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "XcodeServerSDK.xcworkspace", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "git@github.com:czechboy0/XcodeServerSDK.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustedCertFingerprintKey": "1627ACA576282D36631B564DEBDFA648", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustSelfSignedCertKey": true + } + ] + }, + "testingDestinationType": 0 + }, + "requiresUpgrade": false, + "name": "Default iOS Bot", + "type": 1 +} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/create_osx_bot.json b/XcodeServerSDKTests/Data/create_osx_bot.json new file mode 100644 index 0000000..e52ffc5 --- /dev/null +++ b/XcodeServerSDKTests/Data/create_osx_bot.json @@ -0,0 +1,128 @@ +{ + "group": { + "name": "2FDD3BEB-D750-47EE-B386-07EA9BABA98B" + }, + "configuration": { + "builtFromClean": 0, + "periodicScheduleInterval": 1, + "codeCoveragePreference": 2, + "performsTestAction": true, + "triggers": [ + { + "phase": 1, + "scriptBody": "echo \"Run before\"", + "type": 1, + "name": "Run Script" + }, + { + "phase": 2, + "scriptBody": "echo \"Run after\"", + "type": 1, + "name": "Run Script", + "conditions": { + "status": 2, + "onWarnings": true, + "onBuildErrors": true, + "onInternalErrors": true, + "onAnalyzerWarnings": true, + "onFailingTests": true, + "onSuccess": true + } + }, + { + "phase": 2, + "scriptBody": "", + "type": 2, + "name": "Send Email Notification", + "conditions": { + "status": 2, + "onWarnings": true, + "onBuildErrors": true, + "onInternalErrors": true, + "onAnalyzerWarnings": true, + "onFailingTests": true, + "onSuccess": false + }, + "emailConfiguration": { + "includeCommitMessages": true, + "additionalRecipients": [ + "email@committers.yo" + ], + "emailCommitters": true, + "scmOptions": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": true + }, + "includeIssueDetails": true + } + } + ], + "performsAnalyzeAction": true, + "schemeName": "XcodeServerSDK - OS X", + "exportsProductFromArchive": true, + "testingDeviceIDs": [], + "deviceSpecification": { + "filters": [ + { + "platform": { + "buildNumber": "15A204f", + "_id": "a85553a5b26a7c1a4998f3b237000b18", + "_rev": "12-b005bffe3337cfe101fd597c300b0208", + "displayName": "OS X", + "identifier": "com.apple.platform.macosx", + "version": "1.1" + }, + "filterType": 0, + "architectureType": 1 + } + ], + "deviceIdentifiers": [] + }, + "weeklyScheduleDay": 0, + "minutesAfterHourToIntegrate": 0, + "scheduleType": 1, + "hourOfIntegration": 0, + "performsArchiveAction": true, + "sourceControlBlueprint": { + "DVTSourceControlWorkspaceBlueprintLocationsKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { + "DVTSourceControlBranchIdentifierKey": "hd/tested_devices_xcode_7", + "DVTSourceControlBranchOptionsKey": 156, + "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" + } + }, + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryUsernameKey": "git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": "MY_PRIVATE_KEY", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryPublicKeyDataKey": "c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFETUlyMHIyK3pt\r\nZ2JIajhBcnczRDQzZ0N5WURMc3p6ZWtIdTZZK0FKd29xZC8venFXU1FqamxlMkRt\r\nSmFueXNORnRhbFU3U005M2dtYXEzYTI4YjM3aWZnRmMrMXlhSDRNOC9EUk1yaHRR\r\ndk9JSEhYcWNzeUpwU0RWRkl3YjVxRm5LblNGaW96NGdSTkV0R1VOWWdCVTNYNHRs\r\nQzNMQkV1RmZhdS9RVXZZOEY5NmdMS3BGMTF0ZHdaanlDREN5ZWtIT2JaeWU2RS9R\r\nelRKZXppWjF5RXdHcXdvS3Q1NlpoZ1JHNG5yRHMwaEU2dDYxUG90WkdiMEpSbVRm\r\nYThFM05Mckp5ZklreS9DK2hpQ2tsSmZRelZndGk2MWtwMDJuZFN1ODlHK3dBY0xJ\r\nUjJ2Qzk2TndWRW9pZG1MTnN0bXlrMlhEbG1jVzB2Z0ZHVmptNWx2ZkljWVYgaG9u\r\nemFAc3dpZnRrZXkubmV0Cg==", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryPasswordKey": "" + } + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey": "04531A78-B36E-4E1E-B304-92BD53E2E173", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "XcodeServerSDK/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey": "XcodeServerSDK", + "DVTSourceControlWorkspaceBlueprintVersion": 203, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "XcodeServerSDK.xcworkspace", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "git@github.com:czechboy0/XcodeServerSDK.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustedCertFingerprintKey": "1627ACA576282D36631B564DEBDFA648", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustSelfSignedCertKey": true + } + ] + }, + "testingDestinationType": 7 + }, + "requiresUpgrade": false, + "name": "Default OS X Bot", + "type": 1 +} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/create_watch_bot.json b/XcodeServerSDKTests/Data/create_watch_bot.json new file mode 100644 index 0000000..96ea9ef --- /dev/null +++ b/XcodeServerSDKTests/Data/create_watch_bot.json @@ -0,0 +1,81 @@ +{ + "group": { + "name": "77F7F792-7D3B-499E-9D3B-FE10858AF8E3" + }, + "configuration": { + "builtFromClean": 0, + "periodicScheduleInterval": 1, + "codeCoveragePreference": 2, + "performsTestAction": false, + "triggers": [], + "performsAnalyzeAction": true, + "schemeName": "XcodeServerSDK - ᴡᴀᴛᴄʜ", + "exportsProductFromArchive": true, + "testingDeviceIDs": [], + "deviceSpecification": { + "filters": [ + { + "platform": { + "_id": "a85553a5b26a7c1a4998f3b237000c7d", + "displayName": "watchOS", + "_rev": "12-58b9b255374d71f362f830256dfa65e4", + "simulatorIdentifier": "com.apple.platform.watchsimulator", + "identifier": "com.apple.platform.watchos", + "buildNumber": "13S5255c", + "version": "2.0" + }, + "filterType": 0, + "architectureType": 0 + } + ], + "deviceIdentifiers": [] + }, + "weeklyScheduleDay": 0, + "minutesAfterHourToIntegrate": 0, + "scheduleType": 1, + "hourOfIntegration": 0, + "performsArchiveAction": true, + "sourceControlBlueprint": { + "DVTSourceControlWorkspaceBlueprintLocationsKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { + "DVTSourceControlBranchIdentifierKey": "hd/tested_devices_xcode_7", + "DVTSourceControlBranchOptionsKey": 156, + "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" + } + }, + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryUsernameKey": "git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": "MY_PRIVATE_KEY", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryPublicKeyDataKey": "c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFETUlyMHIyK3pt\r\nZ2JIajhBcnczRDQzZ0N5WURMc3p6ZWtIdTZZK0FKd29xZC8venFXU1FqamxlMkRt\r\nSmFueXNORnRhbFU3U005M2dtYXEzYTI4YjM3aWZnRmMrMXlhSDRNOC9EUk1yaHRR\r\ndk9JSEhYcWNzeUpwU0RWRkl3YjVxRm5LblNGaW96NGdSTkV0R1VOWWdCVTNYNHRs\r\nQzNMQkV1RmZhdS9RVXZZOEY5NmdMS3BGMTF0ZHdaanlDREN5ZWtIT2JaeWU2RS9R\r\nelRKZXppWjF5RXdHcXdvS3Q1NlpoZ1JHNG5yRHMwaEU2dDYxUG90WkdiMEpSbVRm\r\nYThFM05Mckp5ZklreS9DK2hpQ2tsSmZRelZndGk2MWtwMDJuZFN1ODlHK3dBY0xJ\r\nUjJ2Qzk2TndWRW9pZG1MTnN0bXlrMlhEbG1jVzB2Z0ZHVmptNWx2ZkljWVYgaG9u\r\nemFAc3dpZnRrZXkubmV0Cg==", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryPasswordKey": "" + } + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey": "D11746DF-6E40-49FF-9AAB-8FF4BFCF0082", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "XcodeServerSDK/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey": "XcodeServerSDK", + "DVTSourceControlWorkspaceBlueprintVersion": 203, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "XcodeServerSDK.xcworkspace", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "git@github.com:czechboy0/XcodeServerSDK.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustedCertFingerprintKey": "1627ACA576282D36631B564DEBDFA648", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustSelfSignedCertKey": true + } + ] + }, + "testingDestinationType": 0 + }, + "requiresUpgrade": false, + "name": "Default Watch Bot", + "type": 1 +} diff --git a/XcodeServerSDKTests/Data/platforms.json b/XcodeServerSDKTests/Data/platforms.json new file mode 100644 index 0000000..cd5353d --- /dev/null +++ b/XcodeServerSDKTests/Data/platforms.json @@ -0,0 +1,37 @@ +{ + "count": 3, + "results": [ + { + "_id": "a85553a5b26a7c1a4998f3b237000b18", + "_rev": "12-b005bffe3337cfe101fd597c300b0208", + "buildNumber": "15A204f", + "displayName": "OS X", + "identifier": "com.apple.platform.macosx", + "version": "1.1", + "doc_type": "platform", + "tinyID": "0224D30" + }, + { + "_id": "a85553a5b26a7c1a4998f3b237000c7d", + "_rev": "12-58b9b255374d71f362f830256dfa65e4", + "buildNumber": "13S5255c", + "simulatorIdentifier": "com.apple.platform.watchsimulator", + "displayName": "watchOS", + "identifier": "com.apple.platform.watchos", + "version": "2.0", + "doc_type": "platform", + "tinyID": "BA84EFD" + }, + { + "_id": "a85553a5b26a7c1a4998f3b237000da9", + "_rev": "12-162b2b9d57b73b66724426eea53bfcaf", + "buildNumber": "13A4280e", + "simulatorIdentifier": "com.apple.platform.iphonesimulator", + "displayName": "iOS", + "identifier": "com.apple.platform.iphoneos", + "version": "9.0", + "doc_type": "platform", + "tinyID": "0273BAD" + } + ] +} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/scm_branches_request_no_fingerprint.json b/XcodeServerSDKTests/Data/scm_branches_request_no_fingerprint.json new file mode 100644 index 0000000..6b84b93 --- /dev/null +++ b/XcodeServerSDKTests/Data/scm_branches_request_no_fingerprint.json @@ -0,0 +1,37 @@ +{ + "DVTSourceControlWorkspaceBlueprintLocationsKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { + "DVTSourceControlBranchIdentifierKey": "hd/tested_devices_xcode_7", + "DVTSourceControlBranchOptionsKey": 220, + "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" + } + }, + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey": {}, + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryUsernameKey": "git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": "THIS_IS_MY_SECRET_PRIVATE_KEY_MUHAHA", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryPublicKeyDataKey": "c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFETUlyMHIyK3pt\r\nZ2JIajhBcnczRDQzZ0N5WURMc3p6ZWtIdTZZK0FKd29xZC8venFXU1FqamxlMkRt\r\nSmFueXNORnRhbFU3U005M2dtYXEzYTI4YjM3aWZnRmMrMXlhSDRNOC9EUk1yaHRR\r\ndk9JSEhYcWNzeUpwU0RWRkl3YjVxRm5LblNGaW96NGdSTkV0R1VOWWdCVTNYNHRs\r\nQzNMQkV1RmZhdS9RVXZZOEY5NmdMS3BGMTF0ZHdaanlDREN5ZWtIT2JaeWU2RS9R\r\nelRKZXppWjF5RXdHcXdvS3Q1NlpoZ1JHNG5yRHMwaEU2dDYxUG90WkdiMEpSbVRm\r\nYThFM05Mckp5ZklreS9DK2hpQ2tsSmZRelZndGk2MWtwMDJuZFN1ODlHK3dBY0xJ\r\nUjJ2Qzk2TndWRW9pZG1MTnN0bXlrMlhEbG1jVzB2Z0ZHVmptNWx2ZkljWVYgaG9u\r\nemFAc3dpZnRrZXkubmV0Cg==", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryPasswordKey": "" + } + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey": "9520BFD3-FFF2-455B-B838-00306AAE916A", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "XcodeServerSDK/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey": "XcodeServerSDK", + "DVTSourceControlWorkspaceBlueprintVersion": 203, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "XcodeServerSDK.xcworkspace", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "git@github.com:czechboy0/XcodeServerSDK.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" + } + ] +} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/scm_branches_request_with_fingerprint.json b/XcodeServerSDKTests/Data/scm_branches_request_with_fingerprint.json new file mode 100644 index 0000000..d46dc4b --- /dev/null +++ b/XcodeServerSDKTests/Data/scm_branches_request_with_fingerprint.json @@ -0,0 +1,39 @@ +{ + "DVTSourceControlWorkspaceBlueprintLocationsKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { + "DVTSourceControlBranchIdentifierKey": "hd/tested_devices_xcode_7", + "DVTSourceControlBranchOptionsKey": 220, + "DVTSourceControlWorkspaceBlueprintLocationTypeKey": "DVTSourceControlBranch" + } + }, + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey": {}, + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryUsernameKey": "git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationStrategiesKey": "THIS_IS_MY_SECRET_PRIVATE_KEY_MUHAHA", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryAuthenticationTypeKey": "DVTSourceControlSSHKeysAuthenticationStrategy", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryPublicKeyDataKey": "c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFETUlyMHIyK3pt\r\nZ2JIajhBcnczRDQzZ0N5WURMc3p6ZWtIdTZZK0FKd29xZC8venFXU1FqamxlMkRt\r\nSmFueXNORnRhbFU3U005M2dtYXEzYTI4YjM3aWZnRmMrMXlhSDRNOC9EUk1yaHRR\r\ndk9JSEhYcWNzeUpwU0RWRkl3YjVxRm5LblNGaW96NGdSTkV0R1VOWWdCVTNYNHRs\r\nQzNMQkV1RmZhdS9RVXZZOEY5NmdMS3BGMTF0ZHdaanlDREN5ZWtIT2JaeWU2RS9R\r\nelRKZXppWjF5RXdHcXdvS3Q1NlpoZ1JHNG5yRHMwaEU2dDYxUG90WkdiMEpSbVRm\r\nYThFM05Mckp5ZklreS9DK2hpQ2tsSmZRelZndGk2MWtwMDJuZFN1ODlHK3dBY0xJ\r\nUjJ2Qzk2TndWRW9pZG1MTnN0bXlrMlhEbG1jVzB2Z0ZHVmptNWx2ZkljWVYgaG9u\r\nemFAc3dpZnRrZXkubmV0Cg==", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryPasswordKey": "" + } + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey": "9520BFD3-FFF2-455B-B838-00306AAE916A", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": "XcodeServerSDK/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey": "XcodeServerSDK", + "DVTSourceControlWorkspaceBlueprintVersion": 203, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey": "XcodeServerSDK.xcworkspace", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey": [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey": "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey": "git@github.com:czechboy0/XcodeServerSDK.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustedCertFingerprintKey": "1627ACA576282D36631B564DEBDFA648", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustSelfSignedCertKey": true + } + ] +} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/scm_branches_response_error.json b/XcodeServerSDKTests/Data/scm_branches_response_error.json new file mode 100644 index 0000000..76a6620 --- /dev/null +++ b/XcodeServerSDKTests/Data/scm_branches_response_error.json @@ -0,0 +1,14 @@ +{ + "repositoryErrors": [ + { + "error": { + "code": -1004, + "message": "The server SSH fingerprint failed to verify.", + "underlyingError": "", + "domain": "com.apple.dt.SourceControlErrorDomain", + "fingerprint": "1627ACA576282D36631B564DEBDFA648" + }, + "repository": "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97" + } + ] +} \ No newline at end of file diff --git a/XcodeServerSDKTests/Data/scm_branches_response_success.json b/XcodeServerSDKTests/Data/scm_branches_response_success.json new file mode 100644 index 0000000..fea71e6 --- /dev/null +++ b/XcodeServerSDKTests/Data/scm_branches_response_success.json @@ -0,0 +1,22 @@ +{ + "branches": { + "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97": [ + { + "name": "buildasaur", + "primary": false + }, + { + "name": "hd/tested_devices_xcode_7", + "primary": false + }, + { + "name": "master", + "primary": false + }, + { + "name": "swift-2", + "primary": true + } + ] + } +} \ No newline at end of file diff --git a/XcodeServerSDKTests/TestUtils.swift b/XcodeServerSDKTests/TestUtils.swift index f447d94..1cfc134 100644 --- a/XcodeServerSDKTests/TestUtils.swift +++ b/XcodeServerSDKTests/TestUtils.swift @@ -9,6 +9,7 @@ import Foundation import XCTest import XcodeServerSDK +import DVR struct StringError: ErrorType { @@ -21,10 +22,51 @@ struct StringError: ErrorType { } } +extension XCTestCase { + + func getRecordingXcodeServer(cassetteName: String) -> XcodeServer { + + let config = try! XcodeServerConfig( + host: "https://127.0.0.1", + user: "ICanCreateBots", + password: "superSecr3t") + return self.getRecordingXcodeServerWithConfig(config, cassetteName: cassetteName) + } + + func getRecordingXcodeServerWithConfig(config: XcodeServerConfig, cassetteName: String) -> XcodeServer + { + let server = XcodeServerFactory.server(config) + let backingSession = server.http.session + + let session = DVR.Session(cassetteName: cassetteName, testBundle: NSBundle(forClass: self.classForCoder), backingSession: backingSession) + server.http.session = session + + return server + } +} // MARK: Mock JSON helper methods extension XCTestCase { + func stringAtPath(path: String) -> String { + return try! NSString(contentsOfFile: path.stringByExpandingTildeInPath, encoding: NSUTF8StringEncoding) as String + } + + func loadJSONResponseFromCassetteWithName(name: String) -> NSDictionary { + + let dictionary = self.loadJSONWithName(name) + + let interactions = dictionary["interactions"] as! [NSDictionary] + let response = interactions.first!["response"] as! NSDictionary + + //make sure it's json + assert(response["body_format"] as! String == "json") + + //get the response data out + let body = response["body"] as! NSDictionary + return body + } + func loadJSONWithName(name: String) -> NSDictionary { let bundle = NSBundle(forClass: BotParsingTests.classForCoder()) @@ -47,6 +89,12 @@ extension XCTestCase { return NSDictionary() } + func botInCassetteWithName(name: String) -> Bot { + let json = self.loadJSONResponseFromCassetteWithName(name) + let bot = Bot(json: json) + return bot + } + func botInFileWithName(name: String) -> Bot { let json = self.loadJSONWithName(name) let bot = Bot(json: json) diff --git a/XcodeServerSDKTests/XcodeServerTests.swift b/XcodeServerSDKTests/XcodeServerTests.swift index 753cbcf..733acd8 100644 --- a/XcodeServerSDKTests/XcodeServerTests.swift +++ b/XcodeServerSDKTests/XcodeServerTests.swift @@ -30,4 +30,61 @@ class XcodeServerTests: XCTestCase { func testServerCreation() { XCTAssertNotNil(self.server) } + + func DEV_testFetchAndRecordBot() { + + let exp = self.expectationWithDescription("Network") + let server = self.getRecordingXcodeServer("test_bot") + + server.getBots { (bots, error) in + print() + exp.fulfill() + } + + self.waitForExpectationsWithTimeout(10, handler: nil) + } + + func DEV_testLive_BotCreation() { + + let exp = self.expectationWithDescription("wait") + + let privateKey = self.stringAtPath("~/.ssh/id_rsa") + let publicKey = self.stringAtPath("~/.ssh/id_rsa.pub") + + let blueprint = SourceControlBlueprint(branch: "hd/tested_devices_xcode_7", projectWCCIdentifier: "A36AEFA3F9FF1F738E92F0C497C14977DCE02B97", wCCName: "XcodeServerSDK", projectName: "XcodeServerSDK", projectURL: "git@github.com:czechboy0/XcodeServerSDK.git", projectPath: "XcodeServerSDK.xcworkspace", publicSSHKey: publicKey, privateSSHKey: privateKey, sshPassphrase: nil, certificateFingerprint: nil) + + let scriptBody = "cd XcodeServerSDK; /usr/local/bin/carthage update --no-build" + let scriptTrigger = Trigger(phase: .Prebuild, kind: .RunScript, scriptBody: scriptBody, name: "Carthage", conditions: nil, emailConfiguration: nil)! + + let devices = [ + "a85553a5b26a7c1a4998f3b237005ac7", + "a85553a5b26a7c1a4998f3b237004afd" + ] + let deviceSpec = DeviceSpecification.iOS(.SelectedDevicesAndSimulators, deviceIdentifiers: devices) + let config = BotConfiguration(builtFromClean: BotConfiguration.CleaningPolicy.Once_a_Day, analyze: true, test: true, archive: false, schemeName: "XcodeServerSDK - iOS", schedule: BotSchedule.commitBotSchedule(), triggers: [scriptTrigger], deviceSpecification: deviceSpec, sourceControlBlueprint: blueprint) + + let bot = Bot(name: "TestBot From XcodeServerSDK", configuration: config) + + self.server.createBot(bot) { (response) -> () in + + print() + switch response { + case .Success(let newBot): + + self.server.postIntegration(newBot.id) { (integration, error) -> () in + + print() + exp.fulfill() + } + + default: break + } + } + + self.waitForExpectationsWithTimeout(1000, handler: nil) + } } + + + +