Page MenuHomePhabricator

ResourcesTest::testStyleMedia with data set #30 ('skins.bluesky', 'screen', 'skins/BlueSky/resources/css/nonarticle.css', stdClass): Stylesheets should not both specify "media" and contain @media
Closed, ResolvedPublic

Description

b@ubuntu15:/var/www/wiki/tests/phpunit$ php phpunit.php structure/ResourcesTest.php
PHPUnit already present
PHPUnit 3.7.37 by Sebastian Bergmann.

Configuration read from /var/www/html/w/tests/phpunit/suite.xml

.............................................................   61 / 1877 (  3%)
.............................................................  122 / 1877 (  6%)
.............................................................  183 / 1877 (  9%)
.............................................................  244 / 1877 ( 12%)
.............................................................  305 / 1877 ( 16%)
.............................................................  366 / 1877 ( 19%)
.............................................................  427 / 1877 ( 22%)
.............................................................  488 / 1877 ( 25%)
.............................................................  549 / 1877 ( 29%)
.............................................................  610 / 1877 ( 32%)
.............................................................  671 / 1877 ( 35%)
.............................................................  732 / 1877 ( 38%)
.............................................................  793 / 1877 ( 42%)
.............................................................  854 / 1877 ( 45%)
.............................................................  915 / 1877 ( 48%)
.............................................................  976 / 1877 ( 51%)
............................................................. 1037 / 1877 ( 55%)
............................................................. 1098 / 1877 ( 58%)
............................................................. 1159 / 1877 ( 61%)
............................................................. 1220 / 1877 ( 64%)
............................................................. 1281 / 1877 ( 68%)
............................................................. 1342 / 1877 ( 71%)
............................................................. 1403 / 1877 ( 74%)
............................................................. 1464 / 1877 ( 77%)
............................................................. 1525 / 1877 ( 81%)
............................................................. 1586 / 1877 ( 84%)
............................................................. 1647 / 1877 ( 87%)
............................................................. 1708 / 1877 ( 90%)
............................................................. 1769 / 1877 ( 94%)
............................................................. 1830 / 1877 ( 97%)
..............................F................

Time: 8.27 seconds, Memory: 45.50Mb

There was 1 failure:

1) ResourcesTest::testStyleMedia with data set #30 ('skins.bluesky', 'screen', 'skins/BlueSky/resources/css/nonarticle.c
ss', stdClass)
Stylesheets should not both specify "media" and contain @media
Failed asserting that false is true.

/var/www/html/w/tests/phpunit/structure/ResourcesTest.php:36
/var/www/html/w/tests/phpunit/MediaWikiTestCase.php:131

FAILURES!
Tests: 1877, Assertions: 6009, Failures: 1.

Event Timeline

matmarex created this task.Sep 3 2015, 8:34 PM
matmarex assigned this task to ashley.
matmarex raised the priority of this task from to Needs Triage.
matmarex updated the task description. (Show Details)
matmarex added a project: BlueSky.
matmarex added a subscriber: matmarex.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 3 2015, 8:34 PM
ashley triaged this task as Low priority.Sep 3 2015, 10:13 PM

That is one silly test. In the past, this behavior has been acceptable and supported -- by specifying @media screen (in the ResourceLoader module definition in skin.json) and then applying more specific @media rules inside a file. I don't see an acceptable reason to break this.

In any case:

  1. The only @media rule in BlueSky's nonarticle.css is an IE8-specific hack (related to the PostComment extension, which essentially isn't available outside wikiHow),
  2. And while this would be "easy" enough to fix (for example, by removing the PostComment styles from nonarticle.css), I'm going to leave this task open for the time being because nonarticle.css is quite ugly and should be split into multiple separate RL modules and some styles need to be outright removed.

It's not a silly test. What you're doing doesn't work on at least IE 9 and older and is not valid CSS3 (although it might be allowed by some experimental specs and works in some browsers).

Paladox added a subscriber: Paladox.Oct 3 2015, 4:37 PM

This happends in metrolook skin if it runs the extension-unittests.

I specified the @media screem for the mobile file.

Does that make it invalid too since it also showed this error in the test.

What should I do to fix the problem on metrolook since this is similar.

There's one more failure now:

1) ResourcesTest::testFileExistence with data set #1151 ('/var/www/html/w/skins/BlueSky/resources/css//extensions/wikiho
w/thumbsup/thumbs.png', 'skins.bluesky', '/var/www/html/w/skins/BlueSky/resources/css//extensions/wikihow/thumbsup/thumb
s.png')
File '/var/www/html/w/skins/BlueSky/resources/css//extensions/wikihow/thumbsup/thumbs.png' referenced by 'skins.bluesky'
 must exist.
