From b27d1d3da22175b29fb111a6606f20e877135aea Mon Sep 17 00:00:00 2001 From: empyrical Date: Wed, 24 Apr 2019 07:53:23 -0700 Subject: [PATCH] Remove out-of-tree platform tests (#24536) Summary: This pull request removes the tests for out-of-tree platforms and the dependency on the package `react-native-dummy` from the React Native repo. The logic that this was meant to test was moved to the React Native CLI repo, and [it is being tested there](https://github.com/react-native-community/cli/blob/827daa4c1687f8d17eb7df46e1a2ec25640c7797/packages/cli/src/tools/config/__tests__/index-test.js#L125-L152) as well making this a bit redundant at this point. The dependency on `react-native-dummy` was also an issue, because when the file structure under `Libraries/` changes, bundler errors could crop up if there wasn't an update made to the file structure of `react-native-dummy/Libraries/`. This was an issue when [`TabBarIOS` was removed](https://github.com/facebook/react-native/commit/02697291ff41ddfac5b85d886e9cafa0261c8b98#diff-b9cfc7f2cdf78a7f4b91a753d10865a2) - `react-native-dummy` was causing Haste errors and was stopping the commit from being able to land, and I needed to cut a new version just for it. With Lean Core, I expect more issues like this happening in the future. [General] [Removed] - Removed Out-of-Tree platform tests (functionality is tested in the RN-CLI repo now) Pull Request resolved: https://github.com/facebook/react-native/pull/24536 Differential Revision: D15063320 Pulled By: cpojer fbshipit-source-id: 2a0467bed326b286623fa3cfa4e0bb6959b66b78 --- .../Dockerfiles/scripts/run-ci-e2e-tests.sh | 16 ---------- jest/__tests__/hasteImpl-test.js | 32 ------------------- package.json | 1 - 3 files changed, 49 deletions(-) diff --git a/.circleci/Dockerfiles/scripts/run-ci-e2e-tests.sh b/.circleci/Dockerfiles/scripts/run-ci-e2e-tests.sh index a979d3abc..cede0e977 100755 --- a/.circleci/Dockerfiles/scripts/run-ci-e2e-tests.sh +++ b/.circleci/Dockerfiles/scripts/run-ci-e2e-tests.sh @@ -22,8 +22,6 @@ AVD_UUID=$(< /dev/urandom tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1) ANDROID_NPM_DEPS="appium@1.5.1 mocha@2.4.5 wd@0.3.11 colors@1.0.3 pretty-data2@0.40.1" CLI_PACKAGE="$ROOT/react-native-cli/react-native-cli-*.tgz" PACKAGE="$ROOT/react-native-*.tgz" -# Version of react-native-dummy to test against -REACT_DUMMY_PLATFORM=react-native-dummy@0.1.0 # solve issue with max user watches limit echo 65536 | tee -a /proc/sys/fs/inotify/max_user_watches @@ -250,20 +248,6 @@ function e2e_suite() { return 1 fi - if ! retry "$RETRY_COUNT" npm install --save "$REACT_DUMMY_PLATFORM" --silent >> /dev/null - then - echo "Failed to install react-native-dummy" - echo "Most common reason is npm registry connectivity, try again" - return 1 - fi - - if ! react-native bundle --max-workers 1 --platform dummy --dev true --entry-file index.js --bundle-output dummy-bundle.js - then - echo "Could not build dummy bundle" - return 1 - fi - fi - # directory cleanup rm "$IOS_MARKER" rm "$ANDROID_MARKER" diff --git a/jest/__tests__/hasteImpl-test.js b/jest/__tests__/hasteImpl-test.js index 9cfb5a7ae..9cab29a52 100644 --- a/jest/__tests__/hasteImpl-test.js +++ b/jest/__tests__/hasteImpl-test.js @@ -11,23 +11,9 @@ 'use strict'; const path = require('path'); -const fs = require('fs'); const {getHasteName} = require('../hasteImpl'); -// RNPM currently does not support plugins when using Yarn Plug 'n Play -const testIfNotPnP = fs.existsSync( - path.join( - __dirname, - '../..', - 'node_modules', - 'react-native-dummy', - 'package.json', - ), -) - ? test - : test.skip; - function getPath(...parts) { return path.join(__dirname, '..', '..', ...parts); } @@ -60,24 +46,6 @@ it('returns the correct haste name for a file with a platform suffix', () => { } }); -testIfNotPnP( - 'returns the correct haste name for a file with an out-of-tree platform suffix', - () => { - for (const platform of ['dummy']) { - expect( - getHasteName( - getPath( - 'Libraries', - 'Components', - 'AccessibilityInfo', - `AccessibilityInfo.${platform}.js`, - ), - ), - ).toEqual('AccessibilityInfo'); - } - }, -); - it('returns the correct haste name for a file with a flow suffix', () => { expect( getHasteName( diff --git a/package.json b/package.json index b88c3130a..a70cf91ef 100644 --- a/package.json +++ b/package.json @@ -141,7 +141,6 @@ "mkdirp": "^0.5.1", "prettier": "1.16.4", "react": "16.8.3", - "react-native-dummy": "0.2.0", "react-test-renderer": "16.8.3", "shelljs": "^0.7.8", "yargs": "^9.0.0",