Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 5.5, DCI_INSTALLER="drush": noticed while writing XML report #19

Open
wimleers opened this issue Sep 19, 2014 · 0 comments
Open

PHP 5.5, DCI_INSTALLER="drush": noticed while writing XML report #19

wimleers opened this issue Sep 19, 2014 · 0 comments

Comments

@wimleers
Copy link

I already reported #18. The hope was that running with DCI_INSTALLER="drush" rather than DCI_INSTALLER="none" would at least solve the fatals, and hopefully would also write a report successfully.

Sadly it doesn't. :(

Command:

sudo DCI_DBTYPE='mysql' DCI_DBVER='5.5' DCI_PHPVERSION='5.5' DCI_TESTGROUPS='--all' DCI_DRUPALBRANCH='8.0.x' DCI_CONCURRENCY='16' DCI_INSTALLER="drush" ./containers/web/run.sh

The output:

[cut away hundreds of repetitions; the terminal is configured to a fairly small history, which prevents me from seeing more.]

Notice: Undefined offset: 1 in /var/www/core/scripts/run-tests.sh on line 941

Notice: Undefined offset: 1 in /var/www/core/scripts/run-tests.sh on line 941

Notice: Undefined offset: 1 in /var/www/core/scripts/run-tests.sh on line 941

Notice: Undefined offset: 1 in /var/www/core/scripts/run-tests.sh on line 941

Notice: Undefined offset: 1 in /var/www/core/scripts/run-tests.sh on line 941

Notice: Undefined offset: 1 in /var/www/core/scripts/run-tests.sh on line 941

Notice: Undefined offset: 1 in /var/www/core/scripts/run-tests.sh on line 941

Notice: Undefined offset: 1 in /var/www/core/scripts/run-tests.sh on line 941

Notice: Undefined offset: 1 in /var/www/core/scripts/run-tests.sh on line 941

Notice: Undefined offset: 1 in /var/www/core/scripts/run-tests.sh on line 941

Notice: Undefined offset: 1 in /var/www/core/scripts/run-tests.sh on line 941

Notice: Undefined offset: 1 in /var/www/core/scripts/run-tests.sh on line 941

Notice: Undefined offset: 1 in /var/www/core/scripts/run-tests.sh on line 941
real 2387.72
user 0.04
sys 0.05

Saving image build_2014_09_19_090858 at Fri Sep 19 09:48:46 UTC 2014:
3418a04d5fa8b91e0efc27dcd10e9163021b0d1a74587c45dd6c438e688a410b
------------------------------------------------------------------------------
Results directory: /home/testbot/testbotdata/build_2014_09_19_090858/results/
Clean up old Builds on /home/testbot/testbotdata to save disk space
------------------------------------------------------------------------------
Docker run command:
/usr/bin/time -p docker run --link=drupaltestbot-db-mysql-5.5:db --name=build_2014_09_19_090858 -v=/home/testbot/testbotdata/build_2014_09_19_090858/:/var/workspace:rw -v=/home/testbot/testbotdata/build_2014_09_19_090858/:/var/www:rw -p 80  -t drupalci/web-5.5 

Line 941 is:

list($class, $name) = explode('->', $result->function, 2);

This is part of the XML report writing code:

/**
 * Display jUnit XML test results.
 */
function simpletest_script_reporter_write_xml_results() {
  global $args, $test_ids, $results_map;

  $results = Database::getConnection('default', 'test-runner')
    ->query("SELECT * FROM {simpletest} WHERE test_id IN (:test_ids) ORDER BY test_class, message_id", array(
      ':test_ids' => $test_ids,
    ));

  $test_class = '';
  $xml_files = array();

  foreach ($results as $result) {
    if (isset($results_map[$result->status])) {
      if ($result->test_class != $test_class) {
        // We've moved onto a new class, so write the last classes results to a file:
        if (isset($xml_files[$test_class])) {
          file_put_contents($args['xml'] . '/' . $test_class . '.xml', $xml_files[$test_class]['doc']->saveXML());
          unset($xml_files[$test_class]);
        }
        $test_class = $result->test_class;
        if (!isset($xml_files[$test_class])) {
          $doc = new DomDocument('1.0');
          $root = $doc->createElement('testsuite');
          $root = $doc->appendChild($root);
          $xml_files[$test_class] = array('doc' => $doc, 'suite' => $root);
        }
      }

      // For convenience:
      $dom_document = &$xml_files[$test_class]['doc'];

      // Create the XML element for this test case:
      $case = $dom_document->createElement('testcase');
      $case->setAttribute('classname', $test_class);
      list($class, $name) = explode('->', $result->function, 2);
      $case->setAttribute('name', $name);

      …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant