-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
[LOCAL][Release-Testing] Update the testing script to use the new template #45144
[LOCAL][Release-Testing] Update the testing script to use the new template #45144
Conversation
const pathToTemplate = path.join(templateRepoFolder, 'template'); | ||
|
||
// Cleanup template clone folder | ||
exec(`rm -rf ${templateRepoFolder}`); |
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.
Can we keep the cleanup?
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 folder does not exists anymore. it was pointing to /tmp/template which was the folder where we were cloning the template. We are not cloning the template anymore, so the folder is gone (line 247) and also the cleanup should go at this point.
scripts/e2e/init-template-e2e.js
Outdated
const appPackageJson = JSON.parse( | ||
fs.readFileSync(appPackageJsonPath, 'utf8'), | ||
); | ||
appPackageJson.dependencies['react-native'] = |
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 shouldn't be a file://
dependency, just the version so it uses Verdaccio.
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.
nope, we want to use the exact same version we built in CI, so we download react native and we use the local file.
Having it to point to the locally published package means that we are going to rebuild react native locally, especially for Android, and we want to avoid that.
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.
Also, React Native is NOT published on Verdaccio, AFAIK.
Base commit: 4a8f0ee |
787f4b8
to
3c48bdc
Compare
scripts/e2e/init-template-e2e.js
Outdated
--directory ${directory} \ | ||
--template ${templatePath} \ | ||
--version next \ |
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.
Note: this won't work for rc.0
the next time.
Let's use it for now to unblock us but this now assumes the template is already published before be do the testing which is not the case.
I think the most correct way to do would be to:
- git clone the template
- git checkout to the
0.75-stable
branch (i.e. the same branch this script is executed from). - Update the template to align
react-native
and all the@react-native/*
dependencies. - Run
npm pack
to create a tarball of the template - Run
npx npx @react-native-community/cli@next init ${projectName} --template file://{path-to-packaged-template}
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.
the current approach doesn't work to test older versions of react native.
But also the steps highlighted here don't work, unless we have a release branch for the template as well. 🤔
The problem is that, when we test RC1, for example, React Native RC1 has not been published yet. And locally, the version of react native has not been updated yet. So:
- we are testing RC1, while the version in React native is still RC0
- we need to automate the creation of template release branches
🤔 🤔 🤔 🤔 🤔
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.
We can pass an extra parameter to the script, though... We can:
- pass a new
-v
with the version we want to test - run set-version to bump everything locally to the right version
- run the Verdaccio to publish the packages in the versions we actually want to test
- Assuming that we are in the release branch and that a release branch with the exact same name exists in the template, we can apply your steps.
3c48bdc
to
09b3bd7
Compare
Summary:
This PR applies changes to the testing script for releases so that it can use the new template and the new react-native-community/cli
Changelog:
[Internal] - Make the release testing script use the community/cli
Test Plan:
Tested locally