Page MenuHomePhabricator

Delete broken ZeroBanner browsertests Jenkins job
Closed, ResolvedPublic

Event Timeline

zeljkofilipin updated the task description. (Show Details)
zeljkofilipin raised the priority of this task from to Normal.
zeljkofilipin claimed this task.
zeljkofilipin added subscribers: hashar, zeljkofilipin.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 23 2015, 11:15 AM
zeljkofilipin renamed this task from Fix or delete browsertests* Jenkins jobs that are failing for more than a week to Fix or delete ZeroBanner browsertests Jenkins job.Sep 23 2015, 11:28 AM
zeljkofilipin set Security to None.
zeljkofilipin moved this task from Inbox to In Progress on the Browser-Tests-Infrastructure board.

Change 239912 had a related patch set uploaded (by Zfilipin):
Browsertests: switch from PhantomJS to Chrome

https://gerrit.wikimedia.org/r/239912

I am not sure, but looks like the problem is not that the header changed:

$ git log --grep X-CS
commit 0d44661ad18e3030342fa475f94014635e4069a6
Author: Yuri Astrakhan <yurik@wikimedia.org>
Date:   Sun Aug 17 23:56:54 2014 -0400

    If X-CS is TESTON, outputs additional debug info in the banner
    
    Need to figure out why opera mini is not working
    
    Change-Id: Ie3b69226a42e075fd0c00e37c92885e0be6309de

commit a87c4e68fbe31b5d27135d954760c35d27c8b6e2
Author: Yuri Astrakhan <yurik@wikimedia.org>
Date:   Wed Jul 16 18:03:12 2014 +0300

    Cleaned up X-Forward-Proto variance
    
    X-CS=ON now does not vary on protocol or proxy
    
    Change-Id: I4247efe54c005cb6c2a22b6fa579fcc146204f5f

commit 502444d240aac0feeeae2f2884f3013f7a1c0b97
Author: Yuri Astrakhan <yurik@wikimedia.org>
Date:   Sat Jul 5 23:38:14 2014 -0400

    Unified HTML with image banners for non-js users
    
    See https://www.mediawiki.org/wiki/Requests_for_comment/Unfragmented_ZERO_design
    
    * !!! Config is now tests for X-Forwarded-By & protocol for all requests
    * When X-CS === "ON", generates banner and config object on the fly
    * changed default for bannerWarning - migrating as true, but in new configs - false.
    * Generate banners on the fly using imagemagick
    * Handle betalabs cluster suffix with a global $wgZeroBannerClusterDomain
    * In unified, no longer redirect non-free zero. requests to special,
      show red banner instead
    
    To test, set HEADER X-CS to a valid entity, but also supply X-CS via URL:
    * http://127.0.0.1:8080/wiki/Main_Page?X-CS=ON&debug=true

Looks like mediawiki receives the headers. Look for lines with X-CS.

