Uploaded image for project: 'Islandora'
  1. Islandora
  2. ISLANDORA-1858

Islandora Tests Cannot Be Run Through Web Interface



    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:


      It looks like test cannot be run from within the web interface anymore. There have been a couple posts on the list about this issue:

      I've got the tests setup now and they will run though the drush interface, but not through the drupal web interface. This is somewhat deceiving as we have this nice form alter that shows you the status of the filter drupal file. Make it seem like test should run though the web interface.

      I think that either test should be made to work through the web interface, or this form alter should be changed to tell users that they cannot be run through the web interface.

      After a lot of digging and thinking our development environment was broken I found that the cause of the failed test is this check:

      Since tests are run in a batch in the web interface, adding the derivative operations into the batch breaks the assumption in the derivative hooks are going to run immediately which makes this test case fail:

      Some options for fixes:

      1. An ugly way to fix this is to test if we are in a test and if so don't batch the derivatives. I don't like the idea of adding tooling for tests to the main module, but it does fix the issue nicely.
        $test_info = $GLOBALS['drupal_test_info'];
        if (empty($batch_array) || !empty($test_info['test_run_id']))
      2. Another option would be to remove this test case altogether, but it is nice to see that these hooks are firing correctly.
      3. A third option would be to change the alter of the web interface to warn people not to run the tests in that manner. I would argue that this isn't a very good option.

      Like to hear if anyone has some input on this one.




            • Assignee:
              jonathan.green Jonathan Green
              jonathan.green Jonathan Green
            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created: