This repository has been archived by the owner on Feb 18, 2019. It is now read-only.
forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved OSS flow and lint reporting
Summary:- lint bot is now managed by Circle CI - checked that flow and lint errors are caught both by bot and CI - flow fix for npm 3 - Travis is now using npm 2 and Circle CI npm 3 - Refactored Travis script to be able to be able to fail on multiple lines Closes facebook#6508 Differential Revision: D3069500 Pulled By: davidaurelio fb-gh-sync-id: 02772bf1eae5f2c44489c2e3a01899428a9640cb shipit-source-id: 02772bf1eae5f2c44489c2e3a01899428a9640cb
- Loading branch information
Showing
9 changed files
with
92 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,45 +7,20 @@ install: | |
- mkdir -p .nvm | ||
- export NVM_DIR="$PWD/.nvm" | ||
- source $(brew --prefix nvm)/nvm.sh | ||
- nvm install 5 | ||
# testing with npm@2 for diversity, Circle tests with npm@3 | ||
- nvm install 4.4.0 | ||
- rm -Rf "${TMPDIR}/jest_preprocess_cache" | ||
- npm config set spin=false | ||
- npm config set progress=false | ||
- npm install | ||
|
||
script: | ||
- | | ||
if [ "$TEST_TYPE" = objc ] | ||
then | ||
travis_retry ./scripts/objc-test.sh | ||
elif [ "$TEST_TYPE" = js ] | ||
then | ||
npm install [email protected] | ||
cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow --silent -- --json) | GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" node bots/code-analysis-bot.js | ||
npm run flow && npm test | ||
# testing js e2e with npm3 | ||
npm install -g npm@3 | ||
npm --version | ||
./scripts/e2e-test.sh --packager | ||
# testing js e2e with npm2 | ||
rm -rf node_modules | ||
npm install -g npm@2 | ||
npm install | ||
npm --version | ||
./scripts/e2e-test.sh --packager | ||
elif [ "$TEST_TYPE" = e2e-objc ] | ||
then | ||
travis_retry ./scripts/e2e-test.sh --ios | ||
else | ||
echo "Unknown test type: $TEST_TYPE" | ||
exit 1 | ||
fi | ||
- if [[ "$TEST_TYPE" = objc ]]; then travis_retry ./scripts/objc-test.sh; fi | ||
- if [[ "$TEST_TYPE" = e2e-objc ]]; then travis_retry ./scripts/e2e-test.sh --ios; fi | ||
# temporarily disable flow check because it went mad on Travis | ||
# - if [[ "$TEST_TYPE" = js ]]; then npm run flow check; fi | ||
- if [[ "$TEST_TYPE" = js ]]; then npm test -- --maxWorkers=1; fi | ||
- if [[ "$TEST_TYPE" = js ]]; then ./scripts/e2e-test.sh --packager; fi | ||
|
||
env: | ||
matrix: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,37 +6,40 @@ machine: | |
node: | ||
version: 5.6.0 | ||
environment: | ||
PATH: "~/$CIRCLE_PROJECT_REPONAME/gradle-2.9/bin:$PATH" | ||
PATH: "~/$CIRCLE_PROJECT_REPONAME/gradle-2.9/bin:/home/ubuntu/buck/bin:$PATH" | ||
TERM: "dumb" | ||
ADB_INSTALL_TIMEOUT: 10 | ||
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx512m -XX:+HeapDumpOnOutOfMemoryError"' | ||
|
||
dependencies: | ||
pre: | ||
# BUCK | ||
- if [[ ! -e buck ]]; then git clone https://github.com/facebook/buck.git; fi | ||
- cd buck && ant | ||
- buck/bin/buck --version | ||
- buck/bin/buck fetch ReactAndroid/src/test/java/com/facebook/react/modules | ||
- buck/bin/buck fetch ReactAndroid/src/main/java/com/facebook/react | ||
- buck/bin/buck fetch ReactAndroid/src/main/java/com/facebook/react/shell | ||
- buck/bin/buck fetch ReactAndroid/src/test/... | ||
- buck/bin/buck fetch ReactAndroid/src/androidTest/... | ||
override: | ||
# BUCK and android | ||
- if [[ ! -e /home/ubuntu/buck ]]; then git clone https://github.com/facebook/buck.git /home/ubuntu/buck; fi | ||
- cd /home/ubuntu/buck && ant | ||
- buck --version | ||
- buck fetch ReactAndroid/src/test/java/com/facebook/react/modules | ||
- buck fetch ReactAndroid/src/main/java/com/facebook/react | ||
- buck fetch ReactAndroid/src/main/java/com/facebook/react/shell | ||
- buck fetch ReactAndroid/src/test/... | ||
- buck fetch ReactAndroid/src/androidTest/... | ||
- source scripts/circle-ci-android-setup.sh && getAndroidSDK | ||
- ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog | ||
cache_directories: | ||
- "ReactAndroid/build/downloads" | ||
- "buck" | ||
- "buck-out/bin" | ||
- "website/node_modules" | ||
override: | ||
# CIRCLE_NPM_TOKEN is in React Native project settings in Circle CI. | ||
# It was generated for bestander user, easy to replace with anyone's else | ||
- echo "//registry.npmjs.org/:_authToken=${CIRCLE_NPM_TOKEN}" > ~/.npmrc | ||
- npm config set spin=false | ||
- npm config set progress=false | ||
- npm install | ||
# for eslint bot | ||
- npm install [email protected] | ||
# for deployment scripts | ||
- npm install [email protected] | ||
- cd website && npm install | ||
cache_directories: | ||
- "ReactAndroid/build/downloads" | ||
- "/home/ubuntu/buck" | ||
- "website/node_modules" | ||
- "node_modules" | ||
|
||
test: | ||
pre: | ||
|
@@ -46,12 +49,18 @@ test: | |
- source scripts/circle-ci-android-setup.sh && waitForAVD | ||
|
||
override: | ||
# eslint bot | ||
- cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow --silent -- check --json) | GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" CI_USER=$CIRCLE_PROJECT_USERNAME CI_REPO=$CIRCLE_PROJECT_REPONAME PULL_REQUEST_NUMBER=$CIRCLE_PR_NUMBER node bots/code-analysis-bot.js | ||
# JS tests for dependencies installed with npm3 | ||
- npm run flow check | ||
- npm test -- --maxWorkers=1 | ||
|
||
# build app | ||
- buck/bin/buck build ReactAndroid/src/main/java/com/facebook/react | ||
- buck/bin/buck build ReactAndroid/src/main/java/com/facebook/react/shell | ||
- buck build ReactAndroid/src/main/java/com/facebook/react | ||
- buck build ReactAndroid/src/main/java/com/facebook/react/shell | ||
|
||
# unit tests | ||
- buck/bin/buck test ReactAndroid/src/test/... --config build.threads=1 | ||
- buck test ReactAndroid/src/test/... --config build.threads=1 | ||
|
||
# instrumentation tests | ||
# compile native libs with Gradle script | ||
|
@@ -60,7 +69,7 @@ test: | |
# build JS bundle for instrumentation tests | ||
- node local-cli/cli.js bundle --platform android --dev true --entry-file ReactAndroid/src/androidTest/assets/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js | ||
# build test APK | ||
- buck/bin/buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=1 | ||
- buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=1 | ||
# run installed apk with tests | ||
- source scripts/circle-ci-android-setup.sh && retry3 ./scripts/run-android-instrumentation-tests.sh com.facebook.react.tests | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 10 additions & 4 deletions
14
packager/react-packager/src/AssetServer/__tests__/AssetServer-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters