Running run-tests.sh with the --browser option causes the following exception.

PHP Fatal error:  Uncaught exception 'LogicException' with message 'Render context is empty, because render() was called outside of a renderRoot() or renderPlain() call. Use renderPlain()/renderRoot() or #lazy_builder/#pre_render instead.' in /Volumes/devdisk/dev/sites/drupal8alt.dev/core/lib/Drupal/Core/Render/Renderer.php:229
Stack trace:
#0 /Volumes/devdisk/dev/sites/drupal8alt.dev/core/lib/Drupal/Core/Render/Renderer.php(184): Drupal\Core\Render\Renderer->doRender(Array, false)
#1 /Volumes/devdisk/dev/sites/drupal8alt.dev/core/includes/common.inc(1074): Drupal\Core\Render\Renderer->render(Array, false)
#2 /Volumes/devdisk/dev/sites/drupal8alt.dev/core/scripts/run-tests.sh(1207): drupal_render(Array)
#3 /Volumes/devdisk/dev/sites/drupal8alt.dev/core/scripts/run-tests.sh(96): simpletest_script_open_browser()
#4 {main}
  thrown in /Volumes/devdisk/dev/sites/drupal8alt.dev/core/lib/Drupal/Core/Render/Renderer.php on line 229

This is due to #2450993: Rendered Cache Metadata created during the main controller request gets lost.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug, because of a PHP notice
Issue priority Normal, because the functionality still works

Comments

wim leers’s picture

Status: Needs review » Reviewed & tested by the community
Related issues: +#2450993: Rendered Cache Metadata created during the main controller request gets lost

Oops… Sorry about that.

  • catch committed a4e16d6 on 8.0.x
    Issue #2527486 by alexpott: --browser in run-tests.sh broken
    
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

Status: Fixed » Closed (fixed)

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

rocketeerbkw’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new871 bytes

This is still broken

PHP Notice: Array to string conversion in /Users/rocketeerbkw/Sites/rbip8/core/scripts/run-tests.sh on line 1274
PHP Stack trace:
PHP 1. {main}() /Users/rocketeerbkw/Sites/rbip8/core/scripts/run-tests.sh:0
PHP 2. simpletest_script_open_browser() /Users/rocketeerbkw/Sites/rbip8/core/scripts/run-tests.sh:97

Notice: Array to string conversion in /Users/rocketeerbkw/Sites/rbip8/core/scripts/run-tests.sh on line 1274

Call Stack:
0.0027 441824 1. {main}() /Users/rocketeerbkw/Sites/rbip8/core/scripts/run-tests.sh:0
27.0238 22679344 2. simpletest_script_open_browser() /Users/rocketeerbkw/Sites/rbip8/core/scripts/run-tests.sh:97

+++ b/core/scripts/run-tests.sh
@@ -1204,7 +1204,8 @@ function simpletest_script_open_browser() {
+  $html = '<head>' . ($js_assets_header) . $render_service->renderPlain($css_assets) . '</head><body>' . $render_service->renderPlain($form) . $render_service->renderPlain($js_assets_footer) .'</body>';

I think you missed a $render_service->renderPlain for $js_assets_header in that patch?

dawehner’s picture

Manual testing worked:

Before

~/w/d8 (8.0.x) $ d8st --browser --class "Drupal\views\Tests\ViewsEscapingTest"

Drupal test run
---------------

Tests to be run:
  - Drupal\views\Tests\ViewsEscapingTest

Test run started:
  Sunday, September 13, 2015 - 08:38

Test summary
------------

Drupal\views\Tests\ViewsEscapingTest                           9 passes

Test run duration: 9 sec

PHP Notice:  Array to string conversion in /core/scripts/run-tests.sh on line 1274

Notice: Array to string conversion in /core/scripts/run-tests.sh on line 1274

After

~/w/d8 (8.0.x) $ d8st --browser --class "Drupal\views\Tests\ViewsEscapingTest"

Drupal test run
---------------

Tests to be run:
  - Drupal\views\Tests\ViewsEscapingTest

Test run started:
  Sunday, September 13, 2015 - 08:39

Test summary
------------

Drupal\views\Tests\ViewsEscapingTest                           9 passes

Test run duration: 8 sec

Just had a look at the JsCollectionRender and it seems to be that maybe @alexpott has disabled the display of notices on his CLI php config,
because it was a render array at least since 2013.

dawehner’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

So it should be RTBC

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Yeah this has been emitting errors for me for ages - but it didn't break the page so I was not bothered :) - thanks @rocketeerbkw

Committed e38ae99 and pushed to 8.0.x. Thanks!

  • alexpott committed e38ae99 on 8.0.x
    Issue #2527486 followup by rocketeerbkw: --browser in run-tests.sh...
alexpott’s picture

@rocketeerbkw btw a new issue would have been appropriate.

Status: Fixed » Closed (fixed)

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