Page MenuHomePhabricator

Unbreak RecordLintJobTest
Closed, ResolvedPublic0 Estimated Story Points

Description

There was 1 failure:

1) MediaWiki\Linter\Test\RecordLintJobTest::testRun
Failed asserting that actual size 0 matches expected size 1.

/srv/mediawiki/core/extensions/Linter/tests/phpunit/RecordLintJobTest.php:60
/srv/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:426
/srv/mediawiki/core/maintenance/doMaintenance.php:96

I bisected this to:

commit fc5d51f12936edb4c7d067e298b5ec3a7c09a8fa
Author: Aaron Schulz <[email protected]>
Date:   Fri Mar 29 23:07:48 2019 -0700

    jobqueue: add GenericParameterJob and RunnableJob interface
    
    Simplify the code of jobs that do not care about titles and removes
    the direct Title dependency from JobQueue. Remove getTitle() from
    IJobSpecification itself. Move all the Job::factory calls into a
    single JobQueue::factoryJob() method.
    
    Depends-on: Iee78f4baeca0c0b4d6db073f2fbcc56855114ab0
    Change-Id: I9c9d0726d4066bb0aa937665847ad6042ade13ec

:100644 100644 b22aeab527585bf1cbf6ac18b8615913edb9c0e8 0ce423f9cf051da5ecff75c727854becd494a6ab M	autoload.php
:040000 040000 271b0207e62b6c453250a1ff8d5bf01f90efdabe f33da32c9e511dc316e1d8065f8f9f19c23d40b4 M	includes
:040000 040000 de7a2da295f28b78529170bffafe5dc7abe574f7 99b481d65e0fd5942314f2fea2c2e3b2a26478eb M	tests

Event Timeline

Legoktm triaged this task as High priority.Jun 8 2019, 1:49 AM
Legoktm created this task.

Change 515311 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/extensions/Linter@master] Properly set $this->title in RecordLintJob

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

Sbailey subscribed.

I believe I have a fix for this and want this fix done prior to adding additional tests to RecordListJobTest.php
The issue appears to be that RecordLintJob.php run() checks the revision and then delays the job run which in a production environment is a good idea, but not for this test, so I removed the revision property. I also set the pageID to 0 instead of 1 as that seems to be a new default allowing the test to find the inserted lint error appropriately.

See:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Linter/+/699453

Change 699453 had a related patch set uploaded (by Sbailey; author: Sbailey):

[mediawiki/extensions/Linter@master] Fix broken RecordLintJobTest

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

Change 699453 merged by jenkins-bot:

[mediawiki/extensions/Linter@master] Fix broken RecordLintJobTest

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

Change 515311 abandoned by Sbailey:

[mediawiki/extensions/Linter@master] Properly set $this->title in RecordLintJob

Reason:

Issue resolved by T225337

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