dustin10 / VichUploaderBundle

A simple Symfony bundle to ease file uploads with ORM entities and ODM documents.
MIT License
1.83k stars 519 forks source link

Build is broken #1458

Closed garak closed 2 months ago

garak commented 2 months ago

Our tests are currently broken, even if the last build succeded (with a minor problem of style). Probably some changes in Symfony broken our tests. At the bottom of this issue description I pasted the output of PHPUnit.

We need to fix the tests:

1) check the reason for the missing annotations library problem. Probably we need to convert out tests to use only attributes 2) check the problem of missing AnnotationReader service. Probably related to the first point 3) check why the test kernel is not found 4) fix the notices about the Doctrine configuration 5) fix the style errors seen in out last build (see the "Actions" tab above)

PHPUnit output, you can reproduce in by cloning this repo and running TARGET=83 make tests:

Testing 
..EE.FE.E.......E.......................SSS.SSSS...............  63 / 264 ( 23%)
................................................EEEEEE......... 126 / 264 ( 47%)
............................................................... 189 / 264 ( 71%)
............................SSSSSSSSSSSS....................EEE 252 / 264 ( 95%)
SE

Time: 00:04.561, Memory: 71.00 MB

There were 15 errors:

1) Vich\UploaderBundle\Tests\Command\MappingDebugClassCommandTest::testNotUploadableClass
Vich\UploaderBundle\Exception\MissingPackageException: Annotations support missing. Try running "composer require doctrine/annotations".

2) Vich\UploaderBundle\Tests\Command\MappingDebugClassCommandTest::testUploadableClass
Vich\UploaderBundle\Exception\MissingPackageException: Annotations support missing. Try running "composer require doctrine/annotations".

3) Vich\UploaderBundle\Tests\Command\MappingDebugCommandTest::testExistentMapping
Vich\UploaderBundle\Exception\MissingPackageException: Annotations support missing. Try running "composer require doctrine/annotations".

4) Vich\UploaderBundle\Tests\Command\MappingListClassesCommandTest::testListClasses
Vich\UploaderBundle\Exception\MissingPackageException: Annotations support missing. Try running "composer require doctrine/annotations".

5) Vich\UploaderBundle\Tests\DependencyInjection\VichUploaderExtensionTest::testMetadataAnnotation
Vich\UploaderBundle\Exception\MissingPackageException: Annotations support missing. Try running "composer require doctrine/annotations".

6) Vich\UploaderBundle\Tests\Metadata\Driver\AnnotationDriverTest::testReadUploadableAnnotation
PHPUnit\Framework\MockObject\UnknownTypeException: Class or interface "Doctrine\Common\Annotations\Reader" does not exist

7) Vich\UploaderBundle\Tests\Metadata\Driver\AnnotationDriverTest::testReadUploadableAnnotationReturnsNullWhenNonePresent
PHPUnit\Framework\MockObject\UnknownTypeException: Class or interface "Doctrine\Common\Annotations\Reader" does not exist

8) Vich\UploaderBundle\Tests\Metadata\Driver\AnnotationDriverTest::testReadTwoUploadableFields
PHPUnit\Framework\MockObject\UnknownTypeException: Class or interface "Doctrine\Common\Annotations\Reader" does not exist

/srv/vich-uploader/tests/Metadata/Driver/AnnotationDriverTest.php:102

9) Vich\UploaderBundle\Tests\Metadata\Driver\AnnotationDriverTest::testReadNoUploadableFieldsWhenNoneExist
PHPUnit\Framework\MockObject\UnknownTypeException: Class or interface "Doctrine\Common\Annotations\Reader" does not exist

/srv/vich-uploader/tests/Metadata/Driver/AnnotationDriverTest.php:159

10) Vich\UploaderBundle\Tests\Metadata\Driver\AnnotationDriverTest::testReadUploadableAnnotationInParentClass
PHPUnit\Framework\MockObject\UnknownTypeException: Class or interface "Doctrine\Common\Annotations\Reader" does not exist

/srv/vich-uploader/tests/Metadata/Driver/AnnotationDriverTest.php:176

11) Vich\UploaderBundle\Tests\Metadata\Driver\AnnotationDriverTest::testReadUploadableAnnotationReturnsNullWhenNonePresentInParentClass
PHPUnit\Framework\MockObject\UnknownTypeException: Class or interface "Doctrine\Common\Annotations\Reader" does not exist

12) Vich\UploaderBundle\Tests\VichUploaderBundleTest::testSimpleKernel
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: Service "kernel" not found: the container inside "Symfony\Component\DependencyInjection\Argument\ServiceLocator" is a smaller service locator that is empty...

13) Vich\UploaderBundle\Tests\VichUploaderBundleTest::testFilesystemKernel
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: Service "kernel" not found: the container inside "Symfony\Component\DependencyInjection\Argument\ServiceLocator" is a smaller service locator that is empty...

14) Vich\UploaderBundle\Tests\VichUploaderBundleTest::testFlysystemOfficialKernel
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: Service "kernel" not found: the container inside "Symfony\Component\DependencyInjection\Argument\ServiceLocator" is a smaller service locator that is empty...

15) Vich\UploaderBundle\Tests\VichUploaderBundleTest::testReplacingFileIsCorrectlyUploaded
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: Service "kernel" not found: the container inside "Symfony\Component\DependencyInjection\Argument\ServiceLocator" is a smaller service locator that is empty...

--

There was 1 failure:

1) Vich\UploaderBundle\Tests\Command\MappingDebugCommandTest::testNotExistentMapping
Failed asserting that exception of type "Vich\UploaderBundle\Exception\MissingPackageException" matches expected exception "Vich\UploaderBundle\Exception\MappingNotFoundException". Message was: "Annotations support missing. Try running "composer require doctrine/annotations"." at
/srv/vich-uploader/src/DependencyInjection/VichUploaderExtension.php:145

ERRORS!
Tests: 264, Assertions: 534, Errors: 15, Failures: 1, Skipped: 20.

Remaining indirect deprecation notices (10)

  5x: Since doctrine/doctrine-bundle 2.12: The default value of "doctrine.orm.controller_resolver.auto_mapping" will be changed from `true` to `false`. Explicitly configure `true` to keep existing behaviour.
    1x in MappingDebugClassCommandTest::testNotUploadableClass from Vich\UploaderBundle\Tests\Command
    1x in MappingDebugClassCommandTest::testUploadableClass from Vich\UploaderBundle\Tests\Command
    1x in MappingDebugCommandTest::testNotExistentMapping from Vich\UploaderBundle\Tests\Command
    1x in MappingDebugCommandTest::testExistentMapping from Vich\UploaderBundle\Tests\Command
    1x in MappingListClassesCommandTest::testListClasses from Vich\UploaderBundle\Tests\Command

  5x: Since doctrine/doctrine-bundle 2.11: Not setting "doctrine.orm.enable_lazy_ghost_objects" to true is deprecated.
    1x in MappingDebugClassCommandTest::testNotUploadableClass from Vich\UploaderBundle\Tests\Command
    1x in MappingDebugClassCommandTest::testUploadableClass from Vich\UploaderBundle\Tests\Command
    1x in MappingDebugCommandTest::testNotExistentMapping from Vich\UploaderBundle\Tests\Command
    1x in MappingDebugCommandTest::testExistentMapping from Vich\UploaderBundle\Tests\Command
    1x in MappingListClassesCommandTest::testListClasses from Vich\UploaderBundle\Tests\Command
garak commented 2 months ago

Fixed in #1459