Files
react/scripts/circleci/test_entry_point.sh
Sebastian Markbåge 9011182c55 Configure Jest with Stack and Fiber as separate projects (#10214)
* Disable Fiber specific test run in CI

This disables the comparison against previously recorded test. Instead,
we'll rely on jest failures to fail tests.

* Extract jest config into two separate projects for Fiber and Stack

Allows us to run both in the same jest run. The setupMocks file is forked into
specific environment configuration for each project. This replaces the
environment variable.

I used copy pasta here to make it clear. We can abstract this later. It's clear
to me that simply extracting shared stuff is not the best way to abstract this.
setupMocks for example didn't need all the code in both branches.

I think that some of the stuff that is shared such as error message extracting
etc. should probably be lifted out into a stand-alone jest project instead of
being shared.

* Fix class equivalence test

There's a behavior change when projects are used which makes
setupTestFrameworkScriptFile not override the normal config.

This test should probably just move to a separate CI script or something
less hacky.

* Only run Fiber tests with scripts/fiber/record-tests
2017-07-19 10:35:45 -07:00

57 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
set -e
COMMANDS_TO_RUN=()
if [ $((1 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
COMMANDS_TO_RUN+=('./scripts/circleci/test_coverage.sh')
fi
if [ $((3 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
COMMANDS_TO_RUN+=('node ./scripts/tasks/eslint')
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 ./scripts/prettier/index')
COMMANDS_TO_RUN+=('node ./scripts/tasks/flow')
COMMANDS_TO_RUN+=('node ./scripts/tasks/jest')
COMMANDS_TO_RUN+=('./scripts/circleci/build.sh')
COMMANDS_TO_RUN+=('./scripts/circleci/test_print_warnings.sh')
COMMANDS_TO_RUN+=('./scripts/circleci/track_stats.sh')
# COMMANDS_TO_RUN+=('./scripts/circleci/bench.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