Skip to content
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

[CI] Rename Detox job, collect all e2e steps under test_end_to_end #24689

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -309,10 +309,6 @@ jobs:
name: JavaScript Test Suite
command: node ./scripts/run-ci-javascript-tests.js --maxWorkers 2

- run:
name: JavaScript End-to-End Test Suite
command: node ./scripts/run-ci-e2e-tests.js --js --retries 3

- store_test_results:
path: ~/react-native/reports/junit

@@ -368,7 +364,7 @@ jobs:

- run:
name: Start Metro packager
command: yarn start --nonPersistent --max-workers=1 || echo "Can't start packager automatically"
command: yarn start --max-workers=1 || echo "Can't start packager automatically"
background: true

- run:
@@ -453,15 +449,11 @@ jobs:
# kill whatever is occupying port 5555 (web socket server)
lsof -i tcp:5555 | awk 'NR!=1 {print $2}' | xargs kill
- run:
name: iOS End-to-End Test Suite
command: node ./scripts/run-ci-e2e-tests.js --ios --retries 3;

- store_test_results:
path: ~/react-native/reports/junit

# Runs end to end tests (Detox)
test_detox_end_to_end:
# Runs end-to-end tests
test_end_to_end:
<<: *macos_defaults
steps:
- attach_workspace:
@@ -496,13 +488,25 @@ jobs:

# Xcode build
- run:
name: Build iOS app for simulator
name: Build app for Detox iOS End-to-End Tests
command: yarn run build-ios-e2e

# Test
- run:
name: Run Detox Tests
name: Run Detox iOS End-to-End Tests
command: yarn run test-ios-e2e
when: always

- run:
name: Run JavaScript End-to-End Tests
command: node ./scripts/run-ci-e2e-tests.js --js --retries 3
when: always

- run:
name: Run iOS End-to-End Tests
command: node ./scripts/run-ci-e2e-tests.js --ios --retries 3;
when: always


# -------------------------
# JOBS: Test Android
@@ -572,7 +576,7 @@ jobs:
- run:
name: Build JavaScript Bundle
command: node cli.js bundle --max-workers 2 --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js

# Wait for AVD to finish booting before running tests
- run:
name: Wait for Android Virtual Device
@@ -707,7 +711,7 @@ workflows:
- test_javascript: *run-after-checkout
- test_android: *run-after-checkout
- test_ios: *run-after-checkout
- test_detox_end_to_end: *run-after-checkout
- test_end_to_end: *run-after-checkout
- test_docker_build:
filters: *filter-ignore-gh-pages

9 changes: 7 additions & 2 deletions scripts/run-ci-e2e-tests.js
Original file line number Diff line number Diff line change
@@ -109,7 +109,12 @@ try {
exitCode = 1;
throw Error(exitCode);
}
cp('metro.config.js', 'EndToEndTest/.');

const METRO_CONFIG = path.join(ROOT, 'metro.config.js');
const RN_POLYFILLS = path.join(ROOT, 'rn-get-polyfills.js');
cp(METRO_CONFIG, 'EndToEndTest/.');
cp(RN_POLYFILLS, 'EndToEndTest/.');

cd('EndToEndTest');
echo('Installing React Native package');
exec(`npm install ${PACKAGE}`);
@@ -207,7 +212,7 @@ try {
// shelljs exec('', {async: true}) does not emit stdout events, so we rely on good old spawn
const packagerEnv = Object.create(process.env);
packagerEnv.REACT_NATIVE_MAX_WORKERS = 1;
const packagerProcess = spawn('yarn', ['start', '--nonPersistent'], {
const packagerProcess = spawn('yarn', ['start'], {
stdio: 'inherit',
env: packagerEnv,
});