Last modified: 2014-10-19 05:50:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44906, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42906 - StructureTest::testUnitTestFileNamesEndWithTest should use a dataprovider
StructureTest::testUnitTestFileNamesEndWithTest should use a dataprovider
Status: NEW
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
Blocks: 42904
  Show dependency treegraph
 
Reported: 2012-12-10 00:26 UTC by Antoine "hashar" Musso (WMF)
Modified: 2014-10-19 05:50 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Antoine "hashar" Musso (WMF) 2012-12-10 00:26:42 UTC
StructureTest::testUnitTestFileNamesEndWithTest() should be rewritten to use a dataProvider that will give out an array of PHP files under the test directory.
Comment 1 divyanshikathuria 2014-10-08 09:39:12 UTC
Where is the related file? I would like to work on this.

Divyanshi Kathuria
Comment 2 Antoine "hashar" Musso (WMF) 2014-10-08 10:11:59 UTC
It is in mediawiki/core.git in tests/phpunit/structure/StructureTest.php


$ git grep testUnitTestFileNamesEndWithTest
tests/phpunit/structure/StructureTest.php:      public function testUnitTestFileNamesEndWithTest() {
tests/phpunit/structure/StructureTest.php:       * Filter to remove testUnitTestFileNamesEndWithTest false positives.

The tests in that files can be run using:

 php tests/phpunit/phpunit.php tests/phpunit/structure/StructureTest.php
Comment 3 divyanshikathuria 2014-10-08 17:19:31 UTC
(In reply to Antoine "hashar" Musso from comment #2)
> It is in mediawiki/core.git in tests/phpunit/structure/StructureTest.php
> 
> 
> $ git grep testUnitTestFileNamesEndWithTest
> tests/phpunit/structure/StructureTest.php:      public function
> testUnitTestFileNamesEndWithTest() {
> tests/phpunit/structure/StructureTest.php:       * Filter to remove
> testUnitTestFileNamesEndWithTest false positives.
> 
> The tests in that files can be run using:
> 
>  php tests/phpunit/phpunit.php tests/phpunit/structure/StructureTest.php

What all php files of the test directory do I need to include in the array?
Comment 4 divyanshikathuria 2014-10-12 13:16:22 UTC
(In reply to Antoine "hashar" Musso (WMF) from comment #2)
> It is in mediawiki/core.git in tests/phpunit/structure/StructureTest.php
> 
> 
> $ git grep testUnitTestFileNamesEndWithTest
> tests/phpunit/structure/StructureTest.php:      public function
> testUnitTestFileNamesEndWithTest() {
> tests/phpunit/structure/StructureTest.php:       * Filter to remove
> testUnitTestFileNamesEndWithTest false positives.
> 
> The tests in that files can be run using:
> 
>  php tests/phpunit/phpunit.php tests/phpunit/structure/StructureTest.php

I tried to make some changes. Here are the changes :
https://gist.github.com/divyanshikathuria/e5a09b50f65779f92c69

Please see if it is correct and suggest me any necessary changes.
Comment 5 dan 2014-10-13 08:32:55 UTC
divyanshi,

have you ever made any commits to the wikimedia code review site, https://gerrit.wikimedia.org? if so, it’s best to commit your changes there, making sure you add a mention of the bug in the commit message, Bug: 42906, and then ask for code review.

if you don’t have experience committing to the wikimedia code review site, you can follow the instructions here, http://www.mediawiki.org/wiki/Gerrit, to get started. you’d make your changes against the wikimedia core by first checking out the https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/core project and working from there on a branch you create.

also remember that you can run the test locally to make sure all it is running as expected; from the /core directory, you’d run:
php tests/phpunit/phpunit.php tests/phpunit/structure/StructureTest.php
Comment 6 Andre Klapper 2014-10-13 12:16:42 UTC
https://www.mediawiki.org/wiki/How_to_become_a_MediaWiki_hacker might also be helpful.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links