Page MenuHomePhabricator

AbuseFilter needs regression tests
Closed, ResolvedPublic

Details

Reference
bz40478

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:08 AM
bzimport added a project: AbuseFilter.
bzimport set Reference to bz40478.
bzimport added a subscriber: Unknown Object (MLST).
scfc created this task.Sep 24 2012, 2:53 PM
He7d3r added a comment.EditedAug 16 2013, 1:04 PM

Would this kind of test help us prevent unwanted side effects of changes such as T52107?

He7d3r added a comment.EditedAug 17 2013, 12:13 AM

(In reply to comment #1)

Would this kind of test help us prevent unwanted side effects of changes such
as T52107?

and T54053...

He7d3r updated the task description. (Show Details)May 23 2015, 6:50 PM
He7d3r added a project: MediaWiki-Core-Testing.
He7d3r set Security to None.
He7d3r updated the task description. (Show Details)
Krinkle updated the task description. (Show Details)
Krinkle removed a subscriber: wikibugs-l-list.
Huji added a subscriber: Huji.Jan 13 2017, 1:46 AM
Daimona added a subscriber: Daimona.
matej_suchanek raised the priority of this task from Low to High.Apr 6 2018, 9:36 AM
matej_suchanek added a project: Test-Coverage.

Yeah, definitely time to think about this. I'm not familiar with phpunit but I'd love to give some help.

I think this needs a (much needed) overhaul of the way AbuseFilter is coded. Quoting @matej_suchanek from an email, the plan could be to split it to a new class (say, AbuseFilterRunner) and cover it with tests.

Change 443520 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] [WIP] Add phpunit tests for creating filters

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

Change 444191 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] [WIP] Add PHPUnit tests for various generic functions

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

This is what I'm progressively try to add as tests:

  1. Tests for all AFPUserVisibleException exceptions
  2. Tests for filter validation
  3. Tests for generic functions in AbuseFilter class
  4. Complete tests where filters are created, actions are executed and consequences must be taken.

Apart from the latter, everything is under review right now.

Change 444442 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] [WIP] Add tests for filter consequences

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

Daimona claimed this task.Jul 8 2018, 4:09 PM

I think the above patches will provide a really good test background to start with, and should accomplish the goal of this task. Then, they may be expanded progressively.

Change 444442 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Add tests for filter consequences

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

Daimona updated the task description. (Show Details)Jul 18 2018, 7:15 AM

Change 443520 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Add phpunit tests for creating and editing filters

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

Huji updated the task description. (Show Details)Jul 24 2018, 4:04 PM
Daimona updated the task description. (Show Details)Aug 2 2018, 10:04 AM

Change 444191 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Add PHPUnit tests for various generic functions

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

Daimona closed this task as Resolved.Aug 9 2018, 9:08 PM
Daimona removed a project: Patch-For-Review.
Daimona updated the task description. (Show Details)

Now we have the base. The parent task is here to track further improvements.