Skip to content

Commit

Permalink
Rename Detox job, collect all e2e steps under test_end_to_end (#24689)
Browse files Browse the repository at this point in the history
Summary:
Rename test_detox_end_to_end to test_end_to_end, then move JavaScript and iOS end-to-end tests to this job.

Fixes an issue in the end-to-end tests, but does not yet bring them back fully to green.

[General] [Changed] - Collect e2e tests under test_end_to_end job
Pull Request resolved: #24689

Differential Revision: D15202242

Pulled By: hramos

fbshipit-source-id: e7a9627896d2990cb6ddd0d3a91b915781ac2417
  • Loading branch information
hramos authored and facebook-github-bot committed May 3, 2019
1 parent 913ff9f commit 9bd276c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
34 changes: 19 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
9 changes: 7 additions & 2 deletions scripts/run-ci-e2e-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down Expand Up @@ -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,
});
Expand Down

0 comments on commit 9bd276c

Please sign in to comment.