[go: nahoru, domu]

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

Functions Interop #2113

Merged
merged 24 commits into from
Dec 6, 2018
Merged

Functions Interop #2113

merged 24 commits into from
Dec 6, 2018

Conversation

bstpierr
Copy link
Contributor

Convert Firebase Functions to use the Auth Interop pod

Convert Firebase Functions to use the Auth Interop pod
@bstpierr
Copy link
Contributor Author

I now have Travis passing all the tests on this PR. Please have a look.

@ryanwilson
Copy link
Member

Looks like there's a Travis issue: https://travis-ci.org/firebase/firebase-ios-sdk/jobs/460759039#L7046

@bstpierr
Copy link
Contributor Author

Yeah, seems I removed too much of my previous PR. I'm not 100% which path included the container header, but I'll fiddle with it and look at where CocoaPods puts everything.

I also attempted moving the FakeApp class to the test targets and further simplified the project file.
Copy link
Contributor Author
@bstpierr bstpierr left a comment

Choose a reason for hiding this comment

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

I'm still not sure why this project would have difficulty finding the headers when the main Example one doesn't.

Functions/Example/Podfile Outdated Show resolved Hide resolved
I also moved the Podfile pods to the app target rather than the top-level
- Remove `FUNFakeApp` from app target
+ Add `FUNFakeApp` to test targets
+ Add `$(inherited)` to `HEADER_SEARCH_PATH` as per CocoaPods warning
+ Add `$(SRCROOT)/../../Firebase/Core/Private` to find `FIRComponentContainerInternal` header
~ Change import from frameworks import to regular import
@bstpierr
Copy link
Contributor Author
bstpierr commented Dec 4, 2018

This should ready to review again. I was able to get everything compiling and passing once I could iterate quickly with build.sh.

Copy link
Member
@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.

LGTM, please get Ryan's LGTM also.

Copy link
Member
@ryanwilson ryanwilson left a comment

Choose a reason for hiding this comment

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

LGTM, just two small nits for cleanup!

Functions/FirebaseFunctions/FIRFunctions.m Outdated Show resolved Hide resolved
Functions/FirebaseFunctions/FIRFunctions.m Outdated Show resolved Hide resolved
@bstpierr bstpierr assigned bklimt and unassigned ryanwilson Dec 4, 2018
@bstpierr
Copy link
Contributor Author
bstpierr commented Dec 4, 2018

Hi Bryan, could you have a look at this CL which moves Functions to the new Interop platform.

Copy link
Contributor
@bklimt bklimt 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 doing this. Overall, it looks like a good change. But I was confused about what's happening in one of the tests, and I think we can simplify this to make it more obvious what's going on.

FIRFunctions *functions = [[FIRFunctions alloc]
initWithApp:app
region:@"my-region"
auth:[[FIRAuthInteropFake alloc] initWithToken:nil userID:nil error:nil]];
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 understand why this passes. Shouldn't functions be using the FIRAuthInteropFake's token instead of the one passed into the FUNFakeApp?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm also unsure how this was passing.

It looks like callFunction would have an empty Authorization header, but maybe the mock server still returns an empty data response with a 200 OK?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I bet it wasn't passing. Travis doesn't run the integration tests on PRs, just the master branch. I'll run them locally to make sure they're passing now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm having difficulty running the integration tests. I get many warnings when running Backend/start.sh instructions. See this gist of the output I get.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed my system to node 8, and ran through the suggestions it printed out, and it seems as though it's connecting to the emulator, but I'm not sure it's behaving as expected.

For example, the testData test case gets the error: Function dataTest in location my-region in project functions-integration-test does not exist in its FIRHTTPSCallableResult callback.

From the emulator's output, it looks like my-region isn't what's expected, but rather us-central1 since it outputs http://localhost:5005/functions-integration-test/us-central1/dataTest as the resource.

Switching the tests to using us-central1 as the region has all the tests but one passing. The testNull attempts to wait on an expectation twice, which is an API violation that throws an error.

Are the integration tests expected to pass? I'm not sure how they would on master without the region change and the duplicate waitForExpectation: call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It appears as though the last green run of master compiled the integration tests, but only ran the unit tests.

It seems as though the integration tests aren't being run on Travis.

I'll open an internal bug to fix and enable theses.

Copy link
Contributor

Choose a reason for hiding this comment

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

From the emulator's output, it looks like my-region isn't what's expected, but rather us-central1

Yes, the shell script in Backend/ that installs the functions says to install them in us-central1. Not sure when that broke.

Functions/Example/Tests/FIRFunctionsTests.m Outdated Show resolved Hide resolved
Functions/FirebaseFunctions/FIRFunctions.m Outdated Show resolved Hide resolved
- Delete `FUNFakeApp`
+ Add `FIRAuthInteropFake` to test targets
~ Update initializer to use projectID instead of app
@bstpierr
Copy link
Contributor Author
bstpierr commented Dec 6, 2018

Thank you for the comments @bklimt. Please have a look at my comments regarding the integration tests. I think I got to the root of what is happening.

* Set the region to the expected value
* Update node package.json to latest versions
Copy link
Contributor
@bklimt bklimt 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 taking the time to get the integration tests passing again.

@bstpierr bstpierr merged commit 87a206e into master Dec 6, 2018
bstpierr added a commit that referenced this pull request Dec 6, 2018
* master: (26 commits)
  Functions Interop (#2113)
  Add a travis cron job for CocoaPod symbol collision testing (#2154)
  Save schema version on downgrade, add test to verify (#2153)
  Silence Storage Unit Test `nil` warning. (#2150)
  Update versions for Release 5.14.0 (#2145)
  gRPC: fix cases where gRPC call could be finished twice (#2146)
  Fix Swizzler test warnings (#2144)
  Update Auth CHANGELOG.md (#2128)
  Make fuzz tests optional until they pass (#2143)
  Add support of Game Center sign in (#2127)
  Add test for deprecated FDLURLComponents init API. (#2133)
  fix a typo in integration test (#2131)
  Make fuzzing less verbose to avoid exceeding Travis log limit (#2126)
  Move to `domainURIPrefix` for FIRDynamicLinkComponents (#2119)
  Carthage instructions for new gRPCCertificates.bundle location (#2132)
  Fix pod lib lint GoogleUtilities.podspec --use-libraries regression (#2130)
  Avoid using default FIROptions directly. (#2124)
  Changelog entry for LRU GC (#2122)
  Revert "Add Firebase Source to Header Search Path" (#2123)
  Custom fdl domain (#2121)
  ...
@bstpierr bstpierr deleted the bs-funcauth branch January 2, 2019 01:04
@firebase firebase locked and limited conversation to collaborators Oct 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants