Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Must verify:
- an automatic redirect is performed, if and only if JS is disabled (i.e. using
<noscript>
) - only one redirect is ever performed
- the presence of the BigPipe no-JS cookie after the redirect was followed
- the redirect redirects back to the original location
- the redirect response must have the
cookies:big_pipe
andsession.exists
cache contexts, because it depends on those - all of the above must occur for any user with a session, be it an authenticated or an anonymous user
Comment | File | Size | Author |
---|---|---|---|
#24 | 2674890-24.patch | 9.34 KB | Wim Leers |
|
Comments
Comment #2
Wim LeersComment #4
Wim LeersSo, this is the very first patch that actually tests entire pages generated by BigPipe! It doesn't test how those pages are delivered overall, but it's the first time BigPipe (in its no-JS form) is delivering a (very simple) page.
And in doing so, this is causing two PHP errors:
Why haven't these been discovered before? Because before, we were testing on actual sites, whereas this test is using the
testing
install profile. That install profile only installs required modules. Which has as an indirect consequence that thecore/ajax
asset library is not being loaded on all pages anymore.Steps to reproduce:
core/ajax
asset library is not loaded on the test pageThe solution is quite simple: don't assume
core/ajax
, and hence also theajaxPageState
JS setting in BigPipe's no-JS code paths.Comment #6
Wim LeersThis failure:
is a test expectation for point 5 in the IS.
BigPipeController
does not yet do this. So let's do that.Comment #7
Wim LeersAnd just some clean-up.
Comment #9
Wim LeersOops, the patch equalled the interdiff.
Here's what #7 should've looked like.
Comment #11
Wim LeersThe two remaining failing assertions I cannot reproduce locally:
(Bonus: Either DrupalCI or
run-tests.sh
are apparently horribly broken, because any HTML syntax is apparently escaped away completely. What is actually being asserted there is:$this->assertRaw('<noscript><meta http-equiv="Refresh" content="0; URL=' . base_path() . 'big_pipe/no-js?destination=' . str_replace($base_url, '', $this->url) . '" />' . "\n" . '</noscript>');
.)Which means this is most likely due to DrupalCI installing Drupal in a subdirectory. Or actually, that destination query string is not a relative URL, it's a Drupal path. My bad. Then this should work.
Comment #13
Wim LeersStill same output. I talked to both @catch and @drumm, neither know how to get more useful information out of DrupalCI. Note that it runs with
--keep-results
, but you can't access those results anywhere…So, I have to resort to adding explicit test failures that contain debug output that is HTML-escaped, so that I hopefully will be able to read it. Fingers crossed.
If I run (
$ sudo -u _www php core/scripts/run-tests.sh --keep-results --verbose --color --url http://tres/ --directory modules/big_pipe
) this locally, I get this outputComment #15
Wim LeersTestbot/DrupalCI/Jenkins/run-test.sh === epicfail, because even #13 yields exactly zero useful information:
… once again more stuff being replaced by whitespace. Sigh.
I'm out of ideas.
Comment #16
Wim LeersI've got one more absolutely crazy/silly trick up my sleeves, which should result in output like this:
Comment #18
Wim LeersThat worked, LOL. So now let's add a bit more output so I can really debug this.
Comment #20
Wim LeersThe output shows that #11 was a step in the wrong direction. Reverting #11 and adding debug output for the second failing assertion.
Comment #22
Wim LeersI think this is the solution.
Comment #24
Wim LeersIndeed it was.
Whew.
Comment #25
Wim LeersThis still looks good to me. Let's get this in.
Comment #27
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commentedRTBC - in retrospective.
Comment #28
Wim LeersExcellent, thanks!