Problem

  • The internal test site instance of a WebTestBase is no longer able to locate extensions in the site-specific directory of the parent site; i.e.:
    1. Install Drupal with a site directory of /sites/default (or a custom site directory)
    2. Install e.g. the Flag module into /sites/default/modules/flag
    3. Attempting to run Flag module (web) tests fails, because Simpletest leverages Drupal's multi-site mechanism itself now.

      /sites/default is a different site than /sites/simpletest/123456.

Unclear

  • Do we actually need to support this? Or can we ask developers to simply place modules for which they want to run (web) tests into the site-wide directory? (i.e., /modules)
CommentFileSizeAuthor
#3 mydefault.tgz783 bytessun
#3 drupal8.test-site-parent.3.patch2.74 KBsun

Comments

sun’s picture

Technically, Drupal does exactly what it is supposed to do now:

Cleanly separate the test site environment from the parent site environment.

In other words, the built-in multi-site functionality just simply works and performs its job. And it performs well :)

longwave’s picture

I agree that in one way this is "works as designed", but I can also see the case where someone is actively using a multisite install, adds a new site to it, and wants to run web tests against custom or contrib code inside that new site - now, they are no longer able to do that without making the code available to all sites in the install, but this may not be feasible if e.g. there is a different version of those modules in another site in the install.

sun’s picture

Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new2.74 KB
new783 bytes

Yeah, I guess I can see how that could possibly break your common development workflow, in case you're using the multi-site functionality yourself.

Attached patch adds a tweak that is very similar to the existing "parent installation profile" facility in HEAD already.

Unless you have a module with tests in a site-specific directory already, I'm additionally attaching a quick & dirty & trivial test case module that you can extract into /sites/default and the MyDefault test should pass. (works for me)

sun’s picture

Any feedback, anyone? I was told that this bug is currently breaking all web tests of contributed modules, so it would be good to resolve this as quickly as possible.

longwave’s picture

Tested this with the Ubercart test suite. Initially ran in to trouble because I didn't realise node module was no longer enabled by default, and many Ubercart tests rely on this, but finally figured out what was going on.

I can confirm that by moving Ubercart into /sites/default/modules, tests fail as they do on testbot through both the UI and run-tests.sh, but after applying this patch, both the UI and run-tests.sh successfully run all the tests I tried, so this is RTBC.

longwave’s picture

Status: Needs review » Reviewed & tested by the community
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

longwave’s picture

Status: Fixed » Reviewed & tested by the community

This patch doesn't seem to have been pushed.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Now pushed, well spotted!

Status: Fixed » Closed (fixed)

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