From a533932ecf1525d95cd69751d8c9fc3a35bf9dc5 Mon Sep 17 00:00:00 2001 From: albert-castro-hs Date: Mon, 28 Jan 2019 15:42:25 -0800 Subject: [PATCH 01/15] Set up CI with Azure Pipelines --- azure-pipelines.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..c5d9b82 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,20 @@ +# Xcode +# Build, test, and archive an Xcode workspace on macOS. +# Add steps that install certificates, test, sign, and distribute an app, save build artifacts, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/xcode + +trigger: +- master + +pool: + vmImage: 'macOS-10.13' + +steps: +- task: Xcode@5 + inputs: + actions: 'build' + scheme: '' + sdk: 'iphoneos' + configuration: 'Release' + xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' + xcodeVersion: 'default' # Options: 8, 9, 10, default, specifyPath From 23db7f0e3ac494b22a9a29a7131af3d7cdfdbf21 Mon Sep 17 00:00:00 2001 From: Albert Castro Date: Mon, 28 Jan 2019 16:02:37 -0800 Subject: [PATCH 02/15] Added schema name --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c5d9b82..9abb2cc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,7 +13,7 @@ steps: - task: Xcode@5 inputs: actions: 'build' - scheme: '' + scheme: 'TokenUI' sdk: 'iphoneos' configuration: 'Release' xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' From 2752b3ecb19fcf90e2717aada296db55b1ddb409 Mon Sep 17 00:00:00 2001 From: Albert Castro Date: Mon, 28 Jan 2019 16:09:49 -0800 Subject: [PATCH 03/15] Changed azure xcode version --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9abb2cc..84fa2ef 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,4 +17,4 @@ steps: sdk: 'iphoneos' configuration: 'Release' xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' - xcodeVersion: 'default' # Options: 8, 9, 10, default, specifyPath + xcodeVersion: '10' # Options: 8, 9, 10, default, specifyPath From ce6e1f96efec613d69f5d5cc64cee4b0e73aec19 Mon Sep 17 00:00:00 2001 From: Albert Castro Date: Mon, 28 Jan 2019 16:25:13 -0800 Subject: [PATCH 04/15] Addes tests --- azure-pipelines.yml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 84fa2ef..ba0b20b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,3 +18,44 @@ steps: configuration: 'Release' xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' xcodeVersion: '10' # Options: 8, 9, 10, default, specifyPath +# App Center Test +# Test app packages with Visual Studio App Center. +- task: AppCenterTest@1 + inputs: + appFile: + #artifactsDirectory: '$(Build.ArtifactStagingDirectory)/AppCenterTest' + #prepareTests: # Optional + #frameworkOption: 'appium' # Required when prepareTests == True# Options: appium, espresso, calabash, uitest, xcuitest + #appiumBuildDirectory: # Required when prepareTests == True && Framework == Appium + #espressoBuildDirectory: # Optional + #espressoTestApkFile: # Optional + #calabashProjectDirectory: # Required when prepareTests == True && Framework == Calabash + #calabashConfigFile: # Optional + #calabashProfile: # Optional + #calabashSkipConfigCheck: # Optional + #uiTestBuildDirectory: # Required when prepareTests == True && Framework == Uitest + #uitestStoreFile: # Optional + #uiTestStorePassword: # Optional + #uitestKeyAlias: # Optional + #uiTestKeyPassword: # Optional + #uiTestToolsDirectory: # Optional + #signInfo: # Optional + #xcUITestBuildDirectory: # Optional + #xcUITestIpaFile: # Optional + #prepareOptions: # Optional + #runTests: # Optional + #credentialsOption: 'serviceEndpoint' # Required when runTests == True# Options: serviceEndpoint, inputs + #serverEndpoint: # Required when runTests == True && CredsType == ServiceEndpoint + #username: # Required when runTests == True && CredsType == Inputs + #password: # Required when runTests == True && CredsType == Inputs + #appSlug: # Required when runTests == True + #devices: # Required when runTests == True + #series: 'master' # Optional + #dsymDirectory: # Optional + #localeOption: 'en_US' # Required when runTests == True# Options: da_DK, nl_NL, en_GB, en_US, fr_FR, de_DE, ja_JP, ru_RU, es_MX, es_ES, user + #userDefinedLocale: # Optional + #loginOptions: # Optional + #runOptions: # Optional + #skipWaitingForResults: # Optional + #cliFile: # Optional + #showDebugOutput: # Optional \ No newline at end of file From e2bdf100030c6fb84078fa1d8a5aff2ee3f4ed86 Mon Sep 17 00:00:00 2001 From: Albert Castro Date: Mon, 28 Jan 2019 16:55:32 -0800 Subject: [PATCH 05/15] Added test commands --- azure-pipelines.yml | 49 +++++++++------------------------------------ 1 file changed, 9 insertions(+), 40 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ba0b20b..a573c9e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,44 +18,13 @@ steps: configuration: 'Release' xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' xcodeVersion: '10' # Options: 8, 9, 10, default, specifyPath -# App Center Test -# Test app packages with Visual Studio App Center. -- task: AppCenterTest@1 + + +- task: Xcode@5 inputs: - appFile: - #artifactsDirectory: '$(Build.ArtifactStagingDirectory)/AppCenterTest' - #prepareTests: # Optional - #frameworkOption: 'appium' # Required when prepareTests == True# Options: appium, espresso, calabash, uitest, xcuitest - #appiumBuildDirectory: # Required when prepareTests == True && Framework == Appium - #espressoBuildDirectory: # Optional - #espressoTestApkFile: # Optional - #calabashProjectDirectory: # Required when prepareTests == True && Framework == Calabash - #calabashConfigFile: # Optional - #calabashProfile: # Optional - #calabashSkipConfigCheck: # Optional - #uiTestBuildDirectory: # Required when prepareTests == True && Framework == Uitest - #uitestStoreFile: # Optional - #uiTestStorePassword: # Optional - #uitestKeyAlias: # Optional - #uiTestKeyPassword: # Optional - #uiTestToolsDirectory: # Optional - #signInfo: # Optional - #xcUITestBuildDirectory: # Optional - #xcUITestIpaFile: # Optional - #prepareOptions: # Optional - #runTests: # Optional - #credentialsOption: 'serviceEndpoint' # Required when runTests == True# Options: serviceEndpoint, inputs - #serverEndpoint: # Required when runTests == True && CredsType == ServiceEndpoint - #username: # Required when runTests == True && CredsType == Inputs - #password: # Required when runTests == True && CredsType == Inputs - #appSlug: # Required when runTests == True - #devices: # Required when runTests == True - #series: 'master' # Optional - #dsymDirectory: # Optional - #localeOption: 'en_US' # Required when runTests == True# Options: da_DK, nl_NL, en_GB, en_US, fr_FR, de_DE, ja_JP, ru_RU, es_MX, es_ES, user - #userDefinedLocale: # Optional - #loginOptions: # Optional - #runOptions: # Optional - #skipWaitingForResults: # Optional - #cliFile: # Optional - #showDebugOutput: # Optional \ No newline at end of file + actions: 'test' + scheme: 'TokenUI' + sdk: 'iphoneos' + configuration: 'Release' + xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' + xcodeVersion: '10' # Options: 8, 9, 10, default, specifyPath From fde65566c74f52d2401cad24712b8b8f19af876f Mon Sep 17 00:00:00 2001 From: Albert Castro Date: Mon, 28 Jan 2019 17:01:54 -0800 Subject: [PATCH 06/15] Changed test config --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a573c9e..7e29890 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -25,6 +25,6 @@ steps: actions: 'test' scheme: 'TokenUI' sdk: 'iphoneos' - configuration: 'Release' + configuration: 'Debug' xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' xcodeVersion: '10' # Options: 8, 9, 10, default, specifyPath From e90c0ce584b56b358854b59684cf1f119c19b07c Mon Sep 17 00:00:00 2001 From: Albert Castro Date: Tue, 29 Jan 2019 10:02:58 -0800 Subject: [PATCH 07/15] Make tests fail for testing azure --- Tests/TokenTextViewControllerTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TokenTextViewControllerTests.swift b/Tests/TokenTextViewControllerTests.swift index 65dbbda..e63f764 100644 --- a/Tests/TokenTextViewControllerTests.swift +++ b/Tests/TokenTextViewControllerTests.swift @@ -9,7 +9,7 @@ class TokenTextViewControllerTests: XCTestCase { let tokenVC = TokenTextViewController() let text = "This is not a text." tokenVC.text = text - XCTAssertEqual(tokenVC.text, text, "Text should be as set") + XCTAssertEqual(tokenVC.text, "text", "Text should be as set") } func testSetGetFont() { From dfa30daf2cf88c21ec6ab821154872e2dfdf3499 Mon Sep 17 00:00:00 2001 From: Albert Castro Date: Tue, 29 Jan 2019 10:10:03 -0800 Subject: [PATCH 08/15] Changed scheme --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7e29890..51b90a9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,7 +13,7 @@ steps: - task: Xcode@5 inputs: actions: 'build' - scheme: 'TokenUI' + scheme: 'TokenUIDemo' sdk: 'iphoneos' configuration: 'Release' xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' @@ -23,7 +23,7 @@ steps: - task: Xcode@5 inputs: actions: 'test' - scheme: 'TokenUI' + scheme: 'TokenTests' sdk: 'iphoneos' configuration: 'Debug' xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' From a870b9d48cc12d0330c2c84c1c2a259cd6759e1d Mon Sep 17 00:00:00 2001 From: Albert Castro Date: Tue, 29 Jan 2019 10:17:34 -0800 Subject: [PATCH 09/15] Changed scheme --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 51b90a9..6250e5b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -23,7 +23,7 @@ steps: - task: Xcode@5 inputs: actions: 'test' - scheme: 'TokenTests' + scheme: 'TokenUI' sdk: 'iphoneos' configuration: 'Debug' xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' From a61575c836e917e02bfebc175b9593f53bffb892 Mon Sep 17 00:00:00 2001 From: Albert Castro Date: Tue, 29 Jan 2019 10:31:59 -0800 Subject: [PATCH 10/15] Changed scheme --- azure-pipelines.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6250e5b..4132c79 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,3 +28,45 @@ steps: configuration: 'Debug' xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' xcodeVersion: '10' # Options: 8, 9, 10, default, specifyPath + + # App Center Test +# Test app packages with Visual Studio App Center. +- task: AppCenterTest@1 + inputs: + appFile: + #artifactsDirectory: '$(Build.ArtifactStagingDirectory)/AppCenterTest' + #prepareTests: # Optional + #frameworkOption: 'xcuitest' # Required when prepareTests == True# Options: appium, espresso, calabash, uitest, xcuitest + #appiumBuildDirectory: # Required when prepareTests == True && Framework == Appium + #espressoBuildDirectory: # Optional + #espressoTestApkFile: # Optional + #calabashProjectDirectory: # Required when prepareTests == True && Framework == Calabash + #calabashConfigFile: # Optional + #calabashProfile: # Optional + #calabashSkipConfigCheck: # Optional + #uiTestBuildDirectory: # Required when prepareTests == True && Framework == Uitest + #uitestStoreFile: # Optional + #uiTestStorePassword: # Optional + #uitestKeyAlias: # Optional + #uiTestKeyPassword: # Optional + #uiTestToolsDirectory: # Optional + #signInfo: # Optional + #xcUITestBuildDirectory: # Optional + #xcUITestIpaFile: # Optional + #prepareOptions: # Optional + #runTests: # Optional + #credentialsOption: 'serviceEndpoint' # Required when runTests == True# Options: serviceEndpoint, inputs + #serverEndpoint: # Required when runTests == True && CredsType == ServiceEndpoint + #username: # Required when runTests == True && CredsType == Inputs + #password: # Required when runTests == True && CredsType == Inputs + #appSlug: # Required when runTests == True + #devices: # Required when runTests == True + #series: 'master' # Optional + #dsymDirectory: # Optional + #localeOption: 'en_US' # Required when runTests == True# Options: da_DK, nl_NL, en_GB, en_US, fr_FR, de_DE, ja_JP, ru_RU, es_MX, es_ES, user + #userDefinedLocale: # Optional + #loginOptions: # Optional + #runOptions: # Optional + #skipWaitingForResults: # Optional + #cliFile: # Optional + #showDebugOutput: # Optional From 0efa8333db1f730ff3cf954af2db656f02fc1dea Mon Sep 17 00:00:00 2001 From: Albert Castro Date: Tue, 29 Jan 2019 10:40:44 -0800 Subject: [PATCH 11/15] Changed yaml --- azure-pipelines.yml | 46 ++++----------------------------------------- 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4132c79..ca04b4e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,45 +28,7 @@ steps: configuration: 'Debug' xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' xcodeVersion: '10' # Options: 8, 9, 10, default, specifyPath - - # App Center Test -# Test app packages with Visual Studio App Center. -- task: AppCenterTest@1 - inputs: - appFile: - #artifactsDirectory: '$(Build.ArtifactStagingDirectory)/AppCenterTest' - #prepareTests: # Optional - #frameworkOption: 'xcuitest' # Required when prepareTests == True# Options: appium, espresso, calabash, uitest, xcuitest - #appiumBuildDirectory: # Required when prepareTests == True && Framework == Appium - #espressoBuildDirectory: # Optional - #espressoTestApkFile: # Optional - #calabashProjectDirectory: # Required when prepareTests == True && Framework == Calabash - #calabashConfigFile: # Optional - #calabashProfile: # Optional - #calabashSkipConfigCheck: # Optional - #uiTestBuildDirectory: # Required when prepareTests == True && Framework == Uitest - #uitestStoreFile: # Optional - #uiTestStorePassword: # Optional - #uitestKeyAlias: # Optional - #uiTestKeyPassword: # Optional - #uiTestToolsDirectory: # Optional - #signInfo: # Optional - #xcUITestBuildDirectory: # Optional - #xcUITestIpaFile: # Optional - #prepareOptions: # Optional - #runTests: # Optional - #credentialsOption: 'serviceEndpoint' # Required when runTests == True# Options: serviceEndpoint, inputs - #serverEndpoint: # Required when runTests == True && CredsType == ServiceEndpoint - #username: # Required when runTests == True && CredsType == Inputs - #password: # Required when runTests == True && CredsType == Inputs - #appSlug: # Required when runTests == True - #devices: # Required when runTests == True - #series: 'master' # Optional - #dsymDirectory: # Optional - #localeOption: 'en_US' # Required when runTests == True# Options: da_DK, nl_NL, en_GB, en_US, fr_FR, de_DE, ja_JP, ru_RU, es_MX, es_ES, user - #userDefinedLocale: # Optional - #loginOptions: # Optional - #runOptions: # Optional - #skipWaitingForResults: # Optional - #cliFile: # Optional - #showDebugOutput: # Optional + destinationSimulators: 'iPhone 7' + destinationTypeOption: 'simulators' + destinationPlatformOption: 'iOS' + useXcpretty: true \ No newline at end of file From 9af16f46bf7a2aa52ee8c5a9680f0b25a2b17c02 Mon Sep 17 00:00:00 2001 From: Albert Castro Date: Tue, 29 Jan 2019 10:45:45 -0800 Subject: [PATCH 12/15] Make Yaml file pretty --- azure-pipelines.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ca04b4e..dd3b42d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,11 +9,15 @@ trigger: pool: vmImage: 'macOS-10.13' +variables: + scheme: 'TokenUI' + steps: - task: Xcode@5 + displayName: 'Xcode debug build' inputs: actions: 'build' - scheme: 'TokenUIDemo' + scheme: '$(scheme)' sdk: 'iphoneos' configuration: 'Release' xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' @@ -21,14 +25,15 @@ steps: - task: Xcode@5 + displayName: 'Running XCTest/XCUITest' inputs: actions: 'test' - scheme: 'TokenUI' - sdk: 'iphoneos' + scheme: '$(scheme)' + sdk: 'iphonesimulator' configuration: 'Debug' xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' xcodeVersion: '10' # Options: 8, 9, 10, default, specifyPath - destinationSimulators: 'iPhone 7' + destinationSimulators: 'iPhone XS' destinationTypeOption: 'simulators' destinationPlatformOption: 'iOS' useXcpretty: true \ No newline at end of file From 540430375c69fc0cd309cdde46f4f2c26f91c2ef Mon Sep 17 00:00:00 2001 From: Albert Castro Date: Tue, 29 Jan 2019 10:46:29 -0800 Subject: [PATCH 13/15] Make Yaml file pretty --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index dd3b42d..b743f98 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,4 +36,5 @@ steps: destinationSimulators: 'iPhone XS' destinationTypeOption: 'simulators' destinationPlatformOption: 'iOS' - useXcpretty: true \ No newline at end of file + useXcpretty: true + publishJUnitResults: 'build/reports/junit.xml' \ No newline at end of file From 88396ca725bf59255f50d372af9c6b42cd895801 Mon Sep 17 00:00:00 2001 From: Albert Castro Date: Tue, 29 Jan 2019 13:40:59 -0800 Subject: [PATCH 14/15] Changed scheme --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b743f98..92b557e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,7 @@ steps: displayName: 'Xcode debug build' inputs: actions: 'build' - scheme: '$(scheme)' + scheme: 'TokenUIDemo' sdk: 'iphoneos' configuration: 'Release' xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' From 67e4278bce2c2994a4c9724eb7d0302652681a64 Mon Sep 17 00:00:00 2001 From: Albert Castro Date: Tue, 29 Jan 2019 13:53:38 -0800 Subject: [PATCH 15/15] Fix tests --- Tests/TokenTextViewControllerTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TokenTextViewControllerTests.swift b/Tests/TokenTextViewControllerTests.swift index e63f764..65dbbda 100644 --- a/Tests/TokenTextViewControllerTests.swift +++ b/Tests/TokenTextViewControllerTests.swift @@ -9,7 +9,7 @@ class TokenTextViewControllerTests: XCTestCase { let tokenVC = TokenTextViewController() let text = "This is not a text." tokenVC.text = text - XCTAssertEqual(tokenVC.text, "text", "Text should be as set") + XCTAssertEqual(tokenVC.text, text, "Text should be as set") } func testSetGetFont() {