@@ -21,8 +21,10 @@ temp_app_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_app_path'`
21
21
22
22
function cleanup {
23
23
echo ' Cleaning up.'
24
+ ps -ef | grep ' react-scripts' | grep -v grep | awk ' {print $2}' | xargs kill -s 9
24
25
cd $root_path
25
- rm -rf $temp_cli_path $temp_app_path
26
+ # TODO: fix "Device or resource busy" and remove ``|| $CI`
27
+ rm -rf $temp_cli_path $temp_app_path || $CI
26
28
}
27
29
28
30
# Error messages are redirected to stderr
@@ -143,12 +145,19 @@ PORT=3001 \
143
145
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
144
146
NODE_PATH=src \
145
147
nohup npm start & > $tmp_server_log &
146
- grep -q ' The app is running at:' <( tail -f $tmp_server_log )
148
+ while true
149
+ do
150
+ if grep -q ' The app is running at:' $tmp_server_log ; then
151
+ break
152
+ else
153
+ sleep 1
154
+ fi
155
+ done
147
156
E2E_URL=" http://localhost:3001" \
148
157
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
149
158
CI=true NODE_PATH=src \
150
159
NODE_ENV=development \
151
- node node_modules/.bin/mocha --require babel-register --require babel-polyfill integration/* .test.js
160
+ node_modules/.bin/mocha --require babel-register --require babel-polyfill integration/* .test.js
152
161
153
162
# Test "production" environment
154
163
E2E_FILE=./build/index.html \
@@ -200,7 +209,14 @@ PORT=3002 \
200
209
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
201
210
NODE_PATH=src \
202
211
nohup npm start & > $tmp_server_log &
203
- grep -q ' The app is running at:' <( tail -f $tmp_server_log )
212
+ while true
213
+ do
214
+ if grep -q ' The app is running at:' $tmp_server_log ; then
215
+ break
216
+ else
217
+ sleep 1
218
+ fi
219
+ done
204
220
E2E_URL=" http://localhost:3002" \
205
221
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
206
222
CI=true NODE_PATH=src \
0 commit comments