-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
fix(local-e2e-script): add logic to handle maven local for iOS and Android accordingly #35104
Conversation
Base commit: 64c3906 |
0d6979c
to
cb123ee
Compare
Base commit: 64c3906 |
d8feea7
to
d484acf
Compare
scripts/test-e2e-local.js
Outdated
// FIXME: need to figure out how to generate the hermes stuff | ||
// (can I just do a pod install for RNTester iOS and use those files? need to find where they are stored) | ||
// and get the Hermes reference here for the next phase | ||
const hermesDir = 'help me'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed on discord, we should probably call these two scripts:
- build_mac_framework
- build_ios_framework
Then, we need to prepare the apple frameworks and finally, we can invokecreateHermessTarball
.
I still believe that we should also provide a way where we tell the scripts from where it can download all the stuff, saving hours of building, though.
But let's start by having a version that works!
72f3ca4
to
a643659
Compare
@kelset I am planning to rename the tarball methods in
Here's the PR: #35156 - I have updated all the internal references to these methods. I realize this would conflict with your PR. What do you think? Would renaming these have an adverse impact on other scripts from the community? Would you be okay rebasing your work on top of #35156 if it is merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Practically, we may potentially use the same generateiOSArtifacts
in CI directly! XD
@hramos go ahead and merge yours, yeah I'll have conflicts but I'm still in the testing phase for this one so it's likely that your PR will be quicker to land |
Question/idea for a later PR: do we want to setup a circleci job that runs this script? In that way, if someone commits something that could potentially break it, the check will ask him to also fix the script. WDYT? |
babac46
to
3befaef
Compare
update: now the PR should be ready, I've run a few more tests and done more tweaks. Every flow seems to be working as expected. re: @cipolleschi
No, I don't think there's value in running this script specifically - on CI it'd basically just build RNTester and RNTestProject, take a lot of time and not verify much that is not already verified by other CI jobs. The main advantage of this script is in the local scenario, where you want to have 1 handy command to get easily to have a local build working so that you can play around with it in the emulator/simulator. This topic overlaps with the E2E conversation that is been happening in parallel, so I'm sure that we'll be able to do some refactoring so that both the E2E flows and this script will have less custom code and we can generalize certain sections |
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
scripts/test-e2e-local.js
Outdated
} | ||
// set HERMES_ENGINE_TARBALL_PATH to point to the local artifacts I just created | ||
exec( | ||
`HERMES_ENGINE_TARBALL_PATH=${tarballOutputPath} USE_HERMES=${ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this part I don't particularly like because it means that if the tester needs to test something else with RNTestProject - ex. test that everything still works on JSC, they will have to do a new pod install without hermes, but if after that they want to test Hermes again they will have to manually pass this HERMES_ENGINE_TARBALL_PATH
variable during the pod install :(
Sadly because of limitations of shelljs we can't set ENV variables through it, and since there's no gradle.properties
equivalent we're stuck with this. Hopefully it won't create many attritions
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a nit comment with some context.
…ll use the local maven artifacts
This reverts commit 620a810.
…Project will succeed
…r RNTestProject will succeed" This reverts commit 0398ace.
0609a02
to
838bcd9
Compare
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @kelset in c540ff7. When will my fix make it into a release? | Upcoming Releases |
…droid accordingly (facebook#35104) Summary: This PR is a follow up of facebook#35075 and facebook@1546666 to ensure that even in the local e2e testing scenario the new maven approach is followed - without this, RNTestProject on Android won't work, like so: <img width="1905" alt="Screenshot 2022-10-27 at 12 15 38" src="https://user-images.githubusercontent.com/16104054/198334105-30fb2037-4e7c-4814-8c3f-2412ba0bd49f.png"> And iOS will always build everything from source every time. This PR addresses both by generating the artifacts locally, and passing them to RNTestProject as if they were coming from a url (mimicking as closely as possible the behaviour for the final user) In doing so, there's been some refactoring to prep the ground for follow up work. * refactor CI to rely less on scripts directly in the CircleCI config, but invoke .js ones * we should be able to trigger more the "manual" artifacts generation so that it will only happen once between RNTester and RNTestProject, and we can pass existing artifacts to the other flows. * once all of this in place, a very good improvement would be to be able to download the maven artifacts kind of like nightlies and stables do. This will only be viable by checking that there's no local changes, after which there needs to be logic to pull down from CircleCI the artifacts based on git commit <-> circleCI job references. --- While at it, I've also fixed the hermes-engine podspec logic for detecting if it's on CI: basically the local e2e script needs to align with the changes done here: facebook@4b51207 but as you can see there, the condition was actually inconsistent across the various files, so realigned to `CI === 'true'`. We probably didn't catch that so far 'cause the other condition in the hermes podspect (existence of `hermestag_file`) is only true on release branches and this new logic has not been in any release branches yet. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Internal] [Fixed] - add logic to local e2e script to handle maven local for iOS and Android accordingly Pull Request resolved: facebook#35104 Test Plan: Run ` yarn test-e2e-local -t RNTestProject -p Android` successfully. Run ` yarn test-e2e-local -t RNTestProject -p iOS` successfully. On the pod install stage, you will see `[Hermes] Using pre-built Hermes binaries from local path.` Reviewed By: dmytrorykun Differential Revision: D40893239 Pulled By: cipolleschi fbshipit-source-id: a31217ec4f177383c62292d00fabc4cbe4391cfd
Summary
This PR is a follow up of #35075 and 1546666 to ensure that even in the local e2e testing scenario the new maven approach is followed - without this, RNTestProject on Android won't work, like so:
And iOS will always build everything from source every time.
This PR addresses both by generating the artifacts locally, and passing them to RNTestProject as if they were coming from a url (mimicking as closely as possible the behaviour for the final user)
In doing so, there's been some refactoring to prep the ground for follow up work.
While at it, I've also fixed the hermes-engine podspec logic for detecting if it's on CI: basically the local e2e script needs to align with the changes done here: 4b51207
but as you can see there, the condition was actually inconsistent across the various files, so realigned to
CI === 'true'
. We probably didn't catch that so far 'cause the other condition in the hermes podspect (existence ofhermestag_file
) is only true on release branches and this new logic has not been in any release branches yet.Changelog
[Internal] [Fixed] - add logic to local e2e script to handle maven local for iOS and Android accordingly
Test Plan
Run
yarn test-e2e-local -t RNTestProject -p Android
successfully.Run
yarn test-e2e-local -t RNTestProject -p iOS
successfully. On the pod install stage, you will see[Hermes] Using pre-built Hermes binaries from local path.