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

Incompatibility with Android RN master TimingModule #1801

Closed
4-rodrigo-salazar opened this issue Dec 15, 2019 · 14 comments · Fixed by #1858
Closed

Incompatibility with Android RN master TimingModule #1801

4-rodrigo-salazar opened this issue Dec 15, 2019 · 14 comments · Fixed by #1858

Comments

@4-rodrigo-salazar
Copy link
Contributor

Describe the bug
FYI: It looks like at least 2 things the Detox android implementation depends on are no longer true in RN master in regards to the timers implementation.

To Reproduce
Test Detox against react native master and run into these build issues.

cc @cs01

@d4vidi
Copy link
Collaborator

d4vidi commented Dec 15, 2019

@rodrigos-facebook wow, a big thank-you for this!!! We'll make the proper adaptation.
As I understand it (looking at the commits log) we ought to expect these changes to apply starting RN .62.0, right?

@cs01
Copy link
Contributor

cs01 commented Dec 16, 2019

FYI we have added internal land-blocking tests at facebook that ensure iOS compatibility between Detox and React Native. We are planning to add similar tests for Android once a new Detox version with fixes for the issues Rodrigo described have been published. By doing this we hope to avoid landing React Native changes to master that break the React Native/Detox interface, or at least be more proactive in fixing them before landing breaking changes in the React Native codebase.

@d4vidi
Copy link
Collaborator

d4vidi commented Dec 16, 2019

This is very exciting. Great to hear!

@ejanzer
Copy link

ejanzer commented Dec 16, 2019

I've put up a PR to add a new API to TimingModule that should expose the information that Detox needs: facebook/react-native#27539

If that API does what we need, then we should be able to use that instead of updating Detox to refer to the new class name. I basically just copied what Detox does in TimersIdlingResource based on the discussion in #907.

@rotemmiz
Copy link
Member

Just a thought about everything going on in here (at 01:04 AM), if we are already getting help from Facebook on this, setting up RN to fit Detox's needs, we might as well want to think of official espresso Idling resources like APIs, which are event based and not polling based, integrating idling resources inside RN itself, like described here https://developer.android.com/training/testing/espresso/idling-resource#integrate-recommended-approach

Disclaimer: I haven't read the whole thread or web over the PR, but want to make sure we're moving in the recommended espresso way. I will read everything and revise this comment if needed.

@ejanzer
Copy link

ejanzer commented Dec 18, 2019

@rotemmiz

I'd definitely be interested in looking into using proper idling resources in RN for in the future, but I don't think I want to try to make that change right now - I'm working on rewriting some pieces of our infra to no longer use the bridge, so I'd probably try to make that change as part of that effort, rather than refactoring our existing code. With this PR I was just trying to do a simple fix so that Detox doesn't have to rely on reflection (since I broke that by renaming + refactoring the Timing class).

What do you think? Is that PR a good step forward for now, or would you rather just keep using reflection for now, and update the class name, etc.?

@rotemmiz
Copy link
Member

I'd choose to avoid reflection as much possible, but it's for @d4vidi to decide on this question.

@d4vidi
Copy link
Collaborator

d4vidi commented Jan 7, 2020

@ejanzer There's no real need for reflection here but for the sake of accessing internals. Seems like your changes in facebook/react-native#27539, then, will eliminate usage of reflection altogether!

Anyways again as I already mentioned in facebook/react-native#27539, it's IMO ok to first fix this part, then when we're ready for the transition to event-based implementations... well, we already know what we're up against.

The question I'm asking myself now is whether this can be closed until your facebook/react-native#27539 is merged in, or should we already have this fixed for 0.62 RC's out there?

@TheSavior
Copy link

We have product teams at FB using Detox to test against master. Unfortunately this is currently broken because of the timer refactor. While an event based API might be architecturally best, it will take longer to make happen as @ejanzer doesn’t have the bandwidth to work on it.

I’d like for us to move forward if possible with the existing PR to get detox working as quickly as possible against 0.62 so we can reenable our product team’s tests. Any support we could get to do so would be greatly appreciated.

@d4vidi
Copy link
Collaborator

d4vidi commented Jan 8, 2020

@TheSavior I'd be more than happy to move forward -- I wasn't suggesting to wait for the rearchitecture, just basically asking whether we could wait for facebook/react-native#27539 to be merged in so as to avoid reimplementing this twice.

@d4vidi
Copy link
Collaborator

d4vidi commented Jan 8, 2020

Well as facebook/react-native#27539 has been merged, it seems, I'll switch to using the newly timers interrogation API by @ejanzer. Cool with everyone?

@TheSavior
Copy link

Yep, that's what I meant. Moving forward with the new API seems like a good idea

@d4vidi
Copy link
Collaborator

d4vidi commented Jan 8, 2020

consider it done

@d4vidi
Copy link
Collaborator

d4vidi commented Jan 20, 2020

Released under 15.1.3 @ejanzer

@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants