deprecation warnings and the test suite
John A Meinel
john at arbash-meinel.com
Tue Feb 21 15:48:49 GMT 2006
Andrew Bennetts wrote:
> On Tue, Feb 21, 2006 at 08:13:25AM -0500, Aaron Bentley wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Robert Collins wrote:
>> | I think that we should not merge code that leaves deprecation warnings
>> | being triggered by the test suite - right now todays merges have
>> | introduced a handful of such warnings.
>>
>> Ideally yes, but it's hard to notice new deprecation warning when there
>> are so many already being produced by the test suite.
>
> One way to notice them is to make the test suite fail if there are new
> deprecation warnings. A way to make that happen would be to teach the test
> runner to count warnings that occur while running the tests, then check a file
> in the tree, say "ratchets.txt", to see if they exceed a threshold.
>
> The file could look like:
>
> DeprecationWarning: 42
> FooWarning: 88
>
> You could even have lines like:
>
> Modules with no docstring: 99
>
> (with an accompanying test that imports all the modules in bzrlib, and counts
> those without __doc__, and tests that it doesn't exceed the value from
> ratchets.txt).
>
> When someone fixes some deprecations, they can also ratchet the tolerance of
> deprecation warnings down by adjusting ratchets.txt...
>
> Eventually, when the value hits zero, you just change the test to
> unconditionally fail if the value exceeds zero, and delete the line from
> ratchets.txt :)
>
> [This is an idea I've been meaning to implement elsewhere, but haven't yet
> gotten around to]
>
> -Andrew.
That is a possibility. I think what we really need is just a code
cleanup to remove all of the deprecated code paths. I think most of them
actually occur in the TestSuite (it isn't the bzrlib code that is out of
date, just the tests for the code).
We've done this elsewhere. See test_source.py, which checks that Branch
doesn't call WorkingTree, etc.
I'm not sure that it is worth taking the time to write that test. Rather
than taking the time to actually clean up the deprecated code.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060221/71def3a2/attachment.pgp
More information about the bazaar
mailing list