Problem/Motivation

The SQLite tests in D7 GitlabCI are green, but if we examine them closely, they are never run at all, because there are errors (probably caused by the image used in _TARGET_DB) - https://git.drupalcode.org/project/drupal/-/jobs/234413:

  1. $ sudo service apache2 start
    Starting Apache httpd web server: apache2(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    AH00015: Unable to open logs
    Action 'start' failed.
    The Apache error log may have more information.
    
  2. $ sudo -u www-data php ./scripts/run-tests.sh --color --concurrency "$CONCURRENCY" --url "$SIMPLETEST_BASE_URL" --verbose --fail-only --all --xml "$CI_PROJECT_DIR/sites/default/files/simpletest" --ci-parallel-node-index $CI_PARALLEL_NODE_INDEX --ci-parallel-node-total $CI_PARALLEL_NODE_TOTAL
    PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in lock_may_be_available() (line 167 of /builds/project/drupal/includes/lock.inc).
    

Steps to reproduce

See: https://git.drupalcode.org/project/drupal/-/jobs/234413

Proposed resolution

Try to update the _TARGET_DB to "sqlite-3" to match D10 to see if this will be sufficient, or if any other changes will be needed regarding the second error.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3397117

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

poker10 created an issue. See original summary.

fjgarlin made their first commit to this issue’s fork.

fjgarlin’s picture

Assigned: Unassigned » fjgarlin

After several attempts, it seems that the problem is permissions related. Running the site install as user "www-data" seems to fix the issue.
I'll continue working on it next week, clean up the MR and see if we can capture that exception early on.

fjgarlin’s picture

Status: Active » Needs review

This is now ready to review.

Changes:

  • Run the drupal drush install as www-data user so permissions in folders are set right.
  • Changed the sqlite image to the one that was created to run sqlite tests.
  • Wrapped the setup method in the try catch to make sure that early errors are also reported as errors by run-tests.sh

Full pipeline running here: https://git.drupalcode.org/issue/drupal-3397117/-/pipelines/40161
And sqlite jobs can be seen running here: https://git.drupalcode.org/issue/drupal-3397117/-/jobs/236784

poker10’s picture

Thanks for working on this!

I think the changes in pipeline.yml and .gitlab-ci.yml looks good and are in line with the D10 code.

The change in drupal_web_test_case.php is indeed a good catch, but I am not sure if we should fix that here, as it does not seems to be 100% related to the SQLite issue (AFAICS SQLite seems to run again also when this try-catch fix was not added). I found this issue now: #2763435: Exceptions during the setUp() or tearDown() method of a test are not handled, so I think we should split the fix here to just include the fixes to pipeline.yml and .gitlab-ci.yml and move the try-catch fix to the mentioned issue, so we do not get things mixed up.

fjgarlin’s picture

Thanks for the feedback. I took out the changes from drupal_web_test_case.php and moved them to #2763435: Exceptions during the setUp() or tearDown() method of a test are not handled, where there is now an MR ready to review.

The changes for this issue and this MR are ready too. Only pipeline.yml and .gitlab-ci.yml are changed now and all GitLab CI tests run as expected now.

fjgarlin’s picture

Assigned: fjgarlin » Unassigned
bramdriesen’s picture

Status: Needs review » Reviewed & tested by the community

MR looks straight forward enough and the fact the tests have been run successfully and are all green makes me think we can RTBC this and merge it! 🙂

  • poker10 committed 5d8131fc on 7.x
    Issue #3397117 by fjgarlin: SQLite testing in GitlabCI - apache2(98)...
poker10’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.