Problem/Motivation
with #2343943: Language domain may not be left blank for default language we're using gethostname().
This points on the new testbot infrastructure not to localhost (as it does on the old one), it does point to the real hostname of the docker image (which is random).
So after setting the domain URL for english, drupal redirects to an url which is different from before and the cookie is not correct anymore, so we end up with an Access Denied.
Proposed resolution
Using parse_url($base_url, PHP_URL_HOST);
which returns the same Host URI as it is used in WebTestBase::getAbsoluteUrl()
Remaining tasks
Review
User interface changes
none
API changes
none
Comment | File | Size | Author |
---|---|---|---|
#8 | interdiff-3-8.txt | 1.38 KB | Schnitzel |
#8 | 2350543-gethostname-breaks-testbot-8.patch | 2.15 KB | Schnitzel |
#6 | 2350543-3.txt | 7.35 KB | Schnitzel |
#6 | 1__vagrant_debian-7____drupalci_testbot__bash__und_Main_Window.jpg | 1.35 MB | Schnitzel |
#3 | 2350543-gethostname-breaks-testbot-3.patch | 2.15 KB | Schnitzel |
Comments
Comment #1
Schnitzel CreditAttribution: Schnitzel commentedComment #2
Schnitzel CreditAttribution: Schnitzel commentedComment #3
Schnitzel CreditAttribution: Schnitzel commentedComment #4
Schnitzel CreditAttribution: Schnitzel commentedComment #5
Schnitzel CreditAttribution: Schnitzel commentedComment #6
Schnitzel CreditAttribution: Schnitzel commentedscreenshot and log of new testbot run, which proves it works :)
Comment #7
alimac CreditAttribution: alimac commentedSmall nit: in the surrounding comments the verb is in command form (Add, Change, etc.) so I think this comment should use "Get" instead of "Getting".
Comment #8
Schnitzel CreditAttribution: Schnitzel commentedaddressing #7.
thanks for review :)
Comment #9
alimac CreditAttribution: alimac commentedI downloaded the new testbot containers (https://www.drupal.org/project/drupalci_testbot) and ran the tests on them, which passed. I read through the patch and verified that it replaces the previous method of obtaining the hostname (
gethostname()
) with a more reliable method usingparse_url($base_url, PHP_URL_HOST)
.Marking as RTBC.
Comment #10
Schnitzel CreditAttribution: Schnitzel commentedComment #11
alexpottI think we should have a replacement for
global $base_url
however our concept and what is available on the Symfony request is different. Going forward with this patch to unblock testbot improvements.Committed 853741a and pushed to 8.0.x. Thanks!
Comment #13
webchickHonestly, I don't think we even have to be all that fancy. You can see that the domain below is completely made up (it.example.com) so in this case, we should probably just make it "example.com."
Here's Yet Another Follow-Up where we can try and do that: #2350937: Remove fanciness from various language tests
However, gethostname() is really just a standard PHP function, not anything overly fancy, so it's weird we would not be able to call it and instead have to do workarounds. Filed #2350935: Testbots should not break when gethostname() is called for that.
Comment #14
alimac CreditAttribution: alimac commented@webchick in this particular test, after submitting the form it redirects to the default language domain URL, so the test would fail unless the host was configured to use example.com (one of my earlier patches used en.example.com: https://www.drupal.org/node/2343943#comment-9192485).
Comment #15
webchickYep, just figured that out in the first sub-issue. :( The point about testbot NG brittleness I think is still worthy of the second issue though, since the workaround here is quite advanced.
Comment #17
YesCT CreditAttribution: YesCT commentedfixing the tag, so I can delete the least used one.