I've been trying to fix the broken tests for D6.2 and D6.3 of CCK. The tests function perfectly on my local installation but fail totally on d.o. Just to be sure I also created a clean new local site with nothing installed and only the modules listed in the tests (CCK and Schema), and that works fine too.

As near as I can tell it is failing to enable Schema, but Schema is listed in the startup section. After spending hours trying to figure out what might be broken I'm at an impass and need some help.

Thanks!

Comments

jthorson’s picture

This is pure speculation, and without actually looking into the problem with any detail, but the comments in the test indicate that the tests require the 'Schema' module to be installed ... but unless it is listed as a dependency in the .info file, the testbot will not download and install the schema module when running the branch test.

You may be able to confirm this theory by disabling the Schema module in your local install and attempting to run the tests again, comparing the results with those returned by the testbot.

rfay’s picture

Actually, *remove* schema, not disable. If it's not available to the tests, that will be the same situation as on the testbot.

Alternately, commit adding schema module as a dependency of one of the modules.

rfay’s picture

I definitely see "Undefined index: Schema" on http://qa.drupal.org/pifr/test/52378 when it tries to enable modules. That's going to be the (first) problem.

karens’s picture

I thought the whole point of listing modules to enable in setUp() was so they would be available. You have to also list them as dependencies? Dependencies of what? CCK does not require Schema. I hesitate to make it a dependency of any of the modules because it's not. It is only used in the tests, as a way to see if the database is being set up correctly.

rfay’s picture

Your tests require schema... There's no way the testbot can know to check out schema if you don't tell it somehow. Dependencies are inferred from the dependencies listed in info files.

Make schema a dependency of a mock module (a module used only by the tests) and everything will suddenly work out.

karens’s picture

Just so I understand this for the future, adding a module to setUp() will NOT enable it? Schema is listed in setUp(). I will do what you suggest but I do not understand what the point of listing modules in setUp() is if that won't enable them.

rfay’s picture

Adding a module to setUp() will enable it... If it exists on the system. Otherwise it will result in an error (exactly what you're getting). If you rm schema from your local install you'll get the same result.

But as you know, one cannot enable a module that does not already exist on the drupal site. That is the problem we're having here.

karens’s picture

Status: Active » Fixed

I *think* I am figuring this out a bit, but this is massively confusing. There are all these instructions about listing every module you need to enable in setUp(), which implies that listing them is all you need to do. I guess you are saying that if you list any module that is neither in your package nor a dependency of your package, it will still not work and you have to also make it a dependency of something, even a pseudo module. I poured over the instructions for simpletests and never saw that.

OK, I'll figure out a way to add a dependency in there and then I'll go back and try to clarify the docs.

If that doesn't work I'll reopen, but I believe you when you tell me what I have to do :)

rfay’s picture

Status: Fixed » Active

setUp() tells *simpletest* to enable a module in the version of the system that it has created.

dependencies[] tells Drupal whether a module can be enabled successfully or not.

In addition, the Project Dependency module searches all the dependencies listed in dependencies[] to find what ought to be actually checked out when testing a given project. Then the testbot uses that information to check out the necessary dependencies.

Hope that makes some sense.

Thanks as always for *all* your incredible work in all these incredible places.

jthorson’s picture

Karen,

There is an open issue in the PIFR queue (or PIFT, I forget which) about enabling 'soft' dependencies on the testbot, which I believe may address this particular situation ... But for now, the testbot only supports hard dependencies as listed in the .info file. Not ideal, but better than what we had before project_dependency. :)

jthorson’s picture

Title: D6 CCK tests fail on d.o. even though they work locally » Support 'test-only' dependencies
Status: Active » Postponed

The 'soft dependencies' issue I was referring to got moved to Project Dependency, located at #698932: "test_dependencies" for dependencies / integration tests.

karens’s picture

Title: Support 'test-only' dependencies » D6 CCK tests fail on d.o. even though they work locally
Status: Postponed » Active

I added a test module to the tests that does nothing but add a dependency on schema, and I added code in setUp() to enable that test module.

I'm still getting all the errors saying schema can't be enabled in the 6.2 tests. When I read through the review log it is not downloading the schema module. Maybe I misunderstood how to add the dependency but it doesn't seem to work. Don't worry for now about the failing tests for 6.3, I just want to get the 6.2 tests working.

rfay’s picture

Sorry, I should have mentioned that the dependencies get calculated when the new dev release gets rolled. And as of now, schema is calculated as a dependency of 6.x-2.x:

drush pdsd cck 6.x-2.x-dev
Array
(
    [701568] => Array
        (
            [uri] => schema
            [version] => 6.x-1.7-rc1
            [tag] => 6.x-1.7-rc1
        )

)
nick_vh’s picture

So just to make this clear, if we change info files and commit. Do a test right afterwards it will not have the needed dependencies until a new dev is rolled? Any way to enforce this change?

rfay’s picture

@Nick_vh you do understand correctly. I'm going to update the FAQ on the project page. As you have found out, I can use Jenkins to rebuild, but I don't know of a way for an unprivileged user to do it at this point. A feature request in project_dependency would be welcome. It sure makes sense to me.

jthorson’s picture

So rfay ... we basically need to duplicate the same commit hook that's used in pift, and have it call project_dependency_[something], correct? Which project_dependency function is the one that performs the rebuild?

jthorson’s picture

Where are we at with this?

arlinsandbulte’s picture

Still having problems with tests failing on d.o, but passing locally.
http://qa.drupal.org/pifr/test/56483

Looks to me like jquery_ui is not being properly enabled.

arlinsandbulte’s picture

jthorson implied this might be because jquery_ui is not explicitly defined as a dependancy in date module... (see #973924: jquery_ui dependency not in .info file for why that is)

rfay’s picture

@arlinsandbulte, please open new issues for new specific problems (this is a new one, right)

If you need jquery_ui, and it's not somewhere in the dependency chain, it will not be loaded by the test.

A workaround for this is to create a "mock module" in a test subdirectory (or perhaps you already have one) and make it have a dependency on jquery _ui.

arlinsandbulte’s picture

DOH! I thought this was about the CCK *DATE* module!
Sorry for the noise.

rfay’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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