Skip to content

Commit bce0344

Browse files
abueideclaude
andcommitted
docs(rn): update test docs to use devbox run -e instead of wrapper scripts
Update README, cheatsheet, testing guide, and CI-CD docs to show the direct devbox run --pure -e pattern for platform-specific test execution instead of the removed wrapper scripts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5008058 commit bce0344

4 files changed

Lines changed: 26 additions & 44 deletions

File tree

examples/react-native/tests/README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -172,30 +172,26 @@ This ensures each test gets its own Metro instance on a unique port with isolate
172172

173173
## Platform-Specific Optimization
174174

175-
The wrapper scripts optimize startup time by skipping the unused platform:
175+
Skip unused platform setup with `-e` flags to speed up test startup:
176176

177177
```bash
178-
# iOS tests only (fast - skips Android SDK)
179-
./tests/run-ios-tests.sh
178+
# iOS tests only (fast - skips Android SDK evaluation)
179+
devbox run --pure -e ANDROID_SKIP_SETUP=1 test:e2e:ios
180180
181181
# Android tests only (fast - skips iOS setup)
182-
./tests/run-android-tests.sh
182+
devbox run --pure -e IOS_SKIP_SETUP=1 test:e2e:android
183+
184+
# Web tests (skip both mobile platforms)
185+
devbox run --pure -e ANDROID_SKIP_SETUP=1 -e IOS_SKIP_SETUP=1 test:e2e:web
183186
```
184187

185188
**Environment variables:**
186189
- `ANDROID_SKIP_SETUP=1` - Skip Android SDK Nix flake evaluation
187190
- `IOS_SKIP_SETUP=1` - Skip iOS environment setup
191+
- `EMU_HEADLESS=1` - Run Android emulator without display (CI)
192+
- `SIM_HEADLESS=1` - Run iOS simulator without display (CI)
188193

189-
**Important:** When using `--pure` mode, environment variables must be passed with the `-e` flag:
190-
```bash
191-
# Correct way to skip Android SDK in pure mode
192-
devbox run --pure -e ANDROID_SKIP_SETUP=1 test:e2e:ios
193-
194-
# Incorrect - env var gets reset to default
195-
ANDROID_SKIP_SETUP=1 devbox run --pure test:e2e:ios
196-
```
197-
198-
The wrapper scripts (`run-ios-tests.sh` and `run-android-tests.sh`) use the correct `-e` flag syntax automatically. This is particularly useful in CI/CD pipelines where you split platform tests into separate jobs.
194+
**Important:** When using `--pure` mode, environment variables must be passed with the `-e` flag. Variables set in the parent shell are stripped by `--pure`.
199195

200196
## Build Configuration
201197

wiki/guides/cheatsheets/react-native.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,12 @@ devbox run test:metro # Test Metro bundler setup
9090

9191
# User-defined scripts (add to your devbox.json shell.scripts):
9292
# "test": ["npm test"]
93-
# "test:e2e:android": ["bash tests/run-android-tests.sh"]
94-
# "test:e2e:ios": ["bash tests/run-ios-tests.sh"]
93+
# "test:e2e:android": ["process-compose -f tests/test-suite-android-e2e.yaml --no-server --tui=${TEST_TUI:-false}"]
94+
# "test:e2e:ios": ["process-compose -f tests/test-suite-ios-e2e.yaml --no-server --tui=${TEST_TUI:-false}"]
9595

96-
# With TUI (terminal UI)
97-
TEST_TUI=true devbox run test:e2e:android
96+
# Skip unused platform for faster startup
97+
devbox run --pure -e IOS_SKIP_SETUP=1 test:e2e:android
98+
devbox run --pure -e ANDROID_SKIP_SETUP=1 test:e2e:ios
9899
```
99100

100101
## Configuration

wiki/guides/testing.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -270,24 +270,17 @@ devbox run test:e2e:all # Both platforms in parallel
270270

271271
### Platform-Specific Optimization
272272

273-
Wrapper scripts skip the unused platform for faster startup:
273+
Skip the unused platform with `-e` flags for faster startup:
274274

275275
```bash
276276
# iOS tests only (skips Android SDK evaluation)
277-
./tests/run-ios-tests.sh
278-
279-
# Android tests only (skips iOS setup)
280-
./tests/run-android-tests.sh
281-
```
282-
283-
These scripts use the correct `-e` flag syntax to pass environment variables in pure mode:
284-
285-
```bash
286-
# iOS wrapper skips Android
287277
devbox run --pure -e ANDROID_SKIP_SETUP=1 test:e2e:ios
288278

289-
# Android wrapper skips iOS
279+
# Android tests only (skips iOS setup)
290280
devbox run --pure -e IOS_SKIP_SETUP=1 test:e2e:android
281+
282+
# Web tests (skips both mobile platforms)
283+
devbox run --pure -e ANDROID_SKIP_SETUP=1 -e IOS_SKIP_SETUP=1 test:e2e:web
291284
```
292285

293286
### React Native E2E Test Flow

wiki/project/CI-CD.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ TEST_TUI: false
177177
3. Setup platform-specific caches (Gradle/CocoaPods/Xcode)
178178
4. Install Devbox with package caching
179179
5. Run platform-specific test:
180-
- Android: `bash tests/run-android-tests.sh` (wrapper for optimization)
181-
- iOS: `bash tests/run-ios-tests.sh` (wrapper for optimization)
182-
- Web: `devbox run test:e2e:web`
180+
- Android: `devbox run --pure -e IOS_SKIP_SETUP=1 -e EMU_HEADLESS=1 test:e2e:android`
181+
- iOS: `devbox run --pure -e ANDROID_SKIP_SETUP=1 -e SIM_HEADLESS=1 test:e2e:ios`
182+
- Web: `devbox run --pure -e ANDROID_SKIP_SETUP=1 -e IOS_SKIP_SETUP=1 test:e2e:web`
183183
6. Upload artifacts on success or failure
184184

185185
**Artifacts uploaded:**
@@ -762,21 +762,13 @@ devbox run test:e2e
762762
cd examples/react-native
763763

764764
# Android
765-
EMU_HEADLESS=1 \
766-
BOOT_TIMEOUT=240 \
767-
TEST_TIMEOUT=600 \
768-
ANDROID_DEFAULT_DEVICE=min \
769-
bash tests/run-android-tests.sh
765+
devbox run --pure -e IOS_SKIP_SETUP=1 -e EMU_HEADLESS=1 test:e2e:android
770766

771767
# iOS
772-
SIM_HEADLESS=1 \
773-
BOOT_TIMEOUT=240 \
774-
TEST_TIMEOUT=600 \
775-
IOS_DEFAULT_DEVICE=min \
776-
bash tests/run-ios-tests.sh
768+
devbox run --pure -e ANDROID_SKIP_SETUP=1 -e SIM_HEADLESS=1 test:e2e:ios
777769

778770
# Web
779-
devbox run test:e2e:web
771+
devbox run --pure -e ANDROID_SKIP_SETUP=1 -e IOS_SKIP_SETUP=1 test:e2e:web
780772
```
781773

782774
### Examining Logs

0 commit comments

Comments
 (0)