You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: website/contributing/how-to-run-and-write-tests.md
+1-10Lines changed: 1 addition & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@ Xcode also allows running individual tests through its Test Navigator. You can a
48
48
If you are making modifications to `Podfile` configurations then there are Ruby tests that can verify these.
49
49
50
50
To run the ruby tests:
51
+
51
52
```bash
52
53
cd scripts
53
54
sh run_ruby_tests.sh
@@ -79,16 +80,6 @@ Then, run the Android integration tests:
79
80
./scripts/run-android-local-integration-tests.sh
80
81
```
81
82
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
-
92
83
## Writing Tests
93
84
94
85
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.
Copy file name to clipboardExpand all lines: website/contributing/release-testing.md
+61-51Lines changed: 61 additions & 51 deletions
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,20 @@ id: release-testing
3
3
title: How to Test a Release
4
4
---
5
5
6
-
## Test source in the release branch
7
-
8
6
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.
9
7
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
+
:::
11
20
12
21
- Have a clone of `react-native` repo and be on the release branch (`0.XX-stable`).
13
22
@@ -19,14 +28,18 @@ These steps needs to be followed by the release crew as part of the release proc
19
28
echo'{}'> .watchmanconfig
20
29
```
21
30
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.
23
32
24
33
#### Additional steps for Android
25
34
26
35
- 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.
27
36
- 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._)
28
37
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.
30
43
31
44
1. Delete `RNTester` and `RNTestProject` from your Android emulator and iOS simulator if leftover from previous test.
32
45
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
35
48
git clean -fdx
36
49
```
37
50
51
+
For `main` branch, and versions of RN >=0.71, you can instead use `yarn test-e2e-local-clean`.
52
+
38
53
3. Install dependencies:
39
54
40
55
```bash
41
56
yarn install
42
-
pushd packages/rn-tester
43
-
pod install --repo-update
44
-
popd
45
57
```
46
58
47
-
4. Use the `test-manual-e2e` script to test `RNTester` and the template app (`RNTestProject`):
59
+
### Generating the projects
48
60
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.
53
62
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
55
64
56
-
- Enable Hermes for Android:
65
+
```bash
66
+
yarn test-e2e-local [options]
67
+
```
57
68
58
-
```bash
59
-
# Update `/tmp/RNTestProject/android/app/build.gradle` to `enableHermes`
60
-
project.ext.react = [
61
-
enableHermes: true, // clean and rebuild if changing
# 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):
78
82
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
+
```
83
86
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.
85
88
86
-
Covered by running `test-manual-e2e.sh`, see [issue](https://github.com/facebook/react-native/issues/33015) about supporting those "manual" cases.
| 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.
94
92
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).
96
94
97
-
### What to test?
95
+
### Test Dimensions
98
96
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:
100
98
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
+
:::
102
112
103
-
An important element of testing sourcein 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
104
114
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)).
106
116
107
-
If you are a [release tester](./release-roles-responsibilities#release-tester-responsibilities), the ask foryou is to set as dependencyin 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.
0 commit comments