From 7bd08d44305f5c946e30f75d132127cd87c2f7b3 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 4 Aug 2022 14:51:04 +1000 Subject: [PATCH 1/7] Add Buildkite Test Analytics Swift Package to the unit tests target --- .../project.pbxproj | 86 ++++++++++++++++--- .../xcshareddata/swiftpm/Package.resolved | 14 +++ 2 files changed, 88 insertions(+), 12 deletions(-) create mode 100644 WordPressAuthenticator.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/WordPressAuthenticator.xcodeproj/project.pbxproj b/WordPressAuthenticator.xcodeproj/project.pbxproj index f1947d3a3..0f86d3352 100644 --- a/WordPressAuthenticator.xcodeproj/project.pbxproj +++ b/WordPressAuthenticator.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 48; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ @@ -11,6 +11,7 @@ 1A21EE9822832BC300C940C6 /* WordPressComOAuthClientFacade+Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A21EE9722832BC200C940C6 /* WordPressComOAuthClientFacade+Swift.swift */; }; 1A4095182271AEFC009AA86D /* WPAuthenticator-Swift.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4095152271AEFC009AA86D /* WPAuthenticator-Swift.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3108613125AFA4830022F75E /* PasteboardTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3108613025AFA4830022F75E /* PasteboardTests.swift */; }; + 3F338B6A289B877F0014ADC5 /* BuildkiteTestCollector in Frameworks */ = {isa = PBXBuildFile; productRef = 3F338B69289B877F0014ADC5 /* BuildkiteTestCollector */; }; 3F550D4E23DA429B007E5897 /* AppSelectorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F550D4D23DA429B007E5897 /* AppSelectorTests.swift */; }; 3F550D5123DA4A9C007E5897 /* LinkMailPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F550D5023DA4A9C007E5897 /* LinkMailPresenter.swift */; }; 3F550D5323DA4AC6007E5897 /* URLHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F550D5223DA4AC6007E5897 /* URLHandler.swift */; }; @@ -402,6 +403,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 3F338B6A289B877F0014ADC5 /* BuildkiteTestCollector in Frameworks */, B5ED78FE207E976500A8FD8C /* WordPressAuthenticator.framework in Frameworks */, E8AF6B9EF50902F2117DFAF9 /* Pods_WordPressAuthenticatorTests.framework in Frameworks */, ); @@ -995,6 +997,9 @@ B5ED7900207E976500A8FD8C /* PBXTargetDependency */, ); name = WordPressAuthenticatorTests; + packageProductDependencies = ( + 3F338B69289B877F0014ADC5 /* BuildkiteTestCollector */, + ); productName = WordPressAuthenticatorTests; productReference = B5ED78FD207E976500A8FD8C /* WordPressAuthenticatorTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; @@ -1030,6 +1035,9 @@ Base, ); mainGroup = B5ED78EA207E976500A8FD8C; + packageReferences = ( + 3F338B66289B87650014ADC5 /* XCRemoteSwiftPackageReference "test-collector-swift" */, + ); productRefGroup = B5ED78F5207E976500A8FD8C /* Products */; projectDirPath = ""; projectRoot = ""; @@ -1438,7 +1446,8 @@ IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1459,7 +1468,11 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = WordPressAuthenticator/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.21.0; PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressAuthenticator; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; @@ -1483,7 +1496,11 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = WordPressAuthenticator/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.21.0; PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressAuthenticator; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; @@ -1501,7 +1518,11 @@ DEFINES_MODULE = YES; DEVELOPMENT_TEAM = PZYM8XX95Q; INFOPLIST_FILE = WordPressAuthenticatorTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressAuthenticatorTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "WordPressAuthenticatorTests/SupportingFiles/WordPressAuthenticatorTests-Bridging-Header.h"; @@ -1519,7 +1540,11 @@ DEFINES_MODULE = YES; DEVELOPMENT_TEAM = PZYM8XX95Q; INFOPLIST_FILE = WordPressAuthenticatorTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressAuthenticatorTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "WordPressAuthenticatorTests/SupportingFiles/WordPressAuthenticatorTests-Bridging-Header.h"; @@ -1579,7 +1604,8 @@ IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1600,7 +1626,11 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = WordPressAuthenticator/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.21.0; PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressAuthenticator; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; @@ -1618,7 +1648,11 @@ DEFINES_MODULE = YES; DEVELOPMENT_TEAM = PZYM8XX95Q; INFOPLIST_FILE = WordPressAuthenticatorTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressAuthenticatorTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "WordPressAuthenticatorTests/SupportingFiles/WordPressAuthenticatorTests-Bridging-Header.h"; @@ -1678,7 +1712,8 @@ IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1699,7 +1734,11 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = WordPressAuthenticator/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.21.0; PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressAuthenticator; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; @@ -1717,7 +1756,11 @@ DEFINES_MODULE = YES; DEVELOPMENT_TEAM = PZYM8XX95Q; INFOPLIST_FILE = WordPressAuthenticatorTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressAuthenticatorTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "WordPressAuthenticatorTests/SupportingFiles/WordPressAuthenticatorTests-Bridging-Header.h"; @@ -1764,6 +1807,25 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 3F338B66289B87650014ADC5 /* XCRemoteSwiftPackageReference "test-collector-swift" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/buildkite/test-collector-swift"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 0.3.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 3F338B69289B877F0014ADC5 /* BuildkiteTestCollector */ = { + isa = XCSwiftPackageProductDependency; + package = 3F338B66289B87650014ADC5 /* XCRemoteSwiftPackageReference "test-collector-swift" */; + productName = BuildkiteTestCollector; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = B5ED78EB207E976500A8FD8C /* Project object */; } diff --git a/WordPressAuthenticator.xcworkspace/xcshareddata/swiftpm/Package.resolved b/WordPressAuthenticator.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 000000000..777352a57 --- /dev/null +++ b/WordPressAuthenticator.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,14 @@ +{ + "pins" : [ + { + "identity" : "test-collector-swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/buildkite/test-collector-swift", + "state" : { + "revision" : "77c7f492f5c1c9ca159f73d18f56bbd1186390b0", + "version" : "0.3.0" + } + } + ], + "version" : 2 +} From d3cb25ccc9c9cb08672a924a783888bea77798f3 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 4 Aug 2022 14:54:19 +1000 Subject: [PATCH 2/7] Use test plan to run unit tests --- .../project.pbxproj | 2 ++ .../xcschemes/WordPressAuthenticator.xcscheme | 8 ++++++- .../UnitTests.xctestplan | 24 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 WordPressAuthenticatorTests/UnitTests.xctestplan diff --git a/WordPressAuthenticator.xcodeproj/project.pbxproj b/WordPressAuthenticator.xcodeproj/project.pbxproj index 0f86d3352..0cf234ede 100644 --- a/WordPressAuthenticator.xcodeproj/project.pbxproj +++ b/WordPressAuthenticator.xcodeproj/project.pbxproj @@ -213,6 +213,7 @@ 3108613025AFA4830022F75E /* PasteboardTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasteboardTests.swift; sourceTree = ""; }; 33FEF45B466FF8EAAE5F3923 /* Pods-WordPressAuthenticator.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressAuthenticator.release.xcconfig"; path = "Pods/Target Support Files/Pods-WordPressAuthenticator/Pods-WordPressAuthenticator.release.xcconfig"; sourceTree = ""; }; 37AFD4EF492B00CA7AEC11A3 /* Pods-WordPressAuthenticatorTests.release-alpha.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressAuthenticatorTests.release-alpha.xcconfig"; path = "Pods/Target Support Files/Pods-WordPressAuthenticatorTests/Pods-WordPressAuthenticatorTests.release-alpha.xcconfig"; sourceTree = ""; }; + 3F338B6B289B87E60014ADC5 /* UnitTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UnitTests.xctestplan; sourceTree = ""; }; 3F550D4D23DA429B007E5897 /* AppSelectorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppSelectorTests.swift; sourceTree = ""; }; 3F550D5023DA4A9C007E5897 /* LinkMailPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkMailPresenter.swift; sourceTree = ""; }; 3F550D5223DA4AC6007E5897 /* URLHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLHandler.swift; sourceTree = ""; }; @@ -772,6 +773,7 @@ B501C03F208FC52500D1E58F /* Services */, 3F550D4C23DA4191007E5897 /* UI */, B5ED7904207E976500A8FD8C /* Info.plist */, + 3F338B6B289B87E60014ADC5 /* UnitTests.xctestplan */, ); path = WordPressAuthenticatorTests; sourceTree = ""; diff --git a/WordPressAuthenticator.xcodeproj/xcshareddata/xcschemes/WordPressAuthenticator.xcscheme b/WordPressAuthenticator.xcodeproj/xcshareddata/xcschemes/WordPressAuthenticator.xcscheme index 82d59831e..876572da7 100644 --- a/WordPressAuthenticator.xcodeproj/xcshareddata/xcschemes/WordPressAuthenticator.xcscheme +++ b/WordPressAuthenticator.xcodeproj/xcshareddata/xcschemes/WordPressAuthenticator.xcscheme @@ -1,7 +1,7 @@ + version = "1.7"> @@ -37,6 +37,12 @@ ReferencedContainer = "container:WordPressAuthenticator.xcodeproj"> + + + + diff --git a/WordPressAuthenticatorTests/UnitTests.xctestplan b/WordPressAuthenticatorTests/UnitTests.xctestplan new file mode 100644 index 000000000..468233da9 --- /dev/null +++ b/WordPressAuthenticatorTests/UnitTests.xctestplan @@ -0,0 +1,24 @@ +{ + "configurations" : [ + { + "id" : "D97A5016-3F23-4D19-9CEB-C10A9AC3591F", + "name" : "Configuration 1", + "options" : { + + } + } + ], + "defaultOptions" : { + "testTimeoutsEnabled" : true + }, + "testTargets" : [ + { + "target" : { + "containerPath" : "container:WordPressAuthenticator.xcodeproj", + "identifier" : "B5ED78FC207E976500A8FD8C", + "name" : "WordPressAuthenticatorTests" + } + } + ], + "version" : 1 +} From b4634366515f7da00c17bedc345afb9d85d764ba Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 4 Aug 2022 14:54:37 +1000 Subject: [PATCH 3/7] Add Buildkite Test Analytics environment variables to test plan --- .../UnitTests.xctestplan | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/WordPressAuthenticatorTests/UnitTests.xctestplan b/WordPressAuthenticatorTests/UnitTests.xctestplan index 468233da9..028e0f651 100644 --- a/WordPressAuthenticatorTests/UnitTests.xctestplan +++ b/WordPressAuthenticatorTests/UnitTests.xctestplan @@ -9,6 +9,40 @@ } ], "defaultOptions" : { + "environmentVariableEntries" : [ + { + "key" : "BUILDKITE_ANALYTICS_TOKEN", + "value" : "$(BUILDKITE_ANALYTICS_TOKEN)" + }, + { + "key" : "BUILDKITE_BRANCH", + "value" : "$(BUILDKITE_BRANCH)" + }, + { + "key" : "BUILDKITE_BUILD_ID", + "value" : "$(BUILDKITE_BUILD_ID)" + }, + { + "key" : "BUILDKITE_BUILD_NUMBER", + "value" : "$(BUILDKITE_BUILD_NUMBER)" + }, + { + "key" : "BUILDKITE_BUILD_URL", + "value" : "$(BUILDKITE_BUILD_URL)" + }, + { + "key" : "BUILDKITE_COMMIT", + "value" : "$(BUILDKITE_COMMIT)" + }, + { + "key" : "BUILDKITE_JOB_ID", + "value" : "$(BUILDKITE_JOB_ID)" + }, + { + "key" : "BUILDKITE_MESSAGE", + "value" : "$(BUILDKITE_MESSAGE)" + } + ], "testTimeoutsEnabled" : true }, "testTargets" : [ From a184584b845f5bb8ad46f6998817fa6408e4c8f8 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 4 Aug 2022 15:04:43 +1000 Subject: [PATCH 4/7] Use Xcode 13.4.1 in CI --- .buildkite/pipeline.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 23cadc67e..c47f8d309 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -3,7 +3,7 @@ common_params: plugins: &common_plugins - &bash_cache automattic/bash-cache#2.0.0: ~ env: &common_env - IMAGE_ID: xcode-13 + IMAGE_ID: xcode-13.4.1 # This is the default pipeline – it will build and test the pod steps: @@ -14,7 +14,7 @@ steps: key: "test" command: | # See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16 - gem install bundler:2.3.4 + gem install bundler build_and_test_pod env: *common_env plugins: *common_plugins @@ -26,7 +26,7 @@ steps: key: "validate" command: | # See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16 - gem install bundler:2.3.4 + gem install bundler validate_podspec env: *common_env plugins: *common_plugins @@ -38,7 +38,7 @@ steps: key: "lint" command: | # See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16 - gem install bundler:2.3.4 + gem install bundler lint_pod env: *common_env plugins: *common_plugins From f0f15e00ac8e59030d5bbeb6e4af81f716f7dc47 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 4 Aug 2022 15:17:09 +1000 Subject: [PATCH 5/7] Move Headers build phase before Compile Sources This was recommended by `xcodebuild` in Xcode 13.4.1: > error: Cycle inside WordPressAuthenticator; building could produce unreliable results. > This usually can be resolved by moving the target's Headers build phase before Compile Sources. See https://buildkite.com/automattic/wordpress-authenticator-ios/builds/161#0182673e-31b8-4816-830f-778a14a54ad9/539-2766 --- WordPressAuthenticator.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPressAuthenticator.xcodeproj/project.pbxproj b/WordPressAuthenticator.xcodeproj/project.pbxproj index 0cf234ede..978c69f63 100644 --- a/WordPressAuthenticator.xcodeproj/project.pbxproj +++ b/WordPressAuthenticator.xcodeproj/project.pbxproj @@ -968,9 +968,9 @@ buildConfigurationList = B5ED7908207E976500A8FD8C /* Build configuration list for PBXNativeTarget "WordPressAuthenticator" */; buildPhases = ( 6CD6648B820552D8638F8EDA /* [CP] Check Pods Manifest.lock */, + B5ED78F1207E976500A8FD8C /* Headers */, B5ED78EF207E976500A8FD8C /* Sources */, B5ED78F0207E976500A8FD8C /* Frameworks */, - B5ED78F1207E976500A8FD8C /* Headers */, B5ED78F2207E976500A8FD8C /* Resources */, B5A5274B20B479D30065BE81 /* CopyFiles */, ); From 7b591293fd04eee541226fa5175658195a351eb9 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 4 Aug 2022 15:31:18 +1000 Subject: [PATCH 6/7] Use a script to run the tests so they have access to the Analytics token --- .buildkite/build-and-test.sh | 10 ++++++++++ .buildkite/pipeline.yml | 5 +---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100755 .buildkite/build-and-test.sh diff --git a/.buildkite/build-and-test.sh b/.buildkite/build-and-test.sh new file mode 100755 index 000000000..acf936a5d --- /dev/null +++ b/.buildkite/build-and-test.sh @@ -0,0 +1,10 @@ +#!/bin/bash -eu + +# We need to use a script as opposed to calling `build_and_test_pod` inline in +# the pipeline via the `command` node because our CI-VM setup doesn't forward +# the environment in that mode. + +# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16 +gem install bundler + +build_and_test_pod diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index c47f8d309..1fc35c41a 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -12,10 +12,7 @@ steps: ################# - label: "🧪 Build and Test" key: "test" - command: | - # See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16 - gem install bundler - build_and_test_pod + command: .buildkite/build-and-test.sh env: *common_env plugins: *common_plugins From 5dcde7287ebdb5f26239cf36b62c665f45ff5155 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 4 Aug 2022 16:26:49 +1000 Subject: [PATCH 7/7] Set target for variable expansions, so that the tests can access the env --- WordPressAuthenticatorTests/UnitTests.xctestplan | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/WordPressAuthenticatorTests/UnitTests.xctestplan b/WordPressAuthenticatorTests/UnitTests.xctestplan index 028e0f651..86a7b0cfb 100644 --- a/WordPressAuthenticatorTests/UnitTests.xctestplan +++ b/WordPressAuthenticatorTests/UnitTests.xctestplan @@ -43,6 +43,11 @@ "value" : "$(BUILDKITE_MESSAGE)" } ], + "targetForVariableExpansion" : { + "containerPath" : "container:WordPressAuthenticator.xcodeproj", + "identifier" : "B5ED78F3207E976500A8FD8C", + "name" : "WordPressAuthenticator" + }, "testTimeoutsEnabled" : true }, "testTargets" : [