Skip to content

Commit

Permalink
Fixed failing tests on recent github actions (#19)
Browse files Browse the repository at this point in the history
* docker-compose no longer available

* Fixed failing tests on recent github actions
  • Loading branch information
rfernandes-sugarcrm authored Nov 22, 2024
1 parent 38c2bfe commit ea9f254
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/web_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ then
echo PHP version not provided
else
echo Installing composer dependencies if any
# add web_tests to sugar-cron after it becomes available through 'pwd'
./utilities/runcli.sh "pwd"
docker cp ./tests/web_tests sugar-cron:/var/www/html/sugar

./utilities/runcli.sh "cd ./web_tests/$3/ && composer install"

echo Confirming that Apache, MySQL and Elasticsearch are available
Expand All @@ -25,6 +29,10 @@ else
fi
done

# add web_tests to sugar-web1
docker cp ./tests/web_tests sugar-web1:/var/www/html/sugar/
docker exec sugar-web1 chown sugar:sugar -R /var/www/html/sugar/web_tests

while [ `./utilities/runcli.sh "(echo >/dev/tcp/sugar-mysql/3306) &>/dev/null && echo 1 || echo 0"` != "1" ] ; do
echo MySQL is not ready... sleeping...
sleep $INTERVAL
Expand Down Expand Up @@ -69,18 +77,18 @@ else
echo Script ./web_tests/$3/test_$i.php executed successfully via CLI
fi

OUTPUT_WEB=`curl -s http://docker.local/sugar/web_tests/$3/test_$i.php | grep ok | wc -l`
OUTPUT_WEB=`./utilities/runcli.sh "curl -s http://sugar-web1/sugar/web_tests/$3/test_$i.php | grep ok | wc -l"`
if [ $OUTPUT_WEB != '1' ]
then
echo Error for web script test_$i.php
echo Output:
echo `curl -s http://docker.local/sugar/web_tests/$3/test_$i.php`
echo `curl -s http://sugar-web1/sugar/web_tests/$3/test_$i.php`
echo
echo Retrieving complete logs from the web server:
docker logs sugar-web1
exit 1
else
echo Script http://docker.local/sugar/web_tests/$3/test_$i.php executed successfully via web
echo Script http://sugar-web1/sugar/web_tests/$3/test_$i.php executed successfully via web
fi
done
fi

0 comments on commit ea9f254

Please sign in to comment.