Files
react/scripts/circleci/test_entry_point.sh
T
Andrew Clark 4d5cb64aa2 Rewrite ReactFiberScheduler for better integration with Scheduler package (#15151)
* Rewrite ReactFiberScheduler

Adds a new implementation of ReactFiberScheduler behind a feature flag.
We will maintain both implementations in parallel until the new one
is proven stable enough to replace the old one.

The main difference between the implementations is that the new one is
integrated with the Scheduler package's priority levels.

* Conditionally add fields to FiberRoot

Some fields only used by the old scheduler, and some by the new.

* Add separate build that enables new scheduler

* Re-enable skipped test

If synchronous updates are scheduled by a passive effect, that work
should be flushed synchronously, even if flushPassiveEffects is
called inside batchedUpdates.

* Passive effects have same priority as render

* Revert ability to cancel the current callback

React doesn't need this anyway because it never schedules callbacks if
it's already rendering.

* Revert change to FiberDebugPerf

Turns out this isn't neccessary.

* Fix ReactFiberScheduler dead code elimination

Should initialize to nothing, then assign the exports conditionally,
instead of initializing to the old exports and then reassigning to the
new ones.

* Don't yield before commit during sync error retry

* Call Scheduler.flushAll unconditionally in tests

Instead of wrapping in enableNewScheduler flag.
2019-04-02 15:49:07 -07:00

74 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
set -e
./scripts/circleci/set_up_github_keys.sh
COMMANDS_TO_RUN=()
if [ $((0 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
COMMANDS_TO_RUN+=('node ./scripts/prettier/index')
COMMANDS_TO_RUN+=('node ./scripts/tasks/flow-ci')
COMMANDS_TO_RUN+=('node ./scripts/tasks/eslint')
COMMANDS_TO_RUN+=('yarn test --maxWorkers=2')
COMMANDS_TO_RUN+=('yarn test-new-scheduler --maxWorkers=2')
COMMANDS_TO_RUN+=('yarn test-persistent --maxWorkers=2')
COMMANDS_TO_RUN+=('./scripts/circleci/check_license.sh')
COMMANDS_TO_RUN+=('./scripts/circleci/check_modules.sh')
COMMANDS_TO_RUN+=('./scripts/circleci/test_print_warnings.sh')
fi
if [ $((1 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
COMMANDS_TO_RUN+=('yarn test-prod --maxWorkers=2')
# React Fire:
COMMANDS_TO_RUN+=('yarn test-fire --maxWorkers=2')
COMMANDS_TO_RUN+=('yarn test-fire-prod --maxWorkers=2')
fi
if [ $((2 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
COMMANDS_TO_RUN+=('./scripts/circleci/add_build_info_json.sh')
COMMANDS_TO_RUN+=('./scripts/circleci/update_package_versions.sh')
COMMANDS_TO_RUN+=('./scripts/circleci/build.sh')
COMMANDS_TO_RUN+=('yarn test-build --maxWorkers=2')
COMMANDS_TO_RUN+=('yarn test-build-prod --maxWorkers=2')
COMMANDS_TO_RUN+=('node ./scripts/tasks/danger')
COMMANDS_TO_RUN+=('./scripts/circleci/upload_build.sh')
COMMANDS_TO_RUN+=('./scripts/circleci/pack_and_store_artifact.sh')
fi
if [ $((3 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
COMMANDS_TO_RUN+=('./scripts/circleci/test_coverage.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