File tree Expand file tree Collapse file tree 1 file changed +21
-12
lines changed
Expand file tree Collapse file tree 1 file changed +21
-12
lines changed Original file line number Diff line number Diff line change 8787
8888echo ' Checking if MySQL is ready...'
8989
90- MYSQL_TRIES=36
91- MYSQL_WAIT=5
90+ if [ -z " $PS1 " ]; then
91+ # These vars are because github actions gave problems in the past.
92+ MYSQL_TRIES=36
93+ MYSQL_WAIT=5
94+ else
95+ MYSQL_TRIES=1
96+ MYSQL_WAIT=0
97+ fi
98+
9299while ! mysql ${HOST_STRING} --user=" ${USER} " " ${PASSWORD_STRING} " --execute=" SHOW DATABASES;" | grep ' information_schema' > /dev/null;
93100do
94- echo " Waiting for MySQL(${i} /${MYSQL_TRIES} )..."
95- sleep ${MYSQL_WAIT}
96- i=$(( i+ 1 ))
97- if [ $i -gt $MYSQL_TRIES ]; then
98- echo " ${C_RED} MySQL failed to start. Aborting.${NO_FORMAT} "
99- echo " Cannot connect to mysql server. For all available variables, check the documentation at:"
100- echo " ${C_BLUE} https://github.com/wp-cli/wp-cli-tests?tab=readme-ov-file#the-database-credentials${NO_FORMAT} "
101- exit 1
102- fi
101+ i=$(( i+ 1 ))
102+ if [ " ${MYSQL_TRIES} " -gt 1 ]; then
103+ echo " Waiting for MySQL(${i} /${MYSQL_TRIES} )..."
104+ sleep ${MYSQL_WAIT}
105+ fi
106+
107+ if [ $i -ge $MYSQL_TRIES ]; then
108+ echo " ${C_RED} MySQL failed to start. Aborting.${NO_FORMAT} "
109+ echo " Cannot connect to mysql server. For all available variables, check the documentation at:"
110+ echo " ${C_BLUE} https://github.com/wp-cli/wp-cli-tests?tab=readme-ov-file#the-database-credentials${NO_FORMAT} "
111+ exit 1
112+ fi
103113done
104114
105115# Prepare the database for running the tests with a MySQL version 8.0 or higher.
134144
135145echo " Detected ${TYPE} at version ${MAJOR} .${MINOR} "
136146
137-
138147if [ " ${TYPE} " != " MariaDB" ] && [ " ${MAJOR} " -ge 8 ]; then
139148 install_mysql_db_8_0_plus
140149else
You can’t perform that action at this time.
0 commit comments