File tree Expand file tree Collapse file tree 5 files changed +21
-14
lines changed
Expand file tree Collapse file tree 5 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ python:
1212env :
1313 matrix :
1414 - DB=mysql:latest
15- - DB=mariadb:10.2
15+ - DB=mariadb:latest
1616
1717before_install :
1818 - export TESTSUITE_PASSWORD=`openssl rand -base64 30`
@@ -42,4 +42,5 @@ script:
4242 - docker-compose stop
4343 # Run tests in testing container
4444 - docker-compose -f docker-compose.testing.yml up -d phpmyadmin
45+ - docker-compose exec phpmyadmin /test-docker.sh test 80 db_server
4546 - ./testing/wait-for-testing.sh
Original file line number Diff line number Diff line change @@ -3,22 +3,24 @@ version: '2'
33services :
44 db_server :
55 image : ${DB}
6- container_name : phpmyadmin_testing_mariadb
6+ container_name : phpmyadmin_testing_${DB}
77 environment :
8- - MYSQL_ROOT_PASSWORD=test123
8+ - MYSQL_ROOT_PASSWORD=${TESTSUITE_PASSWORD}
99 volumes :
1010 - ./testing/testing.cnf:/etc/mysql/conf.d/testing.cnf:ro
1111
1212 phpmyadmin :
1313 build :
1414 context : testing/
15+ links :
16+ - db_server:db_server
1517 container_name : phpmyadmin_testing
1618 volumes :
1719 - /sessions
1820 ports :
1921 - 8090:80
2022 environment :
2123 - PMA_ARBITRARY=1
22- - TESTSUITE_PASSWORD=test123
24+ - TESTSUITE_PASSWORD=${TESTSUITE_PASSWORD}
2325 depends_on :
2426 - db_server
Original file line number Diff line number Diff line change 33FROM phpmyadmin/phpmyadmin
44
55# Install test dependencies
6- RUN apk add --no-cache curl py2-pip
7- RUN pip install mechanize html5lib
6+ RUN set -ex; \
7+ \
8+ apt-get update; \
9+ apt-get install -y --no-install-recommends \
10+ curl \
11+ python-pip \
12+ ; \
13+ pip install mechanize html5lib; \
14+ rm -rf /var/lib/apt/lists/*
815
9- COPY test.ini /etc/supervisor.d/
1016COPY phpmyadmin_test.py test-docker.sh world.sql /
Original file line number Diff line number Diff line change 1- #!/usr/bin/env python
1+ #!/usr/bin/env python2
22import argparse
33import os
44import re
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ if [ -f /.dockerenv ] ; then
3636
3737 # Wait for database to start
3838 TIMEOUT=0
39- while ! curl " $PHPMYADMIN_DB_URL " & > /dev/null ; do
39+ while [ $( docker logs db_server 2>&1 | fgrep -c " mysqld: ready for connections. " ) -le 0 ] ; do
4040 echo " Waiting for ${PHPMYADMIN_DB_HOSTNAME} database start..."
4141 sleep 10
4242 TIMEOUT=$(( TIMEOUT + 1 ))
5555
5656# Wait for container to start
5757TIMEOUT=0
58- while ! $COMMAND_HOST ps aux | grep -q nginx ; do
58+ while [ $( docker logs ${NAME} 2>&1 | fgrep -c " Command line: 'apache2 -D FOREGROUND' " ) -le 0 ] ; do
5959 echo " Waiting for PHPMyAdmin start..."
6060 sleep 1
6161 TIMEOUT=$(( TIMEOUT + 1 ))
@@ -76,17 +76,15 @@ if [ $ret -eq 0 ] ; then
7676 else
7777 FILENAME=./testing/phpmyadmin_test.py
7878 fi
79- python $FILENAME --url " $PHPMYADMIN_URL " --username root --password $TESTSUITE_PASSWORD $SERVER
79+ python2 $FILENAME --url " $PHPMYADMIN_URL " --username root --password $TESTSUITE_PASSWORD $SERVER
8080 ret=$?
8181fi
8282
8383# Show debug output in case of failure
8484if [ $ret -ne 0 ] ; then
8585 curl " $PHPMYADMIN_URL "
8686 $COMMAND_HOST ps faux
87- $COMMAND_HOST cat /var/log/php-fpm.log
88- $COMMAND_HOST cat /var/log/nginx-error.log
89- $COMMAND_HOST cat /var/log/supervisord.log
87+ docker logs ${NAME}
9088 echo " Result of ${PHPMYADMIN_DB_HOSTNAME} tests: ${RED} FAILED${NC} "
9189 exit $ret
9290fi
You can’t perform that action at this time.
0 commit comments