Skip to content

Commit

Permalink
[v5] Fix CI Tests (#1525)
Browse files Browse the repository at this point in the history
* set destination to runnable destination
* bump to macOS-14-xlarge
* remove iOS 12 test
  • Loading branch information
jaxdesmarais authored Feb 19, 2025
1 parent 291b08a commit ba20d33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 50 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:
jobs:
unit_test_job:
name: Unit
runs-on: macOS-14
runs-on: macOS-14-xlarge
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -20,10 +20,10 @@ jobs:
- name: Install CocoaPod dependencies
run: pod install
- name: Run Unit Tests
run: set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Debug' -scheme 'UnitTests' -destination 'name=iPhone 14,OS=17.2,platform=iOS Simulator' test | ./Pods/xcbeautify/xcbeautify
run: set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Debug' -scheme 'UnitTests' -destination 'name=iPhone 15,OS=17.2,platform=iOS Simulator' test | ./Pods/xcbeautify/xcbeautify
ui_test_job:
name: UI
runs-on: macOS-14
runs-on: macOS-14-xlarge
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -35,10 +35,10 @@ jobs:
- name: Install CocoaPod dependencies
run: pod install
- name: Run UI Tests
run: set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Release' -scheme 'UITests' -destination 'name=iPhone 14,OS=17.2,platform=iOS Simulator' test | ./Pods/xcbeautify/xcbeautify
run: set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Release' -scheme 'UITests' -destination 'name=iPhone 15,OS=17.2,platform=iOS Simulator' test | ./Pods/xcbeautify/xcbeautify
integration_test_job:
name: Integration
runs-on: macOS-14
runs-on: macOS-14-xlarge
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -52,4 +52,4 @@ jobs:
- name: Install CocoaPod dependencies
run: pod install
- name: Run Integration Tests
run: set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Release' -scheme 'IntegrationTests' -destination 'name=iPhone 14,OS=17.2,platform=iOS Simulator' test | ./Pods/xcbeautify/xcbeautify
run: set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Release' -scheme 'IntegrationTests' -destination 'name=iPhone 15,OS=17.2,platform=iOS Simulator' test | ./Pods/xcbeautify/xcbeautify
Original file line number Diff line number Diff line change
Expand Up @@ -457,50 +457,6 @@ class BTSEPADirectDebitClient_Tests: XCTestCase {
}
}

func testTokenize_handleCreateMandateReturnsInvalidURL_returnsError_andSendsAnalytics() {
let mockWebAuthenticationSession = MockWebAuthenticationSession()
let mockSepaDirectDebitAPI = SEPADirectDebitAPI(apiClient: mockAPIClient)

mockAPIClient.cannedResponseBody = BTJSON(
value: [
"message": [
"body": [
"sepaDebitAccount": [
"approvalUrl": " ",
"last4": "1234",
"merchantOrPartnerCustomerId": "a-customer-id",
"bankReferenceToken": "a-bank-reference-token",
"mandateType": "ONE_OFF"
]
]
]
]
)

mockWebAuthenticationSession.cannedErrorResponse = NSError(
domain: SEPADirectDebitError.errorDomain,
code: SEPADirectDebitError.approvalURLInvalid.errorCode,
userInfo: ["Description": "Mock approvalURLInvalid error description."]
)

let sepaDirectDebitClient = BTSEPADirectDebitClient(
apiClient: mockAPIClient,
webAuthenticationSession: mockWebAuthenticationSession,
sepaDirectDebitAPI: mockSepaDirectDebitAPI
)

sepaDirectDebitClient.tokenize(request: sepaDirectDebitRequest) { nonce, error in
if error != nil, let error = error as NSError? {
XCTAssertEqual(error.domain, SEPADirectDebitError.errorDomain)
XCTAssertEqual(error.code, SEPADirectDebitError.approvalURLInvalid.errorCode)
XCTAssertEqual(error.localizedDescription, SEPADirectDebitError.approvalURLInvalid.localizedDescription)
XCTAssertEqual(self.mockAPIClient.postedAnalyticsEvents.last, "ios.sepa-direct-debit.create-mandate.failure")
} else if nonce != nil {
XCTFail("This request should return an error.")
}
}
}

func testTokenizeWithPresentationContext_handleWebAuthenticationSessionSuccessURLInvalid_returnsError_andSendsAnalytics() {
let mockWebAuthenticationSession = MockWebAuthenticationSession()
let mockSepaDirectDebitAPI = SEPADirectDebitAPI(apiClient: mockAPIClient)
Expand Down

0 comments on commit ba20d33

Please sign in to comment.