@@ -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 \
@@ -197,7 +206,14 @@ PORT=3002 \
197
206
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
198
207
NODE_PATH=src \
199
208
nohup npm start & > $tmp_server_log &
200
- grep -q ' The app is running at:' <( tail -f $tmp_server_log )
209
+ while true
210
+ do
211
+ if grep -q ' The app is running at:' $tmp_server_log ; then
212
+ break
213
+ else
214
+ sleep 1
215
+ fi
216
+ done
201
217
E2E_URL=" http://localhost:3002" \
202
218
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
203
219
CI=true NODE_PATH=src \
0 commit comments