Skip to content

Commit 27ed528

Browse files
author
Krzysztof Borowy
committed
separate e2e tests
1 parent dd21b80 commit 27ed528

File tree

2 files changed

+62
-35
lines changed

2 files changed

+62
-35
lines changed

.circleci/config.yml

Lines changed: 61 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,45 @@ cache:
117117
keys:
118118
- *key_pods
119119

120+
121+
# ==============================
122+
# COMMANDS
123+
# ==============================
124+
125+
commands:
126+
run_android_e2e:
127+
parameters:
128+
testScript:
129+
type: string
130+
default: test:e2e:android:next
131+
steps:
132+
- *addWorkspace
133+
- run:
134+
name: Start emulator in background
135+
background: true
136+
command: |
137+
emulator -avd "Emu_E2E" \
138+
-cores 1 \
139+
-gpu auto \
140+
-accel on \
141+
-memory 1024 \
142+
-no-audio \
143+
-no-snapshot \
144+
-no-boot-anim \
145+
-no-window \
146+
-logcat '*:E ReactNative:W ReactNativeJS:*'
147+
- run:
148+
name: Wait for emulator to boot
149+
command: ./scripts/android_e2e.sh 'wait_for_emulator'
150+
- run:
151+
name: Wake device
152+
command: |
153+
adb shell input keyevent 82
154+
- run:
155+
name: Run e2e tests
156+
command: yarn << parameters.testScript >>
157+
158+
120159
# ==============================
121160
# JOBS
122161
# ==============================
@@ -228,6 +267,17 @@ jobs:
228267
- example/android/app/build/outputs/apk/*
229268

230269
"Test: Android e2e":
270+
<<: *macos_defaults_android
271+
steps:
272+
- run_android_e2e:
273+
testScript: "test:e2e:android"
274+
275+
"Test: Android e2e Next":
276+
<<: *macos_defaults_android
277+
steps:
278+
- run_android_e2e
279+
280+
"Build: Prepare android e2e environment":
231281
<<: *macos_defaults_android
232282
steps:
233283
- *addWorkspace
@@ -257,13 +307,6 @@ jobs:
257307
yes | sdkmanager "build-tools;28.0.3" 1> /dev/null
258308
yes | sdkmanager --licenses 1> /dev/null
259309
yes | sdkmanager --list
260-
- run:
261-
name: ADB start/stop
262-
command: |
263-
adb start-server
264-
adb devices
265-
adb kill-server
266-
ls -la ~/.android
267310
- run:
268311
name: Create emulator
269312
command: |
@@ -272,33 +315,9 @@ jobs:
272315
-k "system-images;android-28;default;x86_64" \
273316
-g "default" \
274317
-d "pixel"
275-
- run:
276-
name: Start emulator in background
277-
background: true
278-
command: |
279-
emulator -avd "Emu_E2E" \
280-
-cores 1 \
281-
-gpu auto \
282-
-accel on \
283-
-memory 1024 \
284-
-no-audio \
285-
-no-snapshot \
286-
-no-boot-anim \
287-
-no-window \
288-
-logcat '*:E ReactNative:W ReactNativeJS:*'
289-
- run:
290-
name: Wait for emulator to boot
291-
command: ./scripts/android_e2e.sh 'wait_for_emulator'
292-
- run:
293-
name: Wake device
294-
command: |
295-
adb shell input keyevent 82
296-
- run:
297-
name: Run e2e tests
298-
command: yarn test:e2e:android
299-
- run:
300-
name: Run e2e tests for Next storage
301-
command: yarn detox test -c android.emu.release.next --maxConcurrency 1
318+
- persist_to_workspace:
319+
root: .
320+
paths: .
302321

303322
Release:
304323
<<: *js_defaults
@@ -334,13 +353,20 @@ workflows:
334353
- "Test: lint"
335354
- "Test: flow"
336355
- "Test: Android unit"
337-
- "Test: Android e2e":
356+
- "Build: Prepare android e2e environment":
338357
requires:
339358
- "Build: Android release apk"
359+
- "Test: Android e2e":
360+
requires:
361+
- "Build: Prepare android e2e environment"
362+
- "Test: Android e2e Next":
363+
requires:
364+
- "Build: Prepare android e2e environment"
340365
- "Release":
341366
requires:
342367
- "Test: iOS e2e"
343368
- "Test: Android e2e"
369+
- "Test: Android e2e Next"
344370
filters:
345371
branches:
346372
only: master

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"test:flow": "flow check",
5757
"test:lint": "eslint src/**/*.js example/**/*.js jest/*.js",
5858
"test:e2e:android": "detox test -c android.emu.release --maxConcurrency 1",
59+
"test:e2e:android:next": "detox test -c android.emu.release.next --maxConcurrency 1",
5960
"test:e2e:ios": "detox test -c ios.sim.release --maxConcurrency 1",
6061
"test:e2e:macos": "scripts/macos_e2e.sh 'test'"
6162
},

0 commit comments

Comments
 (0)