[Wikitech-l] Wikimedia production excellence (August 2019)

2019-10-02 Thread Krinkle
 Read on Phabricator at https://phabricator.wikimedia.org/phame/post/view/172 --- How’d we do in our strive for operational excellence in August? Read on to find out! ##  Month in numbers * 3 documented incidents. [1] * 42 new Wikimedia-prod-error reports. [2] * 31 Wikimedia-prod-error

Re: [Wikitech-l] WebTestCase

2019-10-02 Thread Jeroen De Dauw
Hey, Your best bet might be making actual web requests. You can use Selenium > from PHPUnit, ... > Is there an example of a test doing either of those? The web request case is apparently not as simple as stuffing Title::newFromText()->getCannonicalUrl() into Http::get() and I'd rather not be

[Wikitech-l] Scrum of scrums/2019-10-02

2019-10-02 Thread Željko Filipin
Hi, for HTML version go to https://www.mediawiki.org/wiki/Scrum_of_scrums/2019-10-02 Željko -- = 2019-10-02 = == Callouts == * Rel Eng: The Growth team is planning deployments for the newcomer tasks projects and we need to know November black out dates * Release Engineering: REMINDER: We're

Re: [Wikitech-l] WebTestCase

2019-10-02 Thread David Barratt
As far as I know, MediaWiki does not have a centralized router like Symfony and Drupal have. Therefore, you must call the "controller" directly from your test. Also, the "controller" will typically print the result, so you would need to capture the result with output buffering:

Re: [Wikitech-l] WebTestCase

2019-10-02 Thread Gergo Tisza
There's ApiTestCase for the action API, and an open patch [1] for providing similar functionality for the REST API. I don't think there is anything for web views, and the dispatching mechanism is fairly messy. (The entry point is MediaWiki::run() but that has teardown logic that would probably

Re: [Wikitech-l] WebTestCase

2019-10-02 Thread Jeroen De Dauw
Hey, > I think selenium is often used for that use case I'm explicitly looking for a PHPUnit based approach. Similar to what Symfony provides. Surely this is possible with MediaWiki, though perhaps not as elegantly? Cheers -- Jeroen De Dauw | www.EntropyWins.wtf |

Re: [Wikitech-l] WebTestCase

2019-10-02 Thread Brian Wolff
I think selenium is often used for that use case https://www.mediawiki.org/wiki/Selenium/Node.js/Simple -- Bawolff On Tuesday, October 1, 2019, Jeroen De Dauw wrote: > Hey, > > Does MediaWiki have something similar to Symfony's WebTestCase? ( >

Re: [Wikitech-l] WebTestCase

2019-10-02 Thread Jeroen De Dauw
Hey, I want to test against the HTML actually send to the browser. Not some random intermediate step. Example. Lets test this code: https://github.com/JeroenDeDauw/Maps/blob/ccc85caf8bfb5becb6dd0d0035c1b582a7670d00/src/MediaWiki/MapsHooks.php#L93-L100 The code adds some special HTML to missing

Re: [Wikitech-l] WebTestCase

2019-10-02 Thread Adam Wight
It depends on the test, I suppose. OutputPage has a "getHTML" method. For subclasses of SpecialPage, you can "getOutput"... Do you have draft code posted somewhere? On Wed, Oct 2, 2019 at 10:44 AM Jeroen De Dauw wrote: > Hey, > > > Sort of. Once you have the HTML, you can assert various

Re: [Wikitech-l] WebTestCase

2019-10-02 Thread Jeroen De Dauw
Hey, > Sort of. Once you have the HTML, you can assert various HTML matches and non-matches using Hamcrest extensions That's great, but how do I get the HTML in the first place? Cheers -- Jeroen De Dauw | www.EntropyWins.wtf | www.Professional.Wiki

Re: [Wikitech-l] WebTestCase

2019-10-02 Thread Adam Wight
Hi! Sort of. Once you have the HTML, you can assert various HTML matches and non-matches using Hamcrest extensions, for example: https://phabricator.wikimedia.org/diffusion/EFLI/browse/master/tests/phpunit/Html/ImportPreviewPageTest.php$113 Here's the source to the pattern matching code: