Skip to content

Commit de1bd79

Browse files
committed
More robust conformance tests script.
1 parent ae0e28e commit de1bd79

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

test_scripts/run_conformance_tests_cypress.sh

+15-4
Original file line numberDiff line numberDiff line change
@@ -87,25 +87,36 @@ if [ "${VERBOSE:-}" -eq 1 ] 2>/dev/null; then
8787
printf "Building the application...\n"
8888
fi
8989

90-
npm run build --loglevel silent | grep -v -E "Creating an optimized production build..." | sed '/The project was built assuming/,/https:\/\/cra\.link\/deployment/d'
90+
build_output=$(mktemp)
91+
92+
npm run build --loglevel silent > "$build_output" 2>&1
9193

9294
if [ $? -ne 0 ]; then
9395
printf "Error: Building application.\n"
96+
cat "$build_output"
97+
rm "$build_output"
9498
exit 2
9599
fi
96100

101+
rm "$build_output"
102+
97103
if [ "${VERBOSE:-}" -eq 1 ] 2>/dev/null; then
98104
printf "Starting the application...\n"
99105
fi
100106

101107
# Start the React app in the background and redirect output to a log file
102-
BROWSER=none npm start > app.log 2>&1 &
108+
BROWSER=none npm start -- --no-open > app.log 2>&1 &
103109

104110
# Capture the process ID of the npm start command
105111
REACT_APP_PID=$!
106112

107-
# Wait for the "Compiled successfully!" message in the log file
108-
tail -f app.log | grep -q -E "Compiled successfully!|Compiled with warnings."
113+
# Wait for the "compiled successfully!" message in the log file
114+
while true; do
115+
if grep -iq -E "compiled successfully|compiled with warnings" app.log; then
116+
break
117+
fi
118+
sleep 0.1
119+
done
109120

110121
# At this point, the React app is up and running in the background
111122
if [ "${VERBOSE:-}" -eq 1 ] 2>/dev/null; then

0 commit comments

Comments
 (0)