Re: [Wikitech-l] Dropping PHPUnit 4 support

2019-10-07 Thread Brad Jorsch (Anomie)
On Sun, Oct 6, 2019 at 4:35 AM Daimona  wrote:

> And in turn, this happens because MediaWikiUnitTestCase validates the
> directory structure, but some repos do not comply.


That is not the only reason a test might use PHPUnit\Framework\TestCase.
Another is that libraries (and proto-libraries in core's includes/libs/
directory) intended for use independent of MediaWiki can't use a
MediaWiki-specific test case base class.

-- 
Brad Jorsch (Anomie)
Senior Software Engineer
Wikimedia Foundation
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Dropping PHPUnit 4 support

2019-10-06 Thread Daimona
Thanks, Amir! That's a great idea. My regexps were a bit naive and there's
still some space for improvement, so I'll comment about that on the gist.

As for removing the PHPUnit4And6Compat trait: I think we should do that
regardless of this migration. In fact, I'd like to draw some attention
to T234721. Basically, any test using the trait directly does so because it
extends PHPUnit\Framework\TestCase. And in turn, this happens because
MediaWikiUnitTestCase validates the directory structure, but some repos do
not comply. Hence, we should implement a way to use MediaWikiUnitTestCase
even with non-standard directories (3 proposals on phab). Then we could
migrate everything with another script. This will also make it easier to
transition to PHPUnit 8, if we want to add another backward/forward-compat
layer.


Il giorno sab 5 ott 2019 alle ore 23:58 Amir Sarabadani 
ha scritto:

> Thanks Daimona!
> In the spirit of automating everything including ourselves, I wrote a quick
> python script using Daimon's regexes to run on codebases and it tries to
> clean as much as possible for you.
> https://gist.github.com/Ladsgroup/bfb4f4b66384efb8b8d3efea338b6e6b
> (After running this, you should run composer fix to fix phpcs issues)
>
> Feel free to change the gist and put it in comment, so I fix it.
>
> On Fri, Oct 4, 2019 at 1:58 PM Daimona  wrote:
>
> > Hello all,
> > Following our migration away from HHVM, we're now also requiring PHPUnit
> 6+
> > [0]. Previously, we were allowing PHPUnit 4 as an option, but that
> version
> > was EOLed in February 2017 [1].
> >
> > MediaWiki core provides a backward/forward-compatible layer [2] to allow
> > working with both versions. However, that trait will be emptied and
> removed
> > soon, partly because we want to move to PHPUnit 8.
> >
> > Hence, if you have a local install of PHPUnit 4, you won't be able to use
> > it anymore. I also invite you to check whether any of your repos has an
> > explicit PHPUnit dependency in composer.json [3]. If it does, you can now
> > remove PHPUnit 4 from it.
> >
> > Thank you for your collaboration!
> >
> > [0] - https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/426058/
> > [1] - https://phpunit.de/supported-versions.html
> > [2] -
> >
> >
> https://gerrit.wikimedia.org/g/mediawiki/core/+/e26299b1d14feb341ff5752696f8a24045df9838/tests/phpunit/PHPUnit4And6Compat.php
> > [3] - List of repos that do have it:
> >
> >
> https://codesearch.wmflabs.org/search/?q=%22phpunit%5C%2Fphpunit%22%3A=nope=%5Ecomposer%5C.json%24=
> >
> > --
> > https://meta.wikimedia.org/wiki/User:Daimona_Eaytoy
> > "Daimona" is not my real name -- he/him
> > ___
> > Wikitech-l mailing list
> > Wikitech-l@lists.wikimedia.org
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>
>
> --
> Amir (he/him)
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l



-- 
https://meta.wikimedia.org/wiki/User:Daimona_Eaytoy
"Daimona" is not my real name -- he/him
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Dropping PHPUnit 4 support

2019-10-05 Thread Amir Sarabadani
Thanks Daimona!
In the spirit of automating everything including ourselves, I wrote a quick
python script using Daimon's regexes to run on codebases and it tries to
clean as much as possible for you.
https://gist.github.com/Ladsgroup/bfb4f4b66384efb8b8d3efea338b6e6b
(After running this, you should run composer fix to fix phpcs issues)

Feel free to change the gist and put it in comment, so I fix it.

On Fri, Oct 4, 2019 at 1:58 PM Daimona  wrote:

> Hello all,
> Following our migration away from HHVM, we're now also requiring PHPUnit 6+
> [0]. Previously, we were allowing PHPUnit 4 as an option, but that version
> was EOLed in February 2017 [1].
>
> MediaWiki core provides a backward/forward-compatible layer [2] to allow
> working with both versions. However, that trait will be emptied and removed
> soon, partly because we want to move to PHPUnit 8.
>
> Hence, if you have a local install of PHPUnit 4, you won't be able to use
> it anymore. I also invite you to check whether any of your repos has an
> explicit PHPUnit dependency in composer.json [3]. If it does, you can now
> remove PHPUnit 4 from it.
>
> Thank you for your collaboration!
>
> [0] - https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/426058/
> [1] - https://phpunit.de/supported-versions.html
> [2] -
>
> https://gerrit.wikimedia.org/g/mediawiki/core/+/e26299b1d14feb341ff5752696f8a24045df9838/tests/phpunit/PHPUnit4And6Compat.php
> [3] - List of repos that do have it:
>
> https://codesearch.wmflabs.org/search/?q=%22phpunit%5C%2Fphpunit%22%3A=nope=%5Ecomposer%5C.json%24=
>
> --
> https://meta.wikimedia.org/wiki/User:Daimona_Eaytoy
> "Daimona" is not my real name -- he/him
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l



-- 
Amir (he/him)
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l