Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit tests #6168

Merged
merged 1 commit into from
Jun 27, 2020
Merged

Fix unit tests #6168

merged 1 commit into from
Jun 27, 2020

Conversation

peter-gribanov
Copy link
Contributor

@peter-gribanov peter-gribanov commented Jun 25, 2020

Subject

Unit tests is broken. Apparently after updating the SonataCoreBundle.

Changelog

### Fixed
- fix unit tests

VincentLanglet
VincentLanglet previously approved these changes Jun 25, 2020
Copy link
Member

@VincentLanglet VincentLanglet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why it started to fail now ?

@jordisala1991
Copy link
Member

Because the widget test case on 1.x of Sonata Form have different signature.

@jordisala1991
Copy link
Member

jordisala1991 commented Jun 25, 2020

This cannot be fixed like this, because on 0.x it have the older signature, and the prefer lowest build will fail

@VincentLanglet
Copy link
Member

There is also an error

Class 'Sonata\CoreBundle\Test\XliffValidatorTestCase' not found

@jordisala1991
Copy link
Member

And there is another problem:

PHP Fatal error:  Class 'Sonata\CoreBundle\Test\XliffValidatorTestCase' not found in /home/travis/build/sonata-project/SonataAdminBundle/tests/Resources/XliffTest.php on line 18

That one is easy tho.

@VincentLanglet
Copy link
Member

This cannot be fixed like this, because on 0.x it have the older signature, and the prefer lowest build will fail

I think you can add return type without any issue.

@VincentLanglet
Copy link
Member

Because the widget test case on 1.x of Sonata Form have different signature.

The question was why the test were working like 4 days ago and not now.
I discovered that the last 3.20.0 release of BlockBundle drop SonataCore.
Before this, SonataAdmin was still installing the CoreBundle. cc @wbloszyk

@peter-gribanov
Copy link
Contributor Author

Unfortunately, i could not fix all the errors. Any ideas how to fix this?

Unable to find one of the following templates: "@SonataCore/FlashMessage/render.html.twig", "@SonataTwig/FlashMessage/render.html.twig" in "@SonataAdmin/standard_layout.html.twig"

@jordisala1991
Copy link
Member

It is happening on functional test? you may need to register sonataTwigBundle

@peter-gribanov
Copy link
Contributor Author

The last problem remains

Unable to find template "form_div_layout.html.twig" (looked into: /home/travis/build/sonata-project/SonataAdminBundle/vendor/sonata-project/form-extensions/src/Test/../Bridge/Symfony/Resources/views/Form, /home/travis/build/sonata-project/SonataAdminBundle/tests/Form/Widget/../../../src/Resources/views/Form) in "filter_admin_fields.html.twig".

@jordisala1991
Copy link
Member

I have it: https://github.com/sonata-project/form-extensions/blob/30921cb96ee89429e22621f2c6930933aa7783f3/src/Test/AbstractWidgetTestCase.php#L92

This line is the problem, it has one ../ that need to be removed and released

@jordisala1991
Copy link
Member

@peter-gribanov sonata-project/form-extensions#101 Does it fix the last build?

@peter-gribanov
Copy link
Contributor Author

@jordisala1991 Yes. This solves the problem.

wbloszyk
wbloszyk previously approved these changes Jun 26, 2020
not test Exporter if not Sonata\CoreBundle\Exporter\Exporter

not test ChoiceTypeExtension if no SonataCoreBundle

remove SonataCoreBundle from AppKernel if it is not exists

register SonataFormBundle and SonataTwigBundle in AppKernel

add ChoiceTypeExtensionTest::$factory property

fix ChoiceTypeExtensionTest
@jordisala1991 jordisala1991 requested review from VincentLanglet and a team June 27, 2020 11:09
@greg0ire greg0ire merged commit 5aa95f2 into sonata-project:3.x Jun 27, 2020
@greg0ire
Copy link
Contributor

Thanks a lot @peter-gribanov !

@peter-gribanov peter-gribanov deleted the test_failed branch June 28, 2020 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants