Merge branch 'develop' into 2.4

pull/9438/head
iglocska 2023-12-01 11:49:05 +01:00
commit da937092a7
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
4 changed files with 20 additions and 1 deletions

View File

@ -279,9 +279,15 @@ jobs:
- name: Logs
if: ${{ always() }}
# update logs_test.sh when adding more logsources here
run: |
tail -n +1 `pwd`/app/tmp/logs/*
tail -n +1 /var/log/apache2/*.log
sudo -u $USER app/Console/cake Log export /tmp/logs.json.gz --without-changes
zcat /tmp/logs.json.gz
- name: Errors in Logs
if: ${{ always() }}
run: |
./tests/logs_tests.sh

View File

@ -1 +1 @@
{"major":2, "minor":4, "hotfix":180}
{"major":2, "minor":4, "hotfix":181}

View File

@ -0,0 +1,5 @@
# This file contains regexes applied to logs, one line per regex
# Whenever the regex matches, the Logs job will fail and report the error.
class="cake-error"
Error: [ParseError]
Error: [PDOException]

8
tests/logs_tests.sh Normal file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
ERROR_MESSAGE="Errors found in logs !"
# exit 0 of grep = match found, so we need to exit 1 on this use-case.
grep -HE -f logs_fail_regexes.txt `pwd`/app/tmp/logs/* && echo $ERROR_MESSAGE && exit 1
grep -HE -f logs_fail_regexes.txt /var/log/apache2/*.log && echo $ERROR_MESSAGE && exit 1
zgrep -HE -f logs_fail_regexes.txt /tmp/logs.json.gz && echo $ERROR_MESSAGE && exit 1
# exit cleanly because grep found nothing, and did exit 1.
exit 0