#1100492 php-doctrine-persistence build runs tests against wrong version

#1100492#5
Date:
2025-03-14 12:57:52 UTC
From:
To:
During a rebuild of packages in Testing, we ran into a test failure in
php-doctrine-persistence.
Analyzing the logs, we found that the build dependency on
php-doctrine-common pulls in the php-doctrine-persistence package from
the apt repository.

The below analysis shows that tests are running not against the newest
version (the one just built but against the system installation of the
indirect build dependency on itself).

Kind regards,
Sven

Analysis:

Since our version of trixie is based completely on rebuilds from
testing, we saw a build failure of 4.0.0-5 and retried with 4.0.0-6.
But this ultimately still meant that we got the sources from 4.0.0-6
to install php-doctrine-persistence 3.4.0-2 from an older state of
testing as an indirect build dependency.

That led to this test error:

There were 4 errors:

1) Doctrine\Tests\Persistence\ObjectManagerDecoratorTest::testIsUninitializedObject
PHPUnit\Framework\MockObject\MethodCannotBeConfiguredException: Trying
to configure method "isUninitializedObject" which cannot be configured
because it does not exist, has not been specified, is final, or is
static

/build/reproducible-path/php-doctrine-persistence-4.0.0/tests/Persistence/ObjectManagerDecoratorTest.php:162

2) Doctrine\Tests\Persistence\Reflection\EnumReflectionPropertyTest::testGetModifiers
Error: Internal error: Failed to retrieve the reflection object

/build/reproducible-path/php-doctrine-persistence-4.0.0/tests/Persistence/Reflection/Reflection/EnumReflectionPropertyTest.php:122

3) Doctrine\Tests\Persistence\Reflection\EnumReflectionPropertyTest::testGetDocComment
Error: Internal error: Failed to retrieve the reflection object

/build/reproducible-path/php-doctrine-persistence-4.0.0/tests/Persistence/Reflection/Reflection/EnumReflectionPropertyTest.php:128

4) Doctrine\Tests\Persistence\Reflection\EnumReflectionPropertyTest::testIsPrivate
Error: Internal error: Failed to retrieve the reflection object

/build/reproducible-path/php-doctrine-persistence-4.0.0/tests/Persistence/Reflection/Reflection/EnumReflectionPropertyTest.php:136

IsUnitializedObject is present in 4.0.0 but didn't exist in the 3.4
version previously in testing. Which shows that the tests run against
the installed package, not the package that is currently being built
and should be tested.

#1100492#12
Date:
2025-03-15 13:42:34 UTC
From:
To:
Hi Sven,

Thank you for your report.
[…]
I’m well aware of this annoying behavior, that currently forces me to
upload a locally built binary package followed by a source only upload
(spoiler alert, this is not the only package affected). Basically, all
the phpunit dependency chain is likely affected.

Currently, the dependency classes are loaded by using their full path to
avoid a CVE-2024-24821 like exposure, so it is not possible to load the
new classes (since the system ones have already been loaded). I don’t
think it’s possible to overwrite this behavior, so we’re kind of stuck here.

It would be nice to be allowed to upload staged build packages to the
archive, building it first without tests (DEB_BUILD_OPTIONS=nocheck),
and then building the package again with the previously built one
installed, but that doesn’t seem like something we’ll be able to do, at
least on a short-time scale.

One option could be to totally ignore the testsuite at build time and
simply rely on the autopkgtest to spot regressions, but we’ll miss the
input from the “rebuild all the archive” efforts, and also the obvious
homemade build. On the other hand, it would make my (and probably your)
life a lot easier…

I’m not tagging this bug as wontfix (because it’s a pain I’d very much
like to get fixed), but I don’t know the best way forward. Hopefully,
other team members may shim in and even point at a silver bullet that I
missed.

Regards,

taffit,