From b2e773f62bb49723bcc9ca9e0968d3f48eb01e95 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Wed, 1 May 2024 13:30:25 -0400 Subject: [PATCH] Add test for config export through UI (#390) * Make sure test fails with default * Add environment variables to ensure config export works through UI * Don't mess with the Makefile * fixup login * follow redirects on login * see if /tmp/config.tar.gz is still left around * Move test into bash script --- .github/workflows/test.yml | 8 +++++++ Makefile | 1 - .../docker-compose/docker-compose.drupal.yml | 12 +++++++++++ sample.env | 2 +- scripts/ci/drush-cex-ui.sh | 21 +++++++++++++++++++ 5 files changed, 42 insertions(+), 2 deletions(-) create mode 100755 scripts/ci/drush-cex-ui.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b244fcfe..262d11740 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,11 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Make nightly build check latest isle-buildkit + if: github.event_name == 'schedule' + run: |- + echo "TAG=main" >> $GITHUB_OUTPUT + - name: Setup make and secrets for Windows if: matrix.os == 'windows-latest' run: | @@ -55,6 +60,9 @@ jobs: exit 1 fi + - name: "Make sure we can export the site config through the UI" + run: ./scripts/ci/drush-cex-ui.sh + - name: make build run: make build shell: bash diff --git a/Makefile b/Makefile index f0f8c398e..54fe00cd0 100644 --- a/Makefile +++ b/Makefile @@ -566,7 +566,6 @@ login: docker compose exec -T drupal with-contenv bash -lc "drush uli --uri=$(DOMAIN)" echo "=============================\n" - .PHONY: init init: generate-secrets $(MAKE) download-default-certs diff --git a/build/docker-compose/docker-compose.drupal.yml b/build/docker-compose/docker-compose.drupal.yml index ef3ae475c..3e8d670de 100644 --- a/build/docker-compose/docker-compose.drupal.yml +++ b/build/docker-compose/docker-compose.drupal.yml @@ -18,7 +18,19 @@ services: PHP_MEMORY_LIMIT: ${PHP_MEMORY_LIMIT} PHP_POST_MAX_SIZE: ${PHP_POST_MAX_SIZE} PHP_UPLOAD_MAX_FILESIZE: ${PHP_UPLOAD_MAX_FILESIZE} + NGINX_FASTCGI_CONNECT_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + NGINX_FASTCGI_READ_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + NGINX_FASTCGI_SEND_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + NGINX_KEEPALIVE_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + NGINX_PROXY_CONNECT_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + NGINX_PROXY_READ_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + NGINX_PROXY_SEND_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + NGINX_SEND_TIMEOUT: ${PHP_MAX_EXECUTION_TIME}s + PHP_DEFAULT_SOCKET_TIMEOUT: ${PHP_MAX_EXECUTION_TIME} PHP_MAX_EXECUTION_TIME: ${PHP_MAX_EXECUTION_TIME} + PHP_MAX_INPUT_TIME: ${PHP_MAX_EXECUTION_TIME} + PHP_PROCESS_CONTROL_TIMEOUT: ${PHP_MAX_EXECUTION_TIME} + PHP_REQUEST_TERMINATE_TIMEOUT: ${PHP_MAX_EXECUTION_TIME} labels: - traefik.enable=${EXPOSE_DRUPAL:-true} - traefik.http.services.${COMPOSE_PROJECT_NAME-isle-dc}-drupal.loadbalancer.server.port=80 diff --git a/sample.env b/sample.env index 34fca6c3a..3ed7d7afb 100644 --- a/sample.env +++ b/sample.env @@ -155,7 +155,7 @@ RESTART_POLICY=unless-stopped PHP_MEMORY_LIMIT=256M PHP_POST_MAX_SIZE=128M PHP_UPLOAD_MAX_FILESIZE=128M -PHP_MAX_EXECUTION_TIME=30 +PHP_MAX_EXECUTION_TIME=300 # If you're just demoing or are starting from scratch, use this. INSTALL_EXISTING_CONFIG=false diff --git a/scripts/ci/drush-cex-ui.sh b/scripts/ci/drush-cex-ui.sh new file mode 100755 index 000000000..b6abf9991 --- /dev/null +++ b/scripts/ci/drush-cex-ui.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +ULI=$(make login | grep traefik) +echo "getting cookie from $ULI" +COOKIE=$(curl -L -s -c - "${ULI}") + +# try exporting the config through the UI +STATUS=$(curl -s \ + --cookie <(echo "$COOKIE") \ + -w '%{http_code}' \ + -o /dev/null \ + https://islandora.traefik.me/admin/config/development/configuration/full/export-download) + +# make sure the config export worked +if [ ${STATUS} -ne 200 ]; then + echo "Could not export config through Drupal UI" + echo ${STATUS} + exit 1 +fi