[dev] PHPUnit 8 compat (was: Re: Preparing compatibility with PHPUnit 6)

Mike Gabriel mike.gabriel at das-netzwerkteam.de
Sat Sep 12 21:47:34 UTC 2020


Hi,

On  Mi 01 Jul 2020 17:30:59 CEST, Mike Gabriel wrote:

> Hi Michael,
>
> On  So 14 Jun 2020 22:34:16 CEST, Michael J Rubinsky wrote:
>
>> Quoting Mike Gabriel <mike.gabriel at das-netzwerkteam.de>:
>>
>>> Hi again,
>>>
>>> On  Sa 06 Jun 2020 23:25:17 CEST, Mike Gabriel wrote:
>>>
>>>> I am currently looking into Horde Unit Tests and they all make  
>>>> severe problem as time has passed and PHPUnit has moved on to  
>>>> version 8.5.2 in Debian unstable.
>>>>
>>>> I understand that PHPUnit is a fast moving target, but bundling  
>>>> an old PHPUnit version in Horde_Test is neither an option for  
>>>> Debian.
>>>>
>>>> There are several options at hand:
>>>>
>>>> * pick up PHPUnit test migration, but not to 6, but 8.
>>>> * bundle PHPunit 4.8 in php-horde-test in Debian as upstream does
>>>> * don't run Debian's autopkgtests on php-horde-* packages
>>>>
>>>> I guess this original idea of a script that walks over all  
>>>> packages and updates the test API would be a good idea. However,  
>>>> is keeping compatibilities with PHPUnit 4.8 really a good  
>>>> approach considering that we have moved on much further with  
>>>> PHPUnit these days?
>>>>
>>>> Currently, the php-horde* packages won't migrate to Debian  
>>>> testing, because of failing unit tests after upload. Any  
>>>> suggestions from people involved upstream?
>>>
>>> I'd be up for working on PHPUnit8 compatibility. I'd propose  
>>> bumping Horde_Test to compat to 8.x and dropping 4.8.x compat.
>>>
>>> I'd love to get some feedbacks on this.
>>
>> The issue with doing this big of a jump in our current release code  
>> is that PHPUnit 8 requires PHP 7.2, which is a BC break in our  
>> FRAMEWORK_5_2 branch.  This would have to wait for a major version  
>> upgrade when we can bump the minimum required PHP version.
>
> Ok. Fair enough then. I will start working on PHPUnit 8 patches over  
> the next few weeks, together with the Horde co-maintainer in Debian.
>
> I will ping the dev list, once we have a working scenario.

I have been working on PHPUnit patches to support PHPUnit 8.x / 9.x  
over the summer. This thing is still work in progress, but I have  
quite a few packages uploaded to Debian and they have successfully  
migrated to Debian testing. They only migrate if PHPUnit tests are  
successful during autopkgtests (which run within the next 2 days after  
an upload to Debian unstable).

With Horde_Crypt, I am facing a weird problem now:

```
phpunit -v --filter "Horde_Crypt_Pgp_BinaryTest::testGenerateKey" .  
2>&1 | less
[print $cmdline in _callGpg()] /usr/bin/gpg --emit-version --no-tty  
--no-secmem-warning --no-options --no-default-keyring --yes --homedir  
/tmp/1a9b3vdf --quiet --version 2> /dev/null
[[ repeated 18 times ]]
PHPUnit 8.5.8 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.4.9
Configuration:  
/home/mike/MyDocuments/4debian/TEAMS/pkg-horde/debian/php-horde-crypt/Horde_Crypt-2.7.12/test/Horde/Crypt/phpunit.xml

E                                                                   1  
/ 1 (100%)
[print $cmdline in _callGpg()] /usr/bin/gpg --emit-version --no-tty  
--no-secmem-warning --no-options --no-default-keyring --yes --homedir  
/tmp/mtrmdrk2 --pinentry-mode loopback --output  
/tmp/mtrmdrk2/horde-pgpnlBY4R --quiet --gen-key --batch --armor 2>  
/tmp/mtrmdrk2/horde-pgp6UWQJS

[print $input lines] %pubring /tmp/mtrmdrk2/horde-pgpcQjY9S
[print $input lines] %secring /tmp/mtrmdrk2/horde-pgp4xQCTR
[print $input lines] Key-Type: RSA
[print $input lines] Key-Length: 4096
[print $input lines] Subkey-Type: RSA
[print $input lines] Subkey-Length: 4096
[print $input lines] Name-Real: John Doe
[print $input lines] Name-Email: john at example.com
[print $input lines] Expire-Date: seconds=172800
[print $input lines] Passphrase: secret
[print $input lines] Preferences: AES256 AES192 AES CAST5 3DES SHA256  
SHA512 SHA384 SHA224 SHA1 ZLIB BZIP2 ZIP Uncompressed
[print $input lines] Name-Comment: Key Comment
[print $input lines] %commit

[print, if secret key is empty] No private key created.


Time: 6.14 seconds, Memory: 6.00 MB

There was 1 error:

1) Horde_Crypt_Pgp_BinaryTest::testGenerateKey with data set #0  
(Horde_Crypt_Pgp Object (...))
Horde_Crypt_Exception: Public/Private keypair not generated successfully.

/home/mike/MyDocuments/4debian/TEAMS/pkg-horde/debian/php-horde-crypt/Horde_Crypt-2.7.12/lib/Horde/Crypt/Pgp.php:95
/home/mike/MyDocuments/4debian/TEAMS/pkg-horde/debian/php-horde-crypt/Horde_Crypt-2.7.12/test/Horde/Crypt/Pgp/TestBase.php:475

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.
```

When I run the above --gen-key command line in batch mode from the  
command line on Debian stable (aka buster) and Debian unstable  
(bullseye release cycle), I get the same result: I see the file with  
the pubkey ( /tmp/mtrmdrk2/horde-pgpcQjY9S ) and it contains a pubkey.  
But the secret key file ( /tmp/mtrmdrk2/horde-pgp4xQCTR ) does not  
even get created.

The --output file ( /tmp/mtrmdrk2/horde-pgpnlBY4R ) is empty and the  
stderr file ( /tmp/mtrmdrk2/horde-pgp6UWQJS ) does not even get created.

The patches I use for the tests to be runnable under PHPUnit 8.5.8 (as  
in Debian unstable these days) are attached to this mail. (patch 1010  
is the one that is needed for PHPUnit 8.5.8. The 1001 patch (raising  
bytesize of the keys to 4096) was a test to see if GPG refuse  
1024byte-sized keys and would be a much better default nowadays. But  
it did not solve the problem, unfortunately.

Does anyone have a clue, how this can be resolved or better debugged???

Thanks+Greets,
Mike
-- 

DAS-NETZWERKTEAM
c\o Technik- und Ökologiezentrum Eckernförde
Mike Gabriel, Marienthaler Str. 17, 24340 Eckernförde
mobile: +49 (1520) 1976 148
landline: +49 (4351) 850 8940

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
mail: mike.gabriel at das-netzwerkteam.de, http://das-netzwerkteam.de

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 1010_phpunit-8.x+9.x.patch
URL: <https://lists.horde.org/archives/dev/attachments/20200912/8f6e5e0d/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 1001_strong-pgp-keys-by-default.patch
URL: <https://lists.horde.org/archives/dev/attachments/20200912/8f6e5e0d/attachment-0001.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: Digitale PGP-Signatur
URL: <https://lists.horde.org/archives/dev/attachments/20200912/8f6e5e0d/attachment.sig>


More information about the dev mailing list