Skip to content

Commit

Permalink
Add test for config export through UI (#390)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
joecorall authored May 1, 2024
1 parent bf19eaf commit b2e773f
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions build/docker-compose/docker-compose.drupal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions scripts/ci/drush-cex-ui.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b2e773f

Please sign in to comment.