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

Apple TV support 2: Xcode projects and CI (scripts/objc-test.sh) #10227

Closed
wants to merge 11 commits into from

Conversation

douglowder
Copy link
Contributor

  • Motivation *

Second PR for Apple TV support.

  • Test plan *

Apple TV tests have been added to scripts/objc-test.sh

@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @mmmulani and @fkgozali to be potential reviewers.

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Oct 3, 2016
@douglowder
Copy link
Contributor Author

Hmmm... Travis CI failed because their build doesn't have a tvOS 10 simulator. Will downgrade the build targets and see if that fixes it.

@facebook-github-bot
Copy link
Contributor

@dlowder-salesforce updated the pull request - view changes

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 3, 2016
@facebook-github-bot
Copy link
Contributor

@dlowder-salesforce updated the pull request - view changes

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 4, 2016
@douglowder
Copy link
Contributor Author

@javache here is Apple TV round 2 :)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 4, 2016
Copy link
Member

@javache javache left a comment

Choose a reason for hiding this comment

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

Looks good!

@@ -946,6 +955,9 @@ - (type)getter \
#if !TARGET_OS_TV
RCT_SET_AND_PRESERVE_OFFSET(setPagingEnabled, isPagingEnabled, BOOL)
RCT_SET_AND_PRESERVE_OFFSET(setScrollsToTop, scrollsToTop, BOOL)
#else
RCT_EMPTY_BOOL_GETTER_SETTER(setPagingEnabled, isPagingEnabled)
Copy link
Member

Choose a reason for hiding this comment

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

Why is this necessary? I believe RN wil automatically ignore attributes that are not exported by a view manager (which is how we OS-specific attributes)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I didn't make this change, I got an "unrecognized selector" [RCTScrollView setScrollsToTop] when attempting to run a modified version of UIExplorer to try some of the snapshot tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks to your hint I found the correct way to do this... committing a fix.

@@ -14,7 +14,7 @@ case "$CONFIGURATION" in
Debug)
# Speed up build times by skipping the creation of the offline package for debug
# builds on the simulator since the packager is supposed to be running anyways.
if [[ "$PLATFORM_NAME" = "iphonesimulator" ]]; then
if [[ "$PLATFORM_NAME" = "iphonesimulator" || "$PLATFORM_NAME" = "appletvsimulator" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Maybe regex match on 'simulator$'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@facebook-github-bot
Copy link
Contributor

@dlowder-salesforce updated the pull request - view changes

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 4, 2016
@facebook-github-bot
Copy link
Contributor

@dlowder-salesforce updated the pull request - view changes

@facebook-github-bot
Copy link
Contributor

@dlowder-salesforce updated the pull request - view changes

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 4, 2016
@@ -73,6 +73,7 @@ - (void)tearDown

- (void)testBundleURL
{
#if !TARGET_OS_TV
Copy link
Member

Choose a reason for hiding this comment

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

How is this this test broken on tvOS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe this is an issue with the new Xcode and not with tvOS, but the URL string was using the IP address of the host instead of "localhost". I can revert this change and see if it passes in CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted.

@@ -97,7 +97,6 @@ RCT_EXTERN NSString *const RCTUIManagerRootViewKey;
* @param reactTag the component tag
* @param completion the completion block that will hand over the rootView, if any.
*
* @return the rootView
Copy link
Member

Choose a reason for hiding this comment

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

Revert?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That change fixes an actual doc error -- the method does not in fact return anything.

2D3B5EEF1D9B09DC00451313 /* RCTViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */; };
2D3B5EF01D9B09E300451313 /* RCTWrapperViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080241A694A8400A75B9A /* RCTWrapperViewController.m */; };
2D3B5EF11D9B09E700451313 /* UIView+React.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067541A70F44B002CDEE1 /* UIView+React.m */; };
2D8C2E331DA40441000EE098 /* RCTMultipartStreamReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCCF1D8381DE008E587E /* RCTMultipartStreamReader.m */; };
Copy link
Member

Choose a reason for hiding this comment

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

Any idea why all of these were added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those are to include the files in the tvOS build.

