From 2d6bccb6174c5721832960146e79fe6fec5a52fd Mon Sep 17 00:00:00 2001 From: Alexander Varwijk Date: Wed, 23 Aug 2023 12:50:14 +0200 Subject: [PATCH] Allow debugging mail spool for failed tests It can be difficult to debug failed tests for e-mails because we are not able to look at the files that are in the mail-spool. This commit changes the Behat failure scenario to also copy any e-mail messages from the mail-spool on a test failure. --- .github/workflows/behat.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/behat.yml b/.github/workflows/behat.yml index 379bda7ddfc..53078c7db66 100644 --- a/.github/workflows/behat.yml +++ b/.github/workflows/behat.yml @@ -392,6 +392,11 @@ jobs: mv html/profiles/contrib/social/tests/behat/logs/* $OUTPUT_FOLDER/ fi + # Move files from the mail spool to the output folder if they exist + if (shopt -s nullglob; f=(html/profiles/contrib/social/tests/behat/mail-spool/*); ((${#f[@]}))); then + mv html/profiles/contrib/social/tests/behat/mail-spool/* $OUTPUT_FOLDER/ + fi + # Dump the database with the state of the test failure to allow for # local inspection. drush sql-dump > $OUTPUT_FOLDER/at-test-failure.sql