Files
react/scripts/circleci/test_entry_point.sh
T
Jack CrossandDan Abramov 688490dfe9 Add CircleCI support to 15-stable (#8778)
* devDependencies: add core-js and es6-symbol polyfill for tests

* Update Flow and fix issues (#8006)

* Add npm v4.0.0 support (#8082)

* Add support for node v7 (#8135)

* Upgrade ESLint and dependencies, fix new lint errors, switch Travis to Yarn (#8309)

* Update ESLint to 3.10.2

Also pull in fbjs for extending properly, per @zpao. This also disables consistent-return, which has about 80 failing cases in React currently. If we'd like to turn this back on, we should do it separately and fix all the call sites properly (rather than just adding 'return undefined;' everywhere, which adds no value.

Fixes to all existing lint errors plus an update for yarn.lock to follow.

* Update yarn.lock after the eslint update.

* Fix all new eslint failures

Unfortunately I had to add three eslint-disable-next-line instances. All have explanations inline.

* Switch Travis to use yarn instead of npm

* Update all Jest packages to 17.x (#8327)

* Update all Jest packages to 17.x, cache babel-jest transforms

* Remove the caching

Looking at the other builds it doesn't seem to actually be that necessary.  The bottleneck is executors, not build time.

* Remove unnecessary package, fix fiber test runner

* Regenerate yarn lockfile

* Update Flow to 0.37.0 (#8608)

Nothing really changes.

* Update to Jest 18 (#8621)

* mockImpl -> mockImplementation

D4329549

* Fixed linting errors

* circle.yml and circleci scripts

* Update Flow and fix issues (#8006)

* Fixed flow errors

* Updated shrinkwrap

* Removed unnecessary change

* Added jest --runInBand flag

* Removed ReactDOMFiber changes
2017-01-23 18:20:50 +01:00

63 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
set -e
COMMANDS_TO_RUN=()
# We split these to be approximately equal chunks of four. As of this writing,
# times were around:
# - 3:30 test_coverage.sh
# - 2:00 test_fiber.sh
# - 1:15 test_html_generation.sh
# - 1:15 grunt build
# with everything else < 0:30.
if [ $((1 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
COMMANDS_TO_RUN+=('./scripts/circleci/test_coverage.sh')
fi
if [ $((2 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
COMMANDS_TO_RUN+=('./scripts/circleci/test_html_generation.sh')
fi
# These seem out of order but extract-errors must be run after jest.
if [ $((0 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
COMMANDS_TO_RUN+=('./node_modules/.bin/gulp lint')
COMMANDS_TO_RUN+=('./node_modules/.bin/gulp flow')
COMMANDS_TO_RUN+=('./node_modules/.bin/grunt build')
COMMANDS_TO_RUN+=('./scripts/circleci/test_extract_errors.sh')
COMMANDS_TO_RUN+=('./scripts/circleci/track_stats.sh')
fi
RETURN_CODES=()
FAILURE=0
printf "Node #%s (%s total). " "$CIRCLE_NODE_INDEX" "$CIRCLE_NODE_TOTAL"
if [ -n "${COMMANDS_TO_RUN[0]}" ]; then
echo "Preparing to run commands:"
for cmd in "${COMMANDS_TO_RUN[@]}"; do
echo "- $cmd"
done
for cmd in "${COMMANDS_TO_RUN[@]}"; do
echo
echo "$ $cmd"
set +e
$cmd
rc=$?
set -e
RETURN_CODES+=($rc)
if [ $rc -ne 0 ]; then
FAILURE=$rc
fi
done
echo
for i in "${!COMMANDS_TO_RUN[@]}"; do
echo "Received return code ${RETURN_CODES[i]} from: ${COMMANDS_TO_RUN[i]}"
done
exit $FAILURE
else
echo "No commands to run."
fi