mirror of
https://github.com/status-im/react-native.git
synced 2025-02-04 21:53:30 +00:00
Print server logs from e2e tests
This commit is contained in:
parent
ebdc041b4f
commit
c43af9e8e3
@ -7,6 +7,12 @@
|
|||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree. An additional grant
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
# of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
|
||||||
|
if [ $REACT_PACKAGER_LOG ];
|
||||||
|
then
|
||||||
|
echo "Logs will be redirected to $REACT_PACKAGER_LOG"
|
||||||
|
exec &> $REACT_PACKAGER_LOG
|
||||||
|
fi
|
||||||
|
|
||||||
ulimit -n 4096
|
ulimit -n 4096
|
||||||
|
|
||||||
THIS_DIR=$(dirname "$0")
|
THIS_DIR=$(dirname "$0")
|
||||||
|
@ -7,12 +7,19 @@ SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|||||||
ROOT=$(dirname $SCRIPTS)
|
ROOT=$(dirname $SCRIPTS)
|
||||||
TEMP=$(mktemp -d /tmp/react-native-XXXXXXXX)
|
TEMP=$(mktemp -d /tmp/react-native-XXXXXXXX)
|
||||||
|
|
||||||
|
# When tests run on CI server, we won't be able to see logs
|
||||||
|
# from packager because it runs in a separate window. This is
|
||||||
|
# a simple workaround, see packager/packager.sh
|
||||||
|
export REACT_PACKAGER_LOG="$TEMP/server.log"
|
||||||
|
|
||||||
# To make sure we actually installed the local version
|
# To make sure we actually installed the local version
|
||||||
# of react-native, we will create a temp file inside SampleApp
|
# of react-native, we will create a temp file inside SampleApp
|
||||||
# and check that it exists after `react-native init`
|
# and check that it exists after `react-native init`
|
||||||
MARKER=$(mktemp $ROOT/Examples/SampleApp/XXXXXXXX)
|
MARKER=$(mktemp $ROOT/Examples/SampleApp/XXXXXXXX)
|
||||||
|
|
||||||
function cleanup {
|
function cleanup {
|
||||||
|
set +e
|
||||||
|
[ -f $REACT_PACKAGER_LOG ] && cat $REACT_PACKAGER_LOG
|
||||||
rm $MARKER
|
rm $MARKER
|
||||||
[ $SINOPIA_PID ] && kill -9 $SINOPIA_PID
|
[ $SINOPIA_PID ] && kill -9 $SINOPIA_PID
|
||||||
[ -f ~/.npmrc.bak ] && mv ~/.npmrc.bak ~/.npmrc
|
[ -f ~/.npmrc.bak ] && mv ~/.npmrc.bak ~/.npmrc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user