Page MenuHomePhabricator

How do I test my extension's maintenance scripts?
Closed, ResolvedPublic

Description

This might have an obvious answer, but I've been having trouble running the ORES extension's maintenance classes under PHPUnit. My first pass was nearly working, but it emitted output. I found a MaintenanceTest class under mediawiki-core/tests/phpunit/maintenance, which does the output filtering and so on, but isn't appropriate as a base class because it includes its own tests.

If what I'm looking for doesn't exist, I'd be happy to split the maintenance testing framework from the tests themselves, please let me know.

Details

Event Timeline

awight created this task.Jan 11 2018, 10:36 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 11 2018, 10:36 PM
Legoktm added a subscriber: Legoktm.

If what I'm looking for doesn't exist, I'd be happy to split the maintenance testing framework from the tests themselves, please let me know.

That seems reasonable to me. It would be good to have a base MaintenanceTestCase to ease the process of writing tests for maintenance scripts.

Count me in if you want help,

Change 404489 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/core@master] Minor documentation cleanup

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

Change 404490 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/core@master] [WIP] New namespace for tests/phpunit/maintenance, begin splitting out maintenance test base classes

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

Change 404512 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/core@master] New namespace MediaWiki\Tests\Maintenance

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

Change 404489 merged by jenkins-bot:
[mediawiki/core@master] Minor documentation cleanup

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

Change 404606 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/core@master] Refactor MaintenanceTest to use a base test case

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

Change 404512 merged by jenkins-bot:
[mediawiki/core@master] New namespace MediaWiki\Tests\Maintenance

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

Change 404665 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/core@master] Replace some of MaintenanceTest with dataProviders

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

Change 404490 merged by jenkins-bot:
[mediawiki/core@master] Begin splitting out maintenance test base classes

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

Change 404606 merged by jenkins-bot:
[mediawiki/core@master] Refactor MaintenanceTest to use a base test case

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

Change 404665 merged by jenkins-bot:
[mediawiki/core@master] Replace some of MaintenanceTest with dataProviders

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

awight closed this task as Resolved.Jan 30 2018, 12:54 AM
awight reopened this task as Open.Jan 30 2018, 1:38 AM

@Legoktm Thanks for the nudge, will do!

greg closed this task as Resolved.Mar 3 2018, 1:05 AM
greg added a subscriber: greg.

Per it being in the Done column for scoring team and the docs are there (can we close these as resolved faster, please? :) )

238482n375 removed awight as the assignee of this task.Jun 15 2018, 8:04 AM
238482n375 triaged this task as Lowest priority.
238482n375 moved this task from Next Up to In Code Review on the Analytics-Kanban board.
238482n375 edited subscribers, added: 238482n375; removed: Aklapper.

SG9tZVBoYWJyaWNhdG9yCk5vIG1lc3NhZ2VzLiBObyBub3RpZmljYXRpb25zLgoKICAgIFNlYXJjaAoKQ3JlYXRlIFRhc2sKTWFuaXBoZXN0ClQxOTcyODEKRml4IGZhaWxpbmcgd2VicmVxdWVzdCBob3VycyAodXBsb2FkIGFuZCB0ZXh0IDIwMTgtMDYtMTQtMTEpCk9wZW4sIE5lZWRzIFRyaWFnZVB1YmxpYwoKICAgIEVkaXQgVGFzawogICAgRWRpdCBSZWxhdGVkIFRhpbmcgdGhpcyBzaXRlLCB5b3UgYWdyZWUgdG8gdGhlIFRlcm1zIG9mIFVzZSwgUHJpdmFjeSBQb2xpY3ksIGFuZCBDb2RlIG9mIENvbmR1Y3QuILcgV2lraW1lZGlhIEZvdW5kYXRpb24gtyBQcml2YWN5IFBvbGljeSC3IENvZGUgb2YgQ29uZHVjdCC3IFRlcm1zIG9mIFVzZSC3IERpc2NsYWltZXIgtyBDQy1CWS1TQSC3IEdQTApZb3VyIGJyb3dzZXIgdGltZXpvbmUgc2V0dGluZyBkaWZmZXJzIGZyb20gdGhlIHRpbWV6b25lIHNldHRpbmcgaW4geW91ciBwcm9maWxlLCBjbGljayB0byByZWNvbmNpbGUu

Aklapper assigned this task to awight.Jun 15 2018, 12:47 PM