@@ -73,5 +72,7 @@ - (UIInterfaceOrientationMask)supportedInterfaceOrientations
return _supportedInterfaceOrientations;
}
#endif
#endif
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment here to clarify what each of the if's are closing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -930,7 +930,7 @@ - (type)getter \
{ \
return [_scrollView getter]; \
}

Copy link
Member

Choose a reason for hiding this comment

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

Revert :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@facebook-github-bot
Copy link
Contributor

@dlowder-salesforce updated the pull request - view changes

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 4, 2016
@facebook-github-bot
Copy link
Contributor

@dlowder-salesforce updated the pull request - view changes

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 5, 2016
@javache
Copy link
Member

javache commented Oct 5, 2016

@facebook-github-bot shipit

@facebook-github-bot facebook-github-bot added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels Oct 5, 2016
@facebook-github-bot
Copy link
Contributor

Thanks for importing. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 5, 2016
@bestander
Copy link
Contributor

@dlowder-salesforce, I think this PR's unit tests are consistently failing:

Executed 123 tests, with 0 failures (0 unexpected) in 5.127 (5.227) seconds
All tests
Test Suite UIExplorer-tvOSIntegrationTests.xctest started
RCTLoggingTests
    ✗ testLogging, ((_lastLogLevel) equal to (RCTLogLevelError)) failed: ("2") is not equal to ("3")
    ✗ testLogging, ((_lastLogMessage) equal to (@"Invoking console.error")) failed: ("Warning: Native component for "RCTDatePicker" does not exist") is not equal to ("Invoking console.error")
    ✗ testLogging,
RCTRootViewIntegrationTests
    ✗ testPropertiesUpdateTest, failed: caught "NSInternalInconsistencyException", "RedBox error: Unhandled JS Exception: undefined is not an object (evaluating 'StatusBarManager.HEIGHT')"
    ✗ testPropertiesUpdateTest,
    ✗ testReactContentSizeUpdateTest, failed: caught "NSInternalInconsistencyException", "RedBox error: Unhandled JS Exception: Module AppRegistry is not a registered callable module (calling runApplication)"

https://travis-ci.org/facebook/react-native/jobs/165251326

@ghost
Copy link

ghost commented Oct 5, 2016

Weird.... the tests were passing locally.

@bestander
Copy link
Contributor

It could be sensitive to CI device performance or XCode version

On 6 October 2016 at 00:36, douglowder notifications@github.com wrote:

Weird.... the tests were passing locally.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#10227 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACBdWDOtm4WaS-NFkrh0FwxU-Cdv4vQcks5qxDR2gaJpZM4KNFqO
.

@ghost
Copy link

ghost commented Oct 5, 2016

Hmmm maybe put the Apple TV objc-test.sh in a separate script?

@bestander
Copy link
Contributor

Yeah, let's give it a try.
Either this or disable it for now, otherwise we lose signal from all iOS
builds.

On Thursday, 6 October 2016, douglowder notifications@github.com wrote:

Hmmm maybe put the Apple TV objc-test.sh in a separate script?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#10227 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACBdWEVCmYzV4TdgZDhZwxVCS8M5w4Xeks5qxDhzgaJpZM4KNFqO
.

rozele pushed a commit to microsoft/react-native-windows that referenced this pull request Oct 13, 2016
Summary:
* Motivation *

Second PR for Apple TV support.

* Test plan *

Apple TV tests have been added to scripts/objc-test.sh
Closes facebook/react-native#10227

Differential Revision: D3974064

Pulled By: javache

fbshipit-source-id: 36dffb4517efa489e40fa713a30655d1d76ef646
cpojer pushed a commit to facebook/metro that referenced this pull request Jan 26, 2017
Summary:
* Motivation *

Second PR for Apple TV support.

* Test plan *

Apple TV tests have been added to scripts/objc-test.sh
Closes facebook/react-native#10227

Differential Revision: D3974064

Pulled By: javache

fbshipit-source-id: 36dffb4517efa489e40fa713a30655d1d76ef646
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Import Started This pull request has been imported. This does not imply the PR has been approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants