Skip to content

Commit e4d0982

Browse files
authored
chore(release): Update release testing section for new E2E testing script (facebook#3368)
* remove E2E section until we'll re-add it post E2E setup * remove mention of the E2E script * rework the release testing page * add mention of where to find the info to turn on new arch * typo * re-add section
1 parent 20908b3 commit e4d0982

File tree

3 files changed

+69
-68
lines changed

3 files changed

+69
-68
lines changed

website/contributing/how-to-contribute-code.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ Please refer to the [Environment Setup](/docs/environment-setup) guide to setup
1717

1818
After cloning React Native, open the directory and run `yarn` to install its dependencies.
1919

20-
Then, you can run several commands:
20+
Now you are set up to run several commands:
2121

2222
- `yarn start` starts the Metro packager server.
2323
- `yarn lint` checks the code style.
2424
- `yarn format` automatically formats your code.
25-
- `yarn test` runs the JavaScript test suite.
26-
- `yarn test --watch` runs an interactive JavaScript test watcher.
27-
- `yarn test <pattern>` runs JavaScript tests with matching filenames.
25+
- `yarn test` runs the Jest-based JavaScript test suite.
26+
- `yarn test --watch` runs an interactive JavaScript test watcher.
27+
- `yarn test <pattern>` runs JavaScript tests with matching filenames.
2828
- `yarn flow` runs the [Flow](https://flowtype.org/) typechecks.
29-
- `yarn flow-check-android` does a full Flow check over `*.android.js` files.
30-
- `yarn flow-check-ios` does a full Flow check over `*.ios.js` files.
29+
- `yarn flow-check-android` does a full Flow check over `*.android.js` files.
30+
- `yarn flow-check-ios` does a full Flow check over `*.ios.js` files.
31+
- `yarn test-typescript` runs the [TypeScript](https://www.typescriptlang.org/) typechecks.
3132
- `yarn test-ios` runs the iOS test suite (macOS required).
32-
- `node ./scripts/run-ci-e2e-tests.js --js --android --ios` runs the end-to-tend JavaScript, Android, and iOS tests.
3333

3434
## Testing your Changes
3535

website/contributing/how-to-run-and-write-tests.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Xcode also allows running individual tests through its Test Navigator. You can a
4848
If you are making modifications to `Podfile` configurations then there are Ruby tests that can verify these.
4949

5050
To run the ruby tests:
51+
5152
```bash
5253
cd scripts
5354
sh run_ruby_tests.sh
@@ -79,16 +80,6 @@ Then, run the Android integration tests:
7980
./scripts/run-android-local-integration-tests.sh
8081
```
8182

82-
### End-to-end Tests
83-
84-
Finally, make sure end-to-end tests run successfully by executing the following script:
85-
86-
```bash
87-
./scripts/test-manual-e2e.sh
88-
```
89-
90-
This script will make you select to run the RNTester app (that lives within `packages/rn-tester`) or it will generate a fresh new project in `/tmp/RNTestProject`. Follow the step-by-step instructions from the script to test successfully if your changes.
91-
9283
## Writing Tests
9384

9485
Whenever you are fixing a bug or adding new functionality to React Native, it is a good idea to add a test that covers it. Depending on the change you're making, there are different types of tests that may be appropriate.

website/contributing/release-testing.md

Lines changed: 61 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,20 @@ id: release-testing
33
title: How to Test a Release
44
---
55

6-
## Test source in the release branch
7-
86
These steps needs to be followed by the release crew as part of the release process, to ensure that new versions published have a good level of stability.
97

10-
### Pre-requisites
8+
:::info
9+
10+
An important element of testing source in the release branch is that this process needs to be preferably be done twice, on two separate machines - there are multiple scenarios in which something might fail on a machine but not on another. By running tests on two computers, we want to reach a step of double confirmation that everything works fine.
11+
:::
12+
13+
## Pre-requisites
14+
15+
:::note
16+
17+
Currently, this flow can only be done on macOS machines.
18+
19+
:::
1120

1221
- Have a clone of `react-native` repo and be on the release branch (`0.XX-stable`).
1322

@@ -19,14 +28,18 @@ These steps needs to be followed by the release crew as part of the release proc
1928
echo '{}' > .watchmanconfig
2029
```
2130

22-
- Have Android and iOS development environment set-up. Follow instructions for macOS/iOS and macOS/Android from the [Environment Setup](/docs/environment-setup) guide.
31+
- Have Android and iOS development environment set-up. Follow instructions for `React Native CLI quickstart` for macOS/iOS and macOS/Android from the [Environment Setup](/docs/environment-setup) guide.
2332

2433
#### Additional steps for Android
2534

2635
- Gradle should now install [the appropriate NDK](https://github.com/facebook/react-native/blob/main/template/android/build.gradle). Verify that you have in your path the `ANDROID_NDK` variable, pointing to it.
2736
- In case you are on macOS Catalina (or higher), you might also need to run `sudo xattr -r -d com.apple.quarantine /path/to/ndk` to avoid the e2e script to fail. (_That said, this should not happen anymore since from NDK 21 and higher the Android team started signing the NDK._)
2837

29-
### Steps
38+
## Steps
39+
40+
### Clean up the local state
41+
42+
When testing locally, we want to ensure that we start from a clean slate to avoid caches polluting our testing.
3043

3144
1. Delete `RNTester` and `RNTestProject` from your Android emulator and iOS simulator if leftover from previous test.
3245
2. Remove any temporary files from the `react-native` repo:
@@ -35,76 +48,73 @@ These steps needs to be followed by the release crew as part of the release proc
3548
git clean -fdx
3649
```
3750

51+
For `main` branch, and versions of RN >=0.71, you can instead use `yarn test-e2e-local-clean`.
52+
3853
3. Install dependencies:
3954

4055
```bash
4156
yarn install
42-
pushd packages/rn-tester
43-
pod install --repo-update
44-
popd
4557
```
4658

47-
4. Use the `test-manual-e2e` script to test `RNTester` and the template app (`RNTestProject`):
59+
### Generating the projects
4860

49-
```bash
50-
# This will run you through the different variants in Test Dimensions table
51-
./scripts/test-manual-e2e.sh
52-
```
61+
The local testing for a release consist of running the [test project](https://github.com/facebook/react-native/tree/main/packages/rn-tester) of the react-native repository, `RNTester`, which contains an in-depth list of components implementations, and generating a fresh new project based on the local code, `RNTestProject`, that will simulate accurately how a `react-native init` project will behave.
5362

54-
5. Turn on Hermes in the `RNTestProject` and ensures it builds successfully.
63+
To generate the the right project with the specific configuration desired, you can use the command
5564

56-
- Enable Hermes for Android:
65+
```bash
66+
yarn test-e2e-local [options]
67+
```
5768

58-
```bash
59-
# Update `/tmp/RNTestProject/android/app/build.gradle` to `enableHermes`
60-
project.ext.react = [
61-
enableHermes: true, // clean and rebuild if changing
62-
]
69+
Followed by the wanted options:
6370

64-
# Clean and rebuild
65-
/tmp/RNTestProject/android$ ./gradlew clean
66-
/tmp/RNTestProject$ npx react-native run-android
67-
```
71+
```bash
72+
--help Show help [boolean]
73+
--version Show version number [boolean]
74+
-t, --target [choices: "RNTester", "RNTestProject"] [default: "RNTester"]
75+
-p, --platform [choices: "iOS", "Android"] [default: "iOS"]
76+
-h, --hermes [boolean] [default: true]
77+
```
6878

69-
- Enable Hermes for iOS:
79+
#### Versions older than 71
7080

71-
```bash
72-
# Update `/tmp/RNTestProject/ios/Podfile` and then run `pod install`
73-
use_react_native!(
74-
:path => config[:reactNativePath],
75-
# to enable hermes on iOS, change `false` to `true` and then install pods
76-
:hermes_enabled => true
77-
)
81+
You need to use the interactive script run you through the different variants in [Test Dimensions](#test-dimensions):
7882

79-
# Install pods and run
80-
/tmp/RNTestProject/ios$ pod install
81-
/tmp/RNTestProject$ npx react-native run-ios
82-
```
83+
```bash
84+
./scripts/test-manual-e2e.sh
85+
```
8386

84-
### Test Dimensions
87+
This script will ask you to select which platform and which project you want to test, and then to execute a series of extra steps during the process. Bear in mind, when testing RNTester on Android, you need to start the Android emulator ahead of time or it will fail.
8588

86-
Covered by running `test-manual-e2e.sh`, see [issue](https://github.com/facebook/react-native/issues/33015) about supporting those "manual" cases.
89+
## What to test?
8790

88-
| Variant | RNTester | Template App |
89-
| ---------------- | ------------------------ | ------------------------ |
90-
| Android - JSC | via `test-manual-e2e.sh` | via `test-manual-e2e.sh` |
91-
| Android - Hermes | via `test-manual-e2e.sh` | manual |
92-
| iOS - JSC | via `test-manual-e2e.sh` | via `test-manual-e2e.sh` |
93-
| iOS - Hermes | via `test-manual-e2e.sh` | manual |
91+
Aside from verifying that the building process is successful, once the app spawn by the script is up and running, we want to run a series of manual tests to ensure that some core functionalities work, like Fast Refresh and the Flipper debugger.
9492

95-
**Note well:** Starting from RN 0.70, Hermes is turned on by default so for the template app JSC will need to be manually tested by switching off Hermes.
93+
In the `RNTester` you want to also play around with the app and try different components: some important onces are `Flatlist`, `Image` and the "New Architecture Component" (should be the very last one in the list).
9694

97-
### What to test?
95+
### Test Dimensions
9896

99-
Aside from verifying that the building process is successful, once the app spawn by `test-manual-e2e.sh` is up and running, we want to run a series of manual tests to ensure that some core functionalities work, like Fast Refresh and the Flipper debugger.
97+
To ensure that we cover the most use cases, we need to ensure we test all these different combination of configurations:
10098

101-
In the `RNTester` you want to also play around with the app and try different components: some important onces are `Flatlist`, `Image` and the "New Architecture Component" (should be the very last one in the list).
99+
- RNTester + iOS + Hermes
100+
- RNTester + iOS + JSC
101+
- RNTester + Android + Hermes
102+
- RNTester + Android + JSC
103+
- RNTestProject + iOS + Hermes
104+
- RNTestProject + iOS + JSC
105+
- RNTestProject + Android + Hermes
106+
- RNTestProject + Android + JSC
107+
108+
:::note
109+
110+
Bear in mind that RNTester project is already onboarded in the new architecture. `RNTestProject` is not - new architecture mode needs to be [enabled](/docs/the-new-architecture/use-app-template#enable-the-new-architecture) and tested separately.
111+
:::
102112

103-
An important element of testing source in the release branch is that this process needs to be preferably be done twice, on two separate machines - there are multiple scenarios in which something might fail on a machine but not on another. By running tests on two computers, we want to reach a step of "double confirmation" that everything works fine.
113+
## Testing pre-releases (RC) on production apps
104114

105-
## Testing an RC on a project - checklist
115+
During the Release Candidate (RC) phase of a release cycle, we ask for the community to set as dependency in their apps the latest RC available and report in the related "Road to 0.XX" how it performs ([example](https://github.com/reactwg/react-native-releases/discussions/26)).
106116

107-
If you are a [release tester](./release-roles-responsibilities#release-tester-responsibilities), the ask for you is to set as dependency in your app the latest RC available and report in the related "Road to 0.XX" how it went ([example](https://github.com/reactwg/react-native-releases/discussions/26)). To help provide the relevant information, we have prepared this template: you can copy/pasted it in a comment and fill it accordingly.
117+
To help provide the relevant information, we have prepared this template they can use as blueprint for what is important to test - they can copy/pasted it in a comment and fill it accordingly.
108118

109119
```markdown
110120
| Link to branch: | |

0 commit comments

Comments
 (0)