The tests of the entity API fail, although they work for me. I recently added tests for the Rules integration, which only works if the Rules module is installed. I assume the problem is that the Rules module is not available? If so, what should we do about that?

see http://qa.drupal.org/pifr/test/27276

Comments

avpaderno’s picture

The class EntityAPIRulesIntegrationTestCase has a reference to rules.module in its setUp() method.
The problem seems caused by the fact the test server install the modules that are being tested but not their dependencies.

fago’s picture

To clarify Rules is no dependency of the EntityAPI, it is just used and needed for the test case.

avpaderno’s picture

@fago: Did you try adding the dependency to rules.module in entity_test.info? The PIFR server can only detect any dependency from the .info files.

fago’s picture

I see. Well, the module doesn't depend on 'rules' but this sounds like a possible workaround. Going to try that.

avpaderno’s picture

Title: entity API test fails due to missing module? » Entity API test fails due to missing module?
fago’s picture

Priority: Normal » Major

Ouch, now there is another FATAL error. I guess the workaround doesn't work either, so the main tests fail now too (as there is no Rules module).

Any suggestions what to do now?

avpaderno’s picture

Title: Entity API test fails due to missing module? » Tests depending from a module not required from the tested module fail
Project: Drupal.org infrastructure » Project Issue File Review
Version: » 6.x-2.x-dev
Component: qa.drupal.org » Code

PIFR is the module that handles the tests.

To make a summary, the problem is that a test can depend on a Drupal core module, or the module being tested; it's not possible for the test to require an extra module, and it's not possible to test the integration of two separated modules.

rfay’s picture

You can add a 'dependencies' key to your getInfo, as below. Sadly, this doesn't actually help, as the dependent module is not loaded by the testbot; there is currently no support for that. So adding the dependencies key just prevents the test from being run on the bot. But it allows a valid test to not cause your entire testsuite to fail.


class RenderExampleTestCase extends DrupalWebTestCase {
  public static function getInfo() {
    return array(
      'name' => 'Render example functionality',
      'description' => t('Test Render Example'),
      'group' => 'Examples',
      'dependencies' => array('devel'),
    );
  }
fago’s picture

Strangely, the entity API tests suddenly work now?

See http://qa.drupal.org/pifr/test/27276

fago’s picture

Very strange, the profile2 tests (depending on the Entity API) are now failing because of the same problem. So it looks like some tests bots fail, others not.

I guess the bot is testing the Entity CRUD API too, because it is a dependency of profile2. However for Rules this is not the case!? Unrelated, the Rules tests also fail from time to time but that's probably another issue.

Profile2: http://qa.drupal.org/pifr/test/54698

add #8, thanks I didn't know that. Sounds like the best thing to do for now.

avpaderno’s picture

I am not sure if the modules from which Profile2 depends are loaded, or not.
Looking at the log, the checkout operation is completed, but there are two operations that are reported to be ignored.

[09:20:24] Dependency [entity] checkout complete.
[09:20:27] Dependency [profile2] checkout complete.
[09:20:27] Invoking operation [check]...
[09:20:27] Ignoring operation [check].
[09:20:27] Invoking operation [apply]...
[09:20:27] Ignoring operation [apply].
fago’s picture

ok, I've implemented #8 seems to work.

It says there are 4 passed for the Rules test case, what is correct. So perhaps the test bot even recognizes that key already?

tstoeckler’s picture

When I add 'dependecies' the testbot still runs the tests and then fails because the modules aren't loaded. What am I doing wrong? (Clock module - http://qa.drupal.org/pifr/test/47673)

boombatower’s picture

Status: Active » Postponed (maintainer needs more info)

Sounds like you are looking for the soft dependencies that will be provided by #102102: Parse project .info files: present module list and dependency information.

Meaning you have dependencies required for testing, but not required for your module to work. Like "recommended" modules...modules that you provide integration for, but are not required.

dave reid’s picture

This also has been fixed from within SimpleTest 6.x-2.x itself. It now respsects the 'dependencies' property in getInfo() and will skip the test. It's still up to #102102: Parse project .info files: present module list and dependency information to actually pull in the proper modules for testing though.

avpaderno’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)

I am closing this issue, which is for a not supported Drupal version.