Problem/Motivation

BuildTestBase assumes that DRUPAL_ROOT and the APP_ROOT are the same. If you're using gitlabci for a contrib project this is not the case as it uses drupal/core-recommended where DRUPAL_ROOT is in a sub directory called docroot.

Proposed resolution

BuildTestBase should find the root composer.json and work out the APP ROOT and DRUPAL_ROOT from there.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3403382

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

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
alexpott’s picture

wim leers’s picture

Status: Needs review » Needs work

Only one failure:

    1) Drupal\BuildTests\Framework\Tests\BuildTestTest::testCopyCodebaseExclude
    Failed asserting that file
    "/tmp/build_workspace_b44d87ed120fbe0c41c5d4572777553dQLQ8rc/copied_codebase/modules/my_module/vendor/my_vendor/composer.json"
    exists.

Which is extra special, because it's a test for the build test infrastructure, and it uses VFS. It's the only build test test using VFS.

I think the problem is that the build test infra in the MR is using Composer\InstalledVersions, but in the VFS mock, there's nothing composer-related?

wim leers’s picture

I wonder if it would be simpler to not use VFS? 🤔

alexpott’s picture

Status: Needs work » Needs review

I've addressed @Wim Leers's review.

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

Looks perfect now! 🚀

  • catch committed cbbe53da on 11.x
    Issue #3403382 by alexpott, Wim Leers: BuildTestBase makes assumptions...
catch’s picture

Version: 11.x-dev » 10.2.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed/pushed to 11.x (which will also be 10.3.x once it's branched), thanks!

I think we could probably backport this to 10.2.x since it's test only, but can't get my head around whether there's any bc implications for contrib/custom build tests at all - feels like there are not, but leaving PTBP for a bit.

alexpott’s picture

Contrib build tests running on DrupalCI are completely broken atm. I wrote this MR to fix the 1 contrib module I know that has a build test. I think this is worth backporting. As you can see from the MR none of the core build tests have had to change due to this MR - it's only the tests of the build tests that have.

  • catch committed f0fda9de on 10.2.x
    Issue #3403382 by alexpott, Wim Leers: BuildTestBase makes assumptions...
catch’s picture

Status: Patch (to be ported) » Fixed

Fair enough. Cherry-picked to 10.2.x.

Status: Fixed » Closed (fixed)

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