Problem/Motivation

Build test, Command/GenerateThemeTest.php is failing on SQLite and 10.3.x. The test estContribStarterkitDevSnapshotWithGitNotInstalled

Drupal\BuildTests\Command\GenerateThemeTest::testContribStarterkitDevSnapshotWithGitNotInstalled
Fake git used by process.
Failed asserting that 0 matches expected 127.

core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php:291

https://git.drupalcode.org/project/drupal/-/pipelines/215476/test_report...

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#18 3458975-nr-bot.txt1.81 MBneeds-review-queue-bot

Issue fork drupal-3458975

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

quietone created an issue. See original summary.

quietone’s picture

Title: GenerateThemeTest.php fails on sqlite » GenerateThemeTest: fails on sqlite
Issue summary: View changes
Related issues: +#3325316: GenerateThemeTest.php is unstable
quietone’s picture

Issue summary: View changes
quietone’s picture

Title: GenerateThemeTest: fails on sqlite » GenerateThemeTest::testContribStarterkitDevSnapshotWithGitNotInstalled fails on sqlite

FWIW, this does pass locally.

quietone’s picture

I take that back, I made a mistake. It is failing locally.

pooja_sharma’s picture

Ahh,, even I tried to replicate on local for me test pass on local , not sure may be missing any step at my end

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

longwave’s picture

Version: 10.3.x-dev » 11.x-dev
Status: Active » Needs review

This appeared to break in the upgrade to Symfony 7.1, but not entirely sure why. Note also that this test only runs on SQLite anyway, it is skipped on other database engines.

What I think is happening is the updated PATH env var is not taking effect, and instead the current PATH is being searched for the git binary. The attempt in the MR succeeds here locally but then fails later, let's see what happens on CI at least.

longwave’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Needs review » Active

Actually I'm not sure how this test worked before, unless git was not available in the environment perhaps?

The fake git is set up and tested, but then the second Process object doesn't override $PATH, so how/why would it find the fake git by that point?

longwave’s picture

Version: 10.3.x-dev » 11.x-dev
Status: Active » Needs review
longwave’s picture

Oh I see, $env is passed into the second Process. But the first Process doesn't technically need it because it is executed from the context of PHP and PATH (or COLUMNS) don't come into play, so I pushed a simplification that works locally.

quietone’s picture

Yes, it does look like it was the change to 7.1 that caused the problem. I started the tests on sqlite.

longwave’s picture

So, this test *does* fail on all database drivers, but *only* if SQLite 3.45 is available. On Drupal CI, the MySQL and Postgres tests run in a different PHP container that only has SQLite 3.40, and so the tests are skipped.

However, for the purposes of this test at least, it seems it's not necessary to check the SQLite version - and I'm wondering if that's the case for any of the build tests.

longwave’s picture

Most tests run on php-8.3-apache:

    _TARGET_PHP: "8.3"

but SQLite changes this:

'PHP 8.3 SQLite 3.45':
  <<: [ *default-stage, *run-on-mr ]
  variables:
    _TARGET_PHP: "8.3-ubuntu"

And then you can see the difference by checking versions in the containers directly:

$ docker run drupalci/php-8.3-apache:production php -r "print (new \PDO('sqlite::memory:'))->query('select sqlite_version()')->fetch()[0];"
3.40.1

$ docker run drupalci/php-8.3-ubuntu-apache:production php -r "print (new \PDO('sqlite::memory:'))->query('select sqlite_version()')->fetch()[0];"
3.45.1
andypost’s picture

andypost’s picture

FYI added changes from MR !8746 allowed to pass tests on 8.4!

EDIT fixed link

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new1.81 MB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

longwave’s picture

Status: Needs work » Needs review
andypost’s picture

Changes looks ready for RTBC but somehow I can't trigger sqlite testing job

bradjones1’s picture

I think maybe Dave needs to trigger it? "You are not authorized to trigger this manual job."

quietone’s picture

I started tests for SQLite

mondrake’s picture

Priority: Normal » Major

I think this is Major if not Critical, since this issue has been systematically failing all SQLite test runs for quite some time.

mondrake’s picture

Priority: Major » Critical

Looking at Issue Priority docs, https://www.drupal.org/docs/develop/issues/fields-and-other-parts-of-an-...

Critical bugs include those that:

[...]
Cause tests to fail in HEAD on the automated testing platform for any supported environment (including random failures), since this blocks all other work.
[...]

andypost’s picture

Status: Needs review » Reviewed & tested by the community

I think it good to go to fix immediate bug and continue (for 11.x) with #3461006: Use Ubuntu images in all CI environments for core

  • catch committed a3e710d7 on 10.3.x
    Issue #3458975 by longwave, quietone: GenerateThemeTest::...

  • catch committed 34e0302e on 10.4.x
    Issue #3458975 by longwave, quietone: GenerateThemeTest::...

  • catch committed 8b7d64bd on 11.0.x
    Issue #3458975 by longwave, quietone: GenerateThemeTest::...

  • catch committed a878833e on 11.x
    Issue #3458975 by longwave, quietone: GenerateThemeTest::...
catch’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked back through to 10.3.x, thanks!

catch’s picture

Status: Fixed » Closed (fixed)

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