[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Tests in libconfig-model-dpkg-perl



Hi Dominique,

On 28/08/17 17:05, Dominique Dumont wrote:

>> While doing this, I added some tests, and actually verified they failed
>> before modifing the code. Surprisingly, I found that some of them did not!
>>
>> foreach my $target (qw(dkms elpa go nodejs perl python r ruby)) {
>>     warning_is {
>>         $root->load("control source Testsuite=autopkgtest-pkg-$target");
>>     } undef, "check that Testsuite is accepted for autopkgtest-pkg-$target";
>> }
> 
> At this point in the test, Maintainer is set to foo\@bar.com. In this case, 
> any valid value of autopkgtest-pkg-* is accepted as you found out.

Yes, my issue here is not about matching with Maintainer, but verifying
the value of Testsuite. The test as written above was passing for some
values even before I modified Source.pl. It even accepted
autopkgtest-pkg-foo. All seemed to depend on ordering. I only got
consistent and correct verification when I added the two extra lines
(apply_changes and grab_value) in this foreach loop.

> I now wonder now if the last test makes sense: for instance, can maintainer 
> joe@stuff.com set this value to autopkgtest-pkg-perl ?

Like Gregor said, I think this is valid.

> The "fix" code is the same for the 3 tests.
> 
> You have correctly modified the "warn_unless_match" test, but the "warn_unless" 
> (without match) tests and the fixes do not take into account the teams you want 
> to add. I.e. the regexp must be updated with (dkms|elpa|go|nodejs|perl|python|
> r|ruby) as you did for "warn_unless_match";

I did not do it because I don't know if these teams have a policy of
using autopkgtest.

> I hope I explained what's going on. Once all the regexpes are consistent, the 
> tests should behave in a more, err, predicatable way.
> 
> I let you decide whether you want to finish this enhancement, or you want me to 
> take over.
> 
> Since the bus factor on cme is quite bad, I'd rather you choose the first 
> option... ;-) Be sure that I'll help you get there.

I would love to help, but I don't know config-model well enough to
understand what is going on in these tests..


-- 
Martín Ferrari (Tincho)


Reply to: