Problem/Motivation

Quick attempts to have SQLite to run failed in the "PHPUnit Unit" job for the tests:
- PhpUnitCliTest.php
- TestSiteApplicationTest.php

Similar configurations for MySQL and PosgreSQL do work, so it might be related to the configuration of the webserver, or permissions or access to the DB.

Steps to reproduce

See the MR pipelines that will follow this issue creation that will trigger SQLite tests automatically.

Proposed resolution

Fix SQLite.

Remaining tasks

Continue working on the MR.

User interface changes

API changes

Data model changes

Issue fork drupal-3385620

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:

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

fjgarlin created an issue. See original summary.

fjgarlin’s picture

Title: Add SQLite as an option for testing » [GitlabCI] SQLite currently not working
Project: GitlabCI Testbed for Drupal core » Drupal core
Version: » 11.x-dev
Component: Code » phpunit

Moving this to core. Recommended to create a new fork and branch from there instead.

A good starting point for the new MR is to uncomment the SQLite options in the matrix and start testing/debugging within the MR.

catch’s picture

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

andypost’s picture

andypost’s picture

Status: Active » Needs work

Somehow run-tests require --dburlin custom format https://git.drupalcode.org/issue/drupal-3385620/-/jobs/97891

ERROR: Invalid --dburl. Reason: Minimum requirement: driver://host/database

andypost’s picture

I pushed fake sqlite-3 image which is sleeping all the time, so it used to conform other databases

https://git.drupalcode.org/project/drupalci_environments/-/commit/e72735...

andypost’s picture

Nightwatch tests needs variable https://git.drupalcode.org/issue/drupal-3385620/-/jobs/98006

And one kernel test fails https://git.drupalcode.org/issue/drupal-3385620/-/jobs/98034

    Testing Drupal\Tests\migrate\Kernel\SqlBaseTest
    .F..                                                                4 / 4
    (100%)
    
    Time: 00:03.946, Memory: 4.00 MB
    
    There was 1 failure:
    
    1) Drupal\Tests\migrate\Kernel\SqlBaseTest::testBrokenConnection
    Failed asserting that exception of type
    "Drupal\migrate\Exception\RequirementsException" is thrown.
    
    /builds/issue/drupal-3385620/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:122
    /builds/issue/drupal-3385620/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:55
    /builds/issue/drupal-3385620/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    
    FAILURES!
    Tests: 4, Assertions: 17, Failures: 1.
wim leers’s picture

Wow I didn't even realize this was not yet working — because in my experience, SQLite-on-RAMdisk is way faster than MySQL. So that means this has the potential to further speed up the time to get complete test results. Maybe not for core (where MariaDB/MySQL is used by >90% of sites), but for contrib it could help!

fjgarlin’s picture

For D7 core, where it just worked without issues on a very similar setup, SQLite is blazing fast.

I'm close to finish some other priorities (like D7 core and D7 contrib GitlabCI integration) and then I should be able to jump on this, but happy for you all to try to fix and debug.

catch’s picture

If it's significantly faster than mysql we could consider setting sqlite as the default MR environment, and then ensure we run MySQL tests too prior to commit.

fjgarlin’s picture

Status: Needs work » Needs review

I think this is ready for review now.

MR: https://git.drupalcode.org/project/drupal/-/merge_requests/4820/diffs

Note that we skipped two tests for SQLite based on Slack conversation https://drupal.slack.com/archives/CGKLP028K/p1695980781697999 with @catch. Both tests test for a non-existent database but SQLite creates them on the fly if they don't exist.

Pipeline with SQLite runs: https://git.drupalcode.org/issue/drupal-3385620/-/pipelines/25125

catch’s picture

Status: Needs review » Reviewed & tested by the community

Looks great to me, we're only skipping the tests here no actual refactoring, so I think it's OK in the one issue. We should enable this and then we'll get a better idea about overall stability - and be able to switch more of DrupalCI off too.

  • longwave committed 7f06eb5e on 10.1.x
    Issue #3385620 by fjgarlin, andypost: [GitlabCI] SQLite currently not...
longwave’s picture

Status: Reviewed & tested by the community » Fixed

Agree that skipping those two tests on SQLite is fine given they are only for edge cases in migrate.

Committed and pushed d0cfc6d004 to 11.x and 7f06eb5ed8 to 10.1.x. Thanks!

  • longwave committed d0cfc6d0 on 11.x
    Issue #3385620 by fjgarlin, andypost: [GitlabCI] SQLite currently not...
catch’s picture

Version: 11.x-dev » 10.1.x-dev

Moved sqlite down to daily tests for 11.x and 10.1.x on DrupalCI.

Status: Fixed » Closed (fixed)

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