From 9bd276c06b79233df019e94f381a0ba98422ffb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= Date: Fri, 3 May 2019 14:34:57 -0700 Subject: [PATCH] Rename Detox job, collect all e2e steps under test_end_to_end (#24689) 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: https://github.com/facebook/react-native/pull/24689 Differential Revision: D15202242 Pulled By: hramos fbshipit-source-id: e7a9627896d2990cb6ddd0d3a91b915781ac2417 --- .circleci/config.yml | 34 +++++++++++++++++++--------------- scripts/run-ci-e2e-tests.js | 9 +++++++-- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 81c267caf..d653fdcb5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/scripts/run-ci-e2e-tests.js b/scripts/run-ci-e2e-tests.js index 165292127..f46e92075 100644 --- a/scripts/run-ci-e2e-tests.js +++ b/scripts/run-ci-e2e-tests.js @@ -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, });