vagrant@mediawiki-vagrant:/vagrant/logs$ grep X-CS *.log -C 5
mediawiki-wiki-debug.log-[ContentHandler] Created handler for css: CssContentHandler
mediawiki-wiki-debug.log-Start request GET /wiki/Main_Page
mediawiki-wiki-debug.log-HTTP HEADERS:
mediawiki-wiki-debug.log-ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
mediawiki-wiki-debug.log-USER-AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.0.0 Safari/538.1
mediawiki-wiki-debug.log:X-CS: TESTON
mediawiki-wiki-debug.log-CONNECTION: Keep-Alive
mediawiki-wiki-debug.log-ACCEPT-ENCODING: gzip, deflate
mediawiki-wiki-debug.log-ACCEPT-LANGUAGE: en-US,*
mediawiki-wiki-debug.log-HOST: 127.0.0.1:8080
mediawiki-wiki-debug.log-[redis] Creating a new RedisConnectionPool instance with id d70d28fd70891a6f32c19060fdf71767aaa0c97e.
--
mediawiki-wiki-debug.log-[caches] LocalisationCache: using store LCStoreCDB
mediawiki-wiki-debug.log-Start request GET /wiki/Main_Page
mediawiki-wiki-debug.log-HTTP HEADERS:
mediawiki-wiki-debug.log-ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
mediawiki-wiki-debug.log-USER-AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.0.0 Safari/538.1
mediawiki-wiki-debug.log:X-CS: TESTON
mediawiki-wiki-debug.log-CONNECTION: Keep-Alive
mediawiki-wiki-debug.log-ACCEPT-ENCODING: gzip, deflate
mediawiki-wiki-debug.log-ACCEPT-LANGUAGE: en-US,*
mediawiki-wiki-debug.log-HOST: 127.0.0.1:8080
mediawiki-wiki-debug.log-[redis] Creating a new RedisConnectionPool instance with id d70d28fd70891a6f32c19060fdf71767aaa0c97e.
--
mediawiki-wiki-debug.log-[ContentHandler] Created handler for css: CssContentHandler
mediawiki-wiki-debug.log-Start request GET /wiki/Main_Page
mediawiki-wiki-debug.log-HTTP HEADERS:
mediawiki-wiki-debug.log-ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
mediawiki-wiki-debug.log-USER-AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.0.0 Safari/538.1
mediawiki-wiki-debug.log:X-CS: TESTON
mediawiki-wiki-debug.log-CONNECTION: Keep-Alive
mediawiki-wiki-debug.log-ACCEPT-ENCODING: gzip, deflate
mediawiki-wiki-debug.log-ACCEPT-LANGUAGE: en-US,*
mediawiki-wiki-debug.log-HOST: 127.0.0.1:8080
mediawiki-wiki-debug.log-[redis] Creating a new RedisConnectionPool instance with id d70d28fd70891a6f32c19060fdf71767aaa0c97e.
--
mediawiki-wiki-debug.log-[ContentHandler] Created handler for css: CssContentHandler
mediawiki-wiki-debug.log-Start request GET /wiki/Main_Page
mediawiki-wiki-debug.log-HTTP HEADERS:
mediawiki-wiki-debug.log-ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
mediawiki-wiki-debug.log-USER-AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.0.0 Safari/538.1
mediawiki-wiki-debug.log:X-CS: -TEST-ALL
mediawiki-wiki-debug.log-CONNECTION: Keep-Alive
mediawiki-wiki-debug.log-ACCEPT-ENCODING: gzip, deflate
mediawiki-wiki-debug.log-ACCEPT-LANGUAGE: en-US,*
mediawiki-wiki-debug.log-HOST: 127.0.0.1:8080
mediawiki-wiki-debug.log-[redis] Creating a new RedisConnectionPool instance with id d70d28fd70891a6f32c19060fdf71767aaa0c97e.
--
mediawiki-wiki-debug.log-[ContentHandler] Created handler for css: CssContentHandler
mediawiki-wiki-debug.log-Start request GET /wiki/Main_Page
mediawiki-wiki-debug.log-HTTP HEADERS:
mediawiki-wiki-debug.log-ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
mediawiki-wiki-debug.log-USER-AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.0.0 Safari/538.1
mediawiki-wiki-debug.log:X-CS: -TEST-ALL
mediawiki-wiki-debug.log-CONNECTION: Keep-Alive
mediawiki-wiki-debug.log-ACCEPT-ENCODING: gzip, deflate
mediawiki-wiki-debug.log-ACCEPT-LANGUAGE: en-US,*
mediawiki-wiki-debug.log-HOST: 127.0.0.1:8080
mediawiki-wiki-debug.log-[redis] Creating a new RedisConnectionPool instance with id d70d28fd70891a6f32c19060fdf71767aaa0c97e.
--
mediawiki-wiki-debug.log-[ContentHandler] Created handler for css: CssContentHandler
mediawiki-wiki-debug.log-Start request GET /wiki/Main_Page
mediawiki-wiki-debug.log-HTTP HEADERS:
mediawiki-wiki-debug.log-ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
mediawiki-wiki-debug.log-USER-AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.0.0 Safari/538.1
mediawiki-wiki-debug.log:X-CS: 250-99
mediawiki-wiki-debug.log-CONNECTION: Keep-Alive
mediawiki-wiki-debug.log-ACCEPT-ENCODING: gzip, deflate
mediawiki-wiki-debug.log-ACCEPT-LANGUAGE: en-US,*
mediawiki-wiki-debug.log-HOST: 127.0.0.1:8080
mediawiki-wiki-debug.log-[redis] Creating a new RedisConnectionPool instance with id d70d28fd70891a6f32c19060fdf71767aaa0c97e.

