joomla-cms
joomla-cms copied to clipboard
Consider file permissions when writing configuration in system tests
Pull Request for Issue #43465.
Summary of Changes
- Change
configuration.phpfile mode to 644, write the file and restores the original file permissions in Cypress system test caseInstallation.cy.js - updated system tests
README.md
This change is developed for branch 4.4-dev and should be merged in all other branches.
Testing Instructions
It was tested on new cloned 4.4-dev branch with the patch, running installation twice on macOS 14.4.1 (Sonoma), Windows 11 Pro and inside Docker container with Debian GNU/Linux 11 (bullseye).
- installation runs without errors == test passed
configuration.phpparameters are set and file mask is read-only for all (444)
Actual result BEFORE applying this Pull Request
Installation fails on macOS and Windows
Expected result AFTER applying this Pull Request
Installation step passed on macOS and Windows
Link to documentations
Please select:
-
[ ] Documentation link for docs.joomla.org:
-
[X] No documentation changes for docs.joomla.org needed
-
[ ] Pull Request link for manual.joomla.org:
-
[X] No documentation changes for manual.joomla.org needed
There is a javascript error which prevents the system tests from running.
There is a javascript error which prevents the system tests from running.
fixed the lint:js errors and commited
i was able to reproduce the issue on w10+laragon
with pr
I have tested this item :white_check_mark: successfully on 3856d5b64339580ddc16818bbee31a50a78332d1
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43466.
I would like to merge this one, but drone still fails. @muhme can you have a look? Looks like there is an issue with the API tests.
I would like to merge this one, but drone still fails. @muhme can you have a look? Looks like there is an issue with the API tests.
I saw drone failed at the weekend, but I can't do anything with it, it looks unspecific with many failures, like the API failures. I tried to reproduce locally with fresh new clone, applied the PR, but running all system tests locally w/o problems.
At the moment there is a different picture, perhaps drone is started again? It doesn't come to phpmin-system-mysql step. I do not know the phan errors and do not know how to see npm errors in /tmp/npm-cache/_logs/2024-05-21T05_40_38_520Z-debug-0.log. sorry
I tried to reproduce locally with fresh new clone, applied the PR, but running all system tests locally w/o problems
same here too
You can check the artifacts, perhaps they give a clue.
You can check the artifacts, perhaps they give a clue.
checked some of the screenshot artifacts, just like with the detailed Cypress logs, unspecific with many errors, which in my opinion have nothing to do with this PR, unfortunately I can't help here, we need someone who can log into drone to check this
I was able to force drone to run (by update PR with changes in the main branch) and i am wondering why the same 40 tests fail again. Since these are the API and mail related tests, the reason must be that setting the parameters in configuration.php does not work - I will check this again on Linux.
I started drone a couple of times before. The only reason I can see, is that there is some special file permission handling or that Joomla is not on the same location as the code which is served in the webserver https://github.com/joomla/joomla-cms/blob/4.4-dev/tests/System/drone-system-run.sh#L14
I found one problem on (hardware based) Ubuntu for me:
- configuration.php is created by apache with user
www-dataand mode 444 - i am running cypress install as user
hluand i am therefore not allowed to change the file permission, nor to write the file
This is usually not a problem in Linux Docker containers, as the user is mostly root inside.
Therefore, the original problem occurs not only under macOS and Windows, but also under Linux as a non-root user.
Running the installation as root aka with sudo is possible with Cypress, but needs additional Cypress installation for rootuser and additional space of 653 MB installed in root/cache/Cypress.
sudo npx cypress run --spec 'tests/System/integration/install/Installation.cy.js'
To prevent the additional Cypress installation for root user we can use actual users Cypress installation cache, e.g.
sudo CYPRESS_CACHE_FOLDER=$HOME/.cache/Cypress npx cypress run --spec 'tests/System/integration/install/Installation.cy.js'
Should we change to sudo?
I assume drone works before this PR because it runs in the Docker container as the root user, which can overwrite read-only files.
And it is not OK that the new changeFilePermissions() does not throw an error if it does not work, this should be able to be fixed.
And I think the same is for drone with this PR, getFilePermissions() or changeFilePermissions() fails silently and parameters in configuration.php are not configured. This is the needed to fix.
Looks good now, restarted drone for another test run. If all is good, I'm goig to merge it.
Thank you very much, this one was a lot of work!