Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 301012

run-tests.sh no longer respects specifying a port with the --url option

$
0
0

Updated: Comment #0

Problem/Motivation

Following #1888424: Make Drupal's URL generation logic available to HttpKernel, and minimize code repetition/divergence , the --url flag for run-tests.sh no longer works to specify a particular port. When tests are run, the port is ignored, and therefore any web tests that use the simpletest browser will fail because they are accessing the wrong URL. I'm not sure whether this also impacts other URL generation, but assuming it's related to our HttpKernel integration given the issue that introduced it.

Steps to reproduce

  1. Install Drupal to run on a port other than the default port (e.g. 8888).
  2. Enable simpletest.
  3. Use run-tests.sh to run a web test against this site, e.g.:
    php ./core/scripts/run-tests.sh --verbose --url "http://localhost:8888/d8git" --class "Drupal\block\Tests\BlockTest"
  4. Observe that the test will fail, and the verbose output indicates that the URL used does not include the port:
    Fatal error: Call to a member function label() on a non-object in /Applications/MAMP/htdocs/d8git/core/modules/block/lib/Drupal/block/Tests/BlockTest.php on line 115
    FATAL Drupal\block\Tests\BlockTest: test runner returned a non-zero error code (255).
    - Found database prefix 'simpletest600546' for test ID 1.
    [04-Dec-2013 19:52:56 Europe/Berlin] PHP Fatal error:  Call to a member function label() on a non-object in /Applications/MAMP/htdocs/d8git/core/modules/block/lib/Drupal/block/Tests/BlockTest.php on line 115
    - Removed test files directory.
    - Removed 27 leftover tables.
    Test run duration: 28 sec
    Detailed test results
    ---------------------
    ---- Drupal\block\Tests\BlockTest ----
    Status    Group      Filename          Line Function
    --------------------------------------------------------------------------------
    Pass      Other      BlockTestBase.php   39 Drupal\block\Tests\BlockTestBase->s
        Enabled modules: block, test_page_test
    Pass      Role       BlockTestBase.php   58 Drupal\block\Tests\BlockTestBase->s
        Created role ID 'zigskdoy' with name 'Wf"gM~K:'.
    Pass      Role       BlockTestBase.php   58 Drupal\block\Tests\BlockTestBase->s
        Created permissions: administer blocks, use text format full_html, access
        administration pages
    Pass      User login BlockTestBase.php   58 Drupal\block\Tests\BlockTestBase->s
        User created with name cwe6TGAt and pass yJXnCbvPhQ
    Fail      Browser    BlockTestBase.php   59 Drupal\block\Tests\BlockTestBase->s
        GET http://localhost/d8git/user returned 0 (0 bytes).

Proposed resolution

Restore support for ports in URL generation.

Remaining tasks

TBD

API changes

TBD


Viewing all articles
Browse latest Browse all 301012

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>