Problem/Motivation

Discovered this issue today while debugging test failures introduced by changes in my basefields2x branch (which uses hook_entity_base_field_info_alter() to alter base field display config). This caused the tests in the Asset module to fail, because assets base fields were being altered, even though the module implementing that hook should NOT have been enabled during the test.

I figured out that it is due to our custom profile install task that installs a default set of modules. This means a bunch of farmOS modules are being installed for every functional test. This slows things down and creates unwanted side-effects, making it impossible to test modules in isolation.

We need to figure out how to prevent that from happening.

Proposed resolution

TBD

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

Ultimately this is due to the fact that we have a custom install task for installing "optional" modules after farmOS itself is installed. This is a nice feature, IMO, but maybe it is a flawed idea.

We ALSO present this same form AFTER installation via the farm_settings module, which is installed by default with farmOS.

So, one option might be: we remove the install task and just require site admins to enable optional modules post-install. There are some other issues/considerations with this approach, however:

  • It isn't obvious that the /farm/settings form exists, so someone installing farmOS won't see it. We've talked about adding a popup/redirect that triggers on first load as a potential option there...
  • I currently rely on these "default" modules being installed on my Farmier hosting system. (not farmOS's concern, but worth mentioning)
m.stenta’s picture

Priority: Normal » Major

Setting this to "Major" priority.

  • m.stenta committed 11c2f32 on 2.x
    Issue #3183739: Functional tests are installing all default farmOS...
m.stenta’s picture

Status: Active » Needs work

I committed a VERY UGLY but simple temporary fix for this, which sets a PHP $GLOBALS['farm_test'] = TRUE; in a base class that all our functional tests can inherit from, along with a bit of logic in farm_install_modules() that checks for this and prevents installing optional modules.

I know I know... I don't like it either... but it serves the purpose in the short term until we figure out a long term fix. Setting this to "needs work".

m.stenta’s picture

(FYI: The "fix" causes the farm_api test to fail because of an implicit dependency on Views, which is no longer being installed. So tests are currently failing, but we'll fix that...)

m.stenta’s picture

Status: Needs work » Fixed

Closing this as "fixed". The temporary workaround will probably remain for the foreseeable future.

Status: Fixed » Closed (fixed)

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