I do not know why mediawiki does not return zero banners when the header is sent. Anybody has an idea what is wrong? If nobody cares about this job, I vote for deleting it. Is broken since forever. :(

Looks like Selenium does not support adding custom headers, but some browser drivers support it, like phantomjs. Another alternative is to use a proxy like browsermob:

https://github.com/lightbody/browsermob-proxy/
https://github.com/jarib/browsermob-proxy-rb
https://github.com/AutomatedTester/browsermob-proxy-py

There is no longer anyone actively developing for Zero (as a main priority)
and this looks like a trip down the same custom header rabbit hole I ran
into a few months ago. I vote for deleting the job as well.

Looks like Selenium does not support adding custom headers, but some browser drivers support it, like phantomjs. Another alternative is to use a proxy like browsermob:

https://github.com/lightbody/browsermob-proxy/
https://github.com/jarib/browsermob-proxy-rb
https://github.com/AutomatedTester/browsermob-proxy-py

That is unfortunate. Now I understand why PhantomJS has been chosen originally. Thank you for the investigation!

I could not find a way to set custom headers for Chrome. I will take a look if it possible for Firefox tomorrow.

There is no longer anyone actively developing for Zero (as a main priority)
and this looks like a trip down the same custom header rabbit hole I ran
into a few months ago. I vote for deleting the job as well.

I guess that is what we will end up doing! Thanks!

jhobs added a comment.EditedSep 23 2015, 8:48 PM

I don't recall it being possible in Firefox either when originally working
on these tests (as I'm sure I would've greatly favored that over
PhantomJS), but I could be mistaken.

On further investigation, these tests wouldn't pass even if we did use PhantomJS (they're simply designed incorrectly). Definitely feel free to boot them.

Change 239913 had a related patch set uploaded (by Zfilipin):
Switch ZeroBanner browsertests to Chrome

https://gerrit.wikimedia.org/r/239913

Change 239912 abandoned by Zfilipin:
Browsertests: switch from PhantomJS to Chrome

Reason:
https://phabricator.wikimedia.org/T113463

https://gerrit.wikimedia.org/r/239912

Change 239913 abandoned by Zfilipin:
Switch ZeroBanner browsertests to Chrome

Reason:
https://phabricator.wikimedia.org/T113463

https://gerrit.wikimedia.org/r/239913

Change 240648 had a related patch set uploaded (by Zfilipin):
Delete broken ZeroBanner browser tests

https://gerrit.wikimedia.org/r/240648

zeljkofilipin renamed this task from Fix or delete ZeroBanner browsertests Jenkins job to Delete broken ZeroBanner browsertests Jenkins job.Sep 24 2015, 8:53 AM

Change 240650 had a related patch set uploaded (by Zfilipin):
Delete broken browser tests

https://gerrit.wikimedia.org/r/240650

Change 240648 merged by jenkins-bot:
Delete broken ZeroBanner browser tests

https://gerrit.wikimedia.org/r/240648

hashar closed this task as Resolved.Sep 24 2015, 10:49 AM

Cleaned up! Thank you @jhobs, that is one less trouble for us :}

Change 240650 merged by jenkins-bot:
Delete broken browser tests

https://gerrit.wikimedia.org/r/240650