Failed asserting that file "/var/www/html/w/skins/BlueSky/resources/css//extensions/wikihow/thumbsup/thumbs.png" exists.

Also this error

12:11:20 Time: 3.8 seconds, Memory: 23.52Mb
12:11:20
12:11:20 There were 2 failures:
12:11:20
12:11:20 1) Warning
12:11:20 The data provider specified for ResourcesTest::testFileExistence is invalid.
12:11:20 ResourceLoaderFileModule::readStyleFile: style file not found: "/mnt/jenkins-workspace/workspace/mwext-testextension-hhvm/src/skins/BlueSkyresources/src/mediawiki.skinning/interface.css"
12:11:20
12:11:20
12:11:20 2) Warning
12:11:20 The data provider specified for ResourcesTest::testStyleMedia is invalid.
12:11:20 ResourceLoaderFileModule::readStyleFile: style file not found: "/mnt/jenkins-workspace/workspace/mwext-testextension-hhvm/src/skins/BlueSky
resources/src/mediawiki.skinning/interface.css"

Change 251805 had a related patch set uploaded (by Paladox):
Remove css code related to wikihow extension

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

Change 243719 had a related patch set uploaded (by Paladox):
Split module mediawiki.skinning.interface into two different modules

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

Change 291925 had a related patch set uploaded (by Paladox):
Disable testStyleMedia test for skins only

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

Change 291925 abandoned by Paladox:
Disable testStyleMedia test for skins only

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

SamanthaNguyen moved this task from Feedback & Suggestions to Bugs on the BlueSky board.

Change 251805 abandoned by Paladox:
Remove css code related to wikihow extension

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

This should now be moot, as the entire skin has been redone. Can anyone verify?

Yep, haven't seen this in a while now.

matmarex closed this task as Resolved.Oct 14 2016, 12:25 PM
matmarex removed a project: Patch-For-Review.

Yup, no more failures.

b@ubuntu15:/var/www/wiki/tests/phpunit$ php phpunit.php structure/ResourcesTest.php
Using PHP 5.6.11-1ubuntu3.4
PHPUnit 4.8.24 by Sebastian Bergmann and contributors.

.............................................................   61 / 2197 (  2%)
.............................................................  122 / 2197 (  5%)
.............................................................  183 / 2197 (  8%)
.............................................................  244 / 2197 ( 11%)
.............................................................  305 / 2197 ( 13%)
.............................................................  366 / 2197 ( 16%)
.............................................................  427 / 2197 ( 19%)
.............................................................  488 / 2197 ( 22%)
.............................................................  549 / 2197 ( 24%)
.............................................................  610 / 2197 ( 27%)
.............................................................  671 / 2197 ( 30%)
.............................................................  732 / 2197 ( 33%)
.............................................................  793 / 2197 ( 36%)
.............................................................  854 / 2197 ( 38%)
.............................................................  915 / 2197 ( 41%)
.............................................................  976 / 2197 ( 44%)
............................................................. 1037 / 2197 ( 47%)
............................................................. 1098 / 2197 ( 49%)
............................................................. 1159 / 2197 ( 52%)
............................................................. 1220 / 2197 ( 55%)
............................................................. 1281 / 2197 ( 58%)
............................................................. 1342 / 2197 ( 61%)
............................................................. 1403 / 2197 ( 63%)
............................................................. 1464 / 2197 ( 66%)
............................................................. 1525 / 2197 ( 69%)
............................................................. 1586 / 2197 ( 72%)
............................................................. 1647 / 2197 ( 74%)
............................................................. 1708 / 2197 ( 77%)
............................................................. 1769 / 2197 ( 80%)
............................................................. 1830 / 2197 ( 83%)
............................................................. 1891 / 2197 ( 86%)
............................................................. 1952 / 2197 ( 88%)
............................................................. 2013 / 2197 ( 91%)
............................................................. 2074 / 2197 ( 94%)
............................................................. 2135 / 2197 ( 97%)
............................................................. 2196 / 2197 ( 99%)
.

Time: 12.85 seconds, Memory: 70.00MB

OK (2197 tests, 9446 assertions)

Just as side-notice, nested @media rules are not supported up to IE 11.

Change 243719 abandoned by Paladox:
Split module mediawiki.skinning.interface into two different modules

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