Page MenuHomePhabricator

Install Tidy on gallium
Closed, ResolvedPublic

Description

This would be closer to WMF environment.


Version: unspecified
Severity: normal

Details

Reference
bz40029

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:06 AM
bzimport set Reference to bz40029.

reedy@gallium:~$ dpkg -l | grep tidy
ii libjtidy-java 7+svn20070309-4 a Java port of HTML Tidy, a HTML syntax chec
ii libtidy-0.99-0 20091223cvs-1 HTML syntax checker and reformatter - librar
ii php5-tidy 5.3.2-1ubuntu4.17 tidy module for php5

https://gerrit.wikimedia.org/r/gitweb?p=integration/jenkins.git;a=blob;f=jobs/_shared/ExtraSettings.php;hb=HEAD *

Well, there is something to be said about both.

There is bugs with Tidy, there is bugs without Tidy.
Ideally we'd test with both.

Is that all about the parser tests?

We could parse all our test cases with and without tidy and compare with the ' result' section. When we expect different output the single ' result' section should be replaced by two new result section (such as 'result_tidy' and 'result_notidy'.

Do we have any tests that fail with tidy?

Simplifying bug summary to just be a task for ops to install Tidy in gallium.

Once it is available we can decide whether to run the parser tests twice entirely or to implement something in MediaWiki core parser test syntax to support running specific assertions (where it matters) twice (once with and once without Tidy) with result_tidy and result_notidy.

I think it is better to do this in MediaWiki itself. Running all parser tests twice doesn't make sense. Especially because the expected output is fixed in the parser tests cases, so for the tests that it matters it will just fail in a useless way.

lcarr wrote:

as per Reedy's comment above... don't we already have tidy ?

yep, we do. but the difference since Reedy posted is that it is a "+wmf1" package now.

was: 5.3.2-1ubuntu4.17
is: 5.3.10-1ubuntu3.5+wmf1

(you meant php5-tidy right?)

root@gallium:~# dpkg -l | grep tidy
ii libjtidy-java 7+svn20110807-3 JTidy
ii libtidy-0.99-0 20091223cvs-1ubuntu2 HTML syntax checker and reformatter - library
ii php5-tidy 5.3.10-1ubuntu3.5+wmf1 tidy module for php5

krinkle@gallium$ which tidy
krinkle@gallium$

I don't see it as a bin, but extension_loaded( 'tidy' ); evaluates to true in PHP.

krinkle@gallium$ php maintenance/eval.php

return $wgTidyBin;

tidy

return extension_loaded( 'tidy' );

bool(true)

return MWTidy::tidy("test</b><div>a");

<p>test</p>
<div>a</div>

Marking as resolved since Tidy is now installed.

The parser tests don't use it because in MediaWiki core the NewParserTest class explicitly sets wgUseTidy=false since the expected output stored in the text files are build against Tidy=false.

Filed bug 48221 for creation of actual tests using Tidy.