From 5f3577a5dabce0dc7665ea9c2dd739f9c08d3399 Mon Sep 17 00:00:00 2001 From: Aaron Weeden Date: Wed, 21 Aug 2024 15:35:12 -0400 Subject: [PATCH 1/6] Add missing exception testing. --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e8892939..d2acebea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -133,6 +133,9 @@ jobs: if [ -e /var/log/php_errors.log ]; then test `egrep -v 'vendor/phpunit/phpunit/src|PHP Notice: fread()' /var/log/php_errors.log | wc -l` = 0; fi + - run: + name: Ensure that no XDMoD exceptions were logged + command: test ! -f /xdmod/logs/exceptions.log - store_artifacts: path: /tmp/screenshots - store_artifacts: @@ -141,6 +144,8 @@ jobs: path: /var/log/php-fpm - store_artifacts: path: /var/log/php_errors.log + - store_artifacts: + path: /xdmod/log/exceptions.log - store_test_results: path: ~/phpunit From 00554990fb247016b0d0e2ffef37eaaf5adce5dc Mon Sep 17 00:00:00 2001 From: Aaron Weeden Date: Wed, 21 Aug 2024 16:04:31 -0400 Subject: [PATCH 2/6] Fix path. --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d2acebea..8c547cee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -135,7 +135,7 @@ jobs: fi - run: name: Ensure that no XDMoD exceptions were logged - command: test ! -f /xdmod/logs/exceptions.log + command: test ! -f /root/xdmod/logs/exceptions.log - store_artifacts: path: /tmp/screenshots - store_artifacts: @@ -145,7 +145,7 @@ jobs: - store_artifacts: path: /var/log/php_errors.log - store_artifacts: - path: /xdmod/log/exceptions.log + path: /root/xdmod/log/exceptions.log - store_test_results: path: ~/phpunit From 2eb2b3ac7970af6be8f2d9f5620a10afd8cc2bc6 Mon Sep 17 00:00:00 2001 From: Aaron Weeden Date: Wed, 21 Aug 2024 16:48:59 -0400 Subject: [PATCH 3/6] Fix path. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c547cee..bf0fba1e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -145,7 +145,7 @@ jobs: - store_artifacts: path: /var/log/php_errors.log - store_artifacts: - path: /root/xdmod/log/exceptions.log + path: /root/xdmod/logs/exceptions.log - store_test_results: path: ~/phpunit From 7177a776f2aef142910dc6d659d0ff46c05ee104 Mon Sep 17 00:00:00 2001 From: Aaron Weeden Date: Thu, 22 Aug 2024 10:28:27 -0400 Subject: [PATCH 4/6] Test for exceptions immediately after phpunit runs rather than at the end, so you don't have to wait as long for failure. Also store all of the files from /root/xdmod/logs for debugging. --- .circleci/config.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bf0fba1e..cc62a8aa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -101,6 +101,9 @@ jobs: - run: name: Run Component Tests command: ./tests/component/runtests.sh --log-junit ~/phpunit/component.xml + - run: + name: Ensure that no XDMoD exceptions were logged + command: test ! -f /var/log/xdmod/exceptions.log - run: name: Make sure that the Composer Test Dependencies are installed command: | @@ -108,6 +111,9 @@ jobs: - run: name: Run Integration Tests command: ./tests/integration/runtests.sh --log-junit ~/phpunit/integration.xml + - run: + name: Ensure that no XDMoD exceptions were logged + command: test ! -f /root/xdmod/logs/exceptions.log - run: pushd $HOME && rm -f chromedriver_linux64.zip && wget https://chromedriver.storage.googleapis.com/98.0.4758.80/chromedriver_linux64.zip && popd - run: name: 'Bodge the nodejs version to run an older one for the webdriver tests' @@ -127,15 +133,15 @@ jobs: - run: name: Run Regression Tests command: ./tests/regression/runtests.sh --junit-output-dir ~/phpunit + - run: + name: Ensure that no XDMoD exceptions were logged + command: test ! -f /root/xdmod/logs/exceptions.log - run: name: Ensure that no PHP command-line errors were generated command: > if [ -e /var/log/php_errors.log ]; then test `egrep -v 'vendor/phpunit/phpunit/src|PHP Notice: fread()' /var/log/php_errors.log | wc -l` = 0; fi - - run: - name: Ensure that no XDMoD exceptions were logged - command: test ! -f /root/xdmod/logs/exceptions.log - store_artifacts: path: /tmp/screenshots - store_artifacts: @@ -145,7 +151,7 @@ jobs: - store_artifacts: path: /var/log/php_errors.log - store_artifacts: - path: /root/xdmod/logs/exceptions.log + path: /root/xdmod/logs - store_test_results: path: ~/phpunit From 21e5cc3094f9e9f728d5e20b2505d411f1101dc5 Mon Sep 17 00:00:00 2001 From: Aaron Weeden Date: Thu, 22 Aug 2024 12:31:19 -0400 Subject: [PATCH 5/6] Check that exceptions log is empty rather than no file. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cc62a8aa..19c5d8b7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -103,7 +103,7 @@ jobs: command: ./tests/component/runtests.sh --log-junit ~/phpunit/component.xml - run: name: Ensure that no XDMoD exceptions were logged - command: test ! -f /var/log/xdmod/exceptions.log + command: test -s /var/log/xdmod/exceptions.log - run: name: Make sure that the Composer Test Dependencies are installed command: | From cf933e4360ede23d414b03b2423974542cab81f9 Mon Sep 17 00:00:00 2001 From: Aaron Weeden Date: Thu, 22 Aug 2024 13:18:10 -0400 Subject: [PATCH 6/6] Fix logic. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 19c5d8b7..8f366b2d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -103,7 +103,7 @@ jobs: command: ./tests/component/runtests.sh --log-junit ~/phpunit/component.xml - run: name: Ensure that no XDMoD exceptions were logged - command: test -s /var/log/xdmod/exceptions.log + command: test ! -s /var/log/xdmod/exceptions.log - run: name: Make sure that the Composer Test Dependencies are installed command: |