Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Functions integration tests to Swift #8957

Merged
merged 3 commits into from Nov 11, 2021
Merged

Conversation

paulb777
Copy link
Member

Future PRs will:

  • Add a CocoaPods test_spec for the Swift integration tests
  • Add async/await variations of the tests
  • Review API coverage
  • Prepare for Codable PR integration - See [WIP] FirebaseFunctionsSwift #8854

@google-cla google-cla bot added the cla: yes label Nov 11, 2021
@google-oss-bot
Copy link

1 Warning
⚠️ Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.)

Generated by 🚫 Danger

Copy link
Contributor

@maksymmalyhin maksymmalyhin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM, a couple non-blocking nits.

Copy link
Member Author

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough review and good suggestions!

@paulb777 paulb777 merged commit f023aa5 into master Nov 11, 2021
@paulb777 paulb777 deleted the pb-functions-swift-int branch November 11, 2021 16:34
Comment on lines +153 to +161
do {
XCTAssertNotNil(error)
let error = try XCTUnwrap(error) as NSError
XCTAssertEqual(FunctionsErrorCode.internal.rawValue, error.code)
XCTAssertEqual("Response is missing data field.", error.localizedDescription)
expectation.fulfill()
} catch {
XCTAssert(false, "Failed to unwrap the function result: \(error)")
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. You can avoid the do {} catch {} blocks by adding throws to the test method signature. If the XCTUnwrap fails, it'll highlight the line with the failing unwrap.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it will work if XCTUnwrap is used inside of the closure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right @maksymmalyhin That's what I found:

Screen Shot 2021-11-11 at 8 40 56 AM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, never thought about that. Makes sense, thanks for pointing that out y'all!

@firebase firebase locked and limited conversation to collaborators Dec 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants