MediaWikiTestCase now validates @cover tags

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

MediaWikiTestCase now validates @cover tags

Kunal Mehta
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi,

MediaWikiTestCase will now verify[1] that @covers tags are sane when
running normal PHPUnit tests. Previously PHPUnit would only verify
that when it ran the twice daily coverage job, and fail if even a
single one was wrong.

This also affects extensions, even though we don't generate coverage
reports for them yet[2]!

If your tests extend the PHPUnit_Framework_TestCase class, you can
just add "use MediaWikiCoversValidator" so the trait is invoked and
will still validate @covers tags.

[1] https://gerrit.wikimedia.org/r/#/c/399775/
[2] https://phabricator.wikimedia.org/T71685

- -- Legoktm
-----BEGIN PGP SIGNATURE-----

iQJLBAEBCgA1FiEE+h6fmkHn9DUCyl1jUvyOe+23/KIFAlpGqdUXHGxlZ29rdG1A
bWVtYmVyLmZzZi5vcmcACgkQUvyOe+23/KK3+Q/9GipyKlAjx1GqI/uJQNrpAbzR
IqWa8aAU2xueeVdrzfbsHblYmdpOJvu1xFNXuUY1X1/rG8sgVn45MaYy/KEE+wZO
W3uLqMfRZHRa8crUqoK8Y4jnj+CBKXvF9HpKqXRzg18O2g0L4ayyxC9kpkTSIyRx
WQy6+Pp1o+F0yywujpCDu6KAZ6LrpHgdOE3hdnXnWQLzuFmc/9UIYfx4/yp3u1Bf
yZ0z/+OmlCBXuReqrilTliy6Ow5F8I8GNQwlPHaB+cIOHubBa2Ubu8AA6O5TY1bh
zQeen8UeZfAzBofpX3NlvJcSvUfJTaZ+e7XKs/H+9g8vcThFHhVqU2uUj48GU3sO
fLFQqla4D7kZGXt4xlU2yDCnwKxBTgCHiz2wbqKdrSTzYxVEWr9zxwm0CxmUsH7g
4tqaxRo/NhKNj7F+g+bgfkbXxmqn49aBhJGVXTYYEFPCBQHu0xef6LzCApuVvVar
gjGA2jnw/OLlVrnTZdK+S0GChxtnonripTqCKUplUmZIFyrwQ7DFbckjBeyZ+etv
4e/9h0NljMytqnXu9vBjWkCGFQ1pyvU8Pz5+IzAS3umh6DSGx04wAXzDDvn5AQCI
NJxNzfmkBfe93khRL8m4jj+FNa5hIhcLNi4cEpzNb97ILjKhSTZ7O13J0npriiSe
Pl3RL3U3gfstPEGfgPQ=
=VemP
-----END PGP SIGNATURE-----

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: MediaWikiTestCase now validates @cover tags

Chad
On Fri, Dec 29, 2017 at 12:47 PM Kunal Mehta <[hidden email]> wrote:

> MediaWikiTestCase will now verify[1] that @covers tags are sane when
> running normal PHPUnit tests. Previously PHPUnit would only verify
> that when it ran the twice daily coverage job, and fail if even a
> single one was wrong.
>
> This also affects extensions, even though we don't generate coverage
> reports for them yet[2]!
>
> If your tests extend the PHPUnit_Framework_TestCase class, you can
> just add "use MediaWikiCoversValidator" so the trait is invoked and
> will still validate @covers tags.
>
>
As a friendly reminder: if you don't need all the overhead of
MediaWikiTestCase (ie: you're writing actual unit tests that don't depend
on MediaWiki), it's encouraged to extend PHPUnit_Framework_TestCase
directly. It's wayyyyyy faster.

-Chad
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l