Unit/System Tests PR-4.4-dev Pending

User tests: Successful: Unsuccessful:

avatar muhme
muhme
13 May 2024

Pull Request for Issue #43465.

Summary of Changes

  • Change configuration.php file mode to 644, write the file and restores the original file permissions in Cypress system test case Installation.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.php parameters 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:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

6b42574 13 May 2024 avatar muhme typo
avatar muhme muhme - open - 13 May 2024
avatar muhme muhme - change - 13 May 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 13 May 2024
Category Unit Tests Repository JavaScript
avatar muhme muhme - change - 13 May 2024
Labels Added: Unit/System Tests PR-4.4-dev
avatar laoneo laoneo - change - 14 May 2024
Title
Fix issue 43465
Consider file permissions when writing configuration in system tests
avatar laoneo laoneo - edited - 14 May 2024
4cd169a 15 May 2024 avatar muhme typo
9da9415 15 May 2024 avatar muhme typo
avatar laoneo
laoneo - comment - 17 May 2024

There is a javascript error which prevents the system tests from running.

avatar muhme
muhme - comment - 17 May 2024

There is a javascript error which prevents the system tests from running.

fixed the lint:js errors and commited

avatar alikon
alikon - comment - 18 May 2024

i was able to reproduce the issue on w10+laragon
image

with pr

image

avatar alikon alikon - test_item - 18 May 2024 - Tested successfully
avatar alikon
alikon - comment - 18 May 2024

I have tested this item ✅ successfully on 3856d5b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43466.

avatar laoneo
laoneo - comment - 21 May 2024

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.

avatar muhme
muhme - comment - 21 May 2024

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

avatar alikon
alikon - comment - 21 May 2024

I tried to reproduce locally with fresh new clone, applied the PR, but running all system tests locally w/o problems

same here too

avatar laoneo
laoneo - comment - 22 May 2024

You can check the artifacts, perhaps they give a clue.
image

avatar muhme
muhme - comment - 23 May 2024

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

avatar muhme
muhme - comment - 31 May 2024

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.

avatar laoneo
laoneo - comment - 1 Jun 2024

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

avatar muhme
muhme - comment - 1 Jun 2024

I found one problem on (hardware based) Ubuntu for me:

  • configuration.php is created by apache with user www-data and mode 444
  • i am running cypress install as user hlu and 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.

avatar laoneo
laoneo - comment - 6 Jun 2024

Looks good now, restarted drone for another test run. If all is good, I'm goig to merge it.

avatar laoneo laoneo - change - 7 Jun 2024
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2024-06-07 12:02:40
Closed_By laoneo
avatar laoneo laoneo - close - 7 Jun 2024
avatar laoneo laoneo - merge - 7 Jun 2024
avatar laoneo
laoneo - comment - 7 Jun 2024

Thank you very much, this one was a lot of work!

Add a Comment

Login with GitHub to post a comment