mirror of
https://github.com/phpmyadmin/docker.git
synced 2026-08-24 10:13:22 -05:00
Ref #369 - Add tests for a different Apache2 port
This commit is contained in:
@@ -15,7 +15,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
database-image: ["mariadb:10.4", "mysql:5.7", "mariadb:latest", "mysql:latest"]
|
||||
configuration: ["default", "one-host"]
|
||||
configuration: ["default", "one-host", "different-apache-port"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
@@ -21,7 +21,7 @@ run:
|
||||
testing-%:
|
||||
docker-compose -f ./testing/docker-compose/docker-compose.$@.yml up --build --abort-on-container-exit --exit-code-from=sut
|
||||
|
||||
run-tests: testing-default testing-one-host
|
||||
run-tests: testing-default testing-one-host testing-different-apache-port
|
||||
|
||||
logs:
|
||||
docker-compose -f ./testing/docker-compose/docker-compose.testing-default.yml logs
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ FROM alpine:3.15
|
||||
RUN set -ex; \
|
||||
\
|
||||
apk add --no-cache --update mariadb-client mariadb-connector-c bash \
|
||||
py3-html5lib py3-pytest py3-mechanize
|
||||
py3-html5lib py3-pytest py3-mechanize curl
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
version: "3.1"
|
||||
|
||||
services:
|
||||
db_server:
|
||||
image: ${DB:-mariadb:10.3}
|
||||
container_name: phpmyadmin_testing_db
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-uroot", "-p${TESTSUITE_PASSWORD:-my-secret-pw}"]
|
||||
start_period: 5s
|
||||
interval: 5s
|
||||
timeout: 60s
|
||||
retries: 10
|
||||
networks:
|
||||
testing:
|
||||
tmpfs:
|
||||
- /var/lib/mysql:rw,noexec,nosuid,size=300m
|
||||
|
||||
phpmyadmin:
|
||||
build:
|
||||
context: ../../apache
|
||||
container_name: phpmyadmin_testing_apache
|
||||
environment:
|
||||
PMA_HOST: db_server
|
||||
UPLOAD_LIMIT: 123M
|
||||
MAX_EXECUTION_TIME: 125
|
||||
HIDE_PHP_VERSION: 1
|
||||
APACHE_PORT: 8090
|
||||
volumes:
|
||||
- ../config.user.inc.php:/etc/phpmyadmin/config.user.inc.php:ro
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-Ss", "http://localhost:8090/robots.txt"]
|
||||
start_period: 5s
|
||||
interval: 3s
|
||||
timeout: 60s
|
||||
retries: 10
|
||||
networks:
|
||||
testing:
|
||||
depends_on:
|
||||
db_server:
|
||||
condition: service_healthy
|
||||
|
||||
sut:
|
||||
depends_on:
|
||||
phpmyadmin:
|
||||
condition: service_healthy
|
||||
db_server:
|
||||
condition: service_healthy
|
||||
build:
|
||||
context: ../
|
||||
command: "/tests/testing/test-docker.sh"
|
||||
networks:
|
||||
testing:
|
||||
environment:
|
||||
TESTSUITE_HOSTNAME: phpmyadmin_testing_apache
|
||||
TESTSUITE_PORT: 8090
|
||||
TESTSUITE_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
|
||||
PMA_HOST: phpmyadmin_testing_db
|
||||
PMA_PORT: 3306
|
||||
volumes:
|
||||
- ../../:/tests:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
working_dir: /tests
|
||||
|
||||
networks:
|
||||
testing:
|
||||
driver: bridge
|
||||
@@ -28,6 +28,14 @@ if [ $ret -ne 0 ] ; then
|
||||
exit $ret
|
||||
fi
|
||||
|
||||
curl -fsSL --output /dev/null "${PHPMYADMIN_URL}"
|
||||
ret=$?
|
||||
|
||||
if [ $ret -ne 0 ] ; then
|
||||
echo "Could not connect to ${PHPMYADMIN_URL}"
|
||||
exit $ret
|
||||
fi
|
||||
|
||||
# Perform tests
|
||||
ret=0
|
||||
pytest -p no:cacheprovider -q --url "$PHPMYADMIN_URL" --username ${TESTSUITE_USER:=root} --password "$TESTSUITE_PASSWORD" $SERVER $FILENAME
|
||||
|
||||
Reference in New Issue
Block a user