Skip to content

[5.3] Does check the server error logs in system tests#45409

Merged
laoneo merged 3 commits intojoomla:5.3-devfrom
Digital-Peak:tests/logs
Apr 30, 2025
Merged

[5.3] Does check the server error logs in system tests#45409
laoneo merged 3 commits intojoomla:5.3-devfrom
Digital-Peak:tests/logs

Conversation

@laoneo
Copy link
Copy Markdown
Member

@laoneo laoneo commented Apr 29, 2025

Summary of Changes

Checks the error log file after each test if there is an entry written to it.

Testing Instructions

Place somewhere in the CMS code the following code snippet ( I added it for testing to administrator/components/com_actionlogs/src/Model/ActionlogsModel.php into the delete function)

error_log('test');

Run the system test ( was running tests/System/integration/administrator/components/com_actionlogs/Actionlogs.cy.js).

Actual result BEFORE applying this Pull Request

The test was running through.

Expected result AFTER applying this Pull Request

The test failed.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Co-authored-by: Brian Teeman <brian@teeman.net>
@heelc29
Copy link
Copy Markdown
Contributor

heelc29 commented Apr 29, 2025

Works in my local test environment. Do some other test cases.

@laoneo laoneo merged commit 74e625d into joomla:5.3-dev Apr 30, 2025
3 of 4 checks passed
@laoneo laoneo deleted the tests/logs branch April 30, 2025 06:27
@laoneo laoneo added this to the Joomla! 5.3.1 milestone Apr 30, 2025
@muhme
Copy link
Copy Markdown
Contributor

muhme commented Apr 30, 2025

✅ Tested successfully on MacBook Air M3 Sequoia 15.4.1, with local PHP 8.4.6, Apache 2.4.62, MariaDB 11.6.2 and with Docker container based PHP 8.4.3, Apache 2.4.62, MySQL 8.3
With fresh cloned software and Joomla installation. As the PR is meanwhile merged, I started without PR

git checkout 78d2b757a2

1. Overall System Test Time

  • As there is log file writing included with each test, I like to see if this could hurt
  • 148 specs with 572 tests
  • w/o the PR (git checkout 78d2b757a2)
    • 6:21 Testing HTTP npm run cypress:run
    • 11:02 Testing HTTPS (cd tests/System && docker compose down && docker compose up system-tests)
      • This long running time may be related to the fact that joomlaprojects/docker-images:cypress8.4 container is only x86_64 (amd64) and the Apple M3 MacBook Air (with arm64/v8) is emulating x86_64 (amd64) architecture using QEMU, which is slower
  • w/ PR (git checkout 5.3-dev)
    • 6:25 Testing HTTP npm run cypress:run with logFile: '/opt/homebrew/var/log/httpd/error_log' configured in cypress.config.mjs file
    • 11:19 Testing HTTPS (cd tests/System && docker compose down && docker compose up system-tests) with logFile=/var/log/apache2/error.log set in entrypoint.sh script
  • ✅ Apache log file reading and writing doesn't increase the test time

2. Functionality

  • w/ PR (git checkout 5.3-dev), Testing HTTP local with logFile: '/opt/homebrew/var/log/httpd/error_log' configured in cypress.config.mjs file
  • Added error_log('test'); into delete() function into administrator/components/com_actionlogs/src/Model/ActionlogsModel.phpfile
  • ✅ Running single test spec npx cypress run --spec tests/System/integration/administrator/components/com_actionlogs/Actionlogs.cy.js one test fails
  • ✅ Running npm run cypress:run one test fails
  • ✅ Running (cd tests/System && docker compose down && docker compose up system-tests) one test fails

muhme added a commit to muhme/joomla-branches-tester that referenced this pull request Apr 30, 2025
e.g as test instructions from joomla/joomla-cms#45409 with inserting
  error_log('cheshire-cat-notice-test');
results in
  [Wed Apr 30 14:12:34.270360 2025] [php:notice] [pid 190:tid 190] [client 10.0.0.1:65242] cheshire-cat-notice-test, referer: http://host.docker.internal:7053/administrator/index.php?option=com_actionlogs&view=actionlogs
@richard67 richard67 mentioned this pull request May 11, 2025
4 tasks
alikon added a commit to joomla-extensions/weblinks that referenced this pull request May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants