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

Builds are failing (PHP 7.4) #446

Closed
jakzal opened this issue Dec 9, 2019 · 12 comments · Fixed by #448
Closed

Builds are failing (PHP 7.4) #446

jakzal opened this issue Dec 9, 2019 · 12 comments · Fixed by #448
Labels

Comments

@jakzal
Copy link

jakzal commented Dec 9, 2019

I was trying to build on PHP 7.4 and noticed failures are not PHP version related.

i.e. https://travis-ci.org/humbug/box/jobs/611311228

image

Also, on my machine I get some additional debugging information as a result of #444. The test_it_can_build_a_PHAR_file_in_debug_mode test fails because of this with an unclear error:

1) KevinGH\Box\Console\Command\CompileTest::test_it_can_build_a_PHAR_file_in_debug_mode
PHPUnit\Framework\Exception: PHP Fatal error:  Uncaught Exception: Serialization of 'class@anonymous' is not allowed in Standard input code:357
Stack trace:
#0 Standard input code(357): serialize(Array)
#1 Standard input code(683): __phpunit_run_isolated_test()
#2 {main}
  thrown in Standard input code on line 357
@theofidry theofidry added the bug label Dec 9, 2019
@theofidry
Copy link
Member

The real error can be checked by removing @runTestsInSeperateProcess and running that test only with --filter. PHPUnit doesn't display more information and only that obscure error because the underlying exception/error is not serializable hence cannot be passed to the main process to be displayed

@theofidry
Copy link
Member

Also probably related: humbug/php-scoper#357

@theofidry theofidry changed the title Builds are failing Builds are failing (PHP 7.4) Dec 9, 2019
@jakzal
Copy link
Author

jakzal commented Dec 9, 2019

To clarify: builds are failing on all PHP versions at the moment.

@theofidry
Copy link
Member

Hm ok, will try to take a look this week

@jakzal
Copy link
Author

jakzal commented Dec 10, 2019

The actual failure:

There was 1 failure:

1) KevinGH\Box\Console\Command\CompileTest::test_it_can_build_a_PHAR_file_in_debug_mode
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'[debug] Current memory limit: "512MB"
+'[debug] Changed the memory limit from "128MB" to "512M"
 [debug] Checking BOX_ALLOW_XDEBUG
-[debug] The xdebug extension is not loaded
+[debug] The Xdebug extension is not loaded
 [debug] Disabled parallel processing

     ____

/Users/kuba/Projects/box/tests/Console/Command/CompileTest.php:1136

Before I upgraded PHP on my machine I had other debugging information in there - something about raising limits - that's why I thought it's related to #444. Strangely that build has passed...

@theofidry
Copy link
Member

Hm indeed, can also be related to either xdebug itself or the composer/xdebug-handler package

@jakzal
Copy link
Author

jakzal commented Dec 10, 2019

It's inconsistent between PHP versions. We shouldn't rely on output this much imo.

If I fix PHPUnit tests run directly on travis, there's some failing on docker (i think).

I think the test suite could do a lot with making it portable.

@theofidry
Copy link
Member

Indeed might be worth to pin those on a specific version via docker.

I don't want to rely too much on this input, but since it's essential logs I also want to make sure those messages are displayed correctly...

@jakzal
Copy link
Author

jakzal commented Dec 10, 2019

Well, in my view we should never assert the whole output, but rather look for specific parts. I.e.

  • debug messages are displayed
  • memory usage was bumped
  • etc

these are separate test.

@theofidry
Copy link
Member

but if you do that you are missing where those are displayed, which has its importance...

@jakzal
Copy link
Author

jakzal commented Dec 10, 2019

if order is important you encode it in a test.

@jakzal
Copy link
Author

jakzal commented Dec 10, 2019

This is required for box to actually work on PHP 7.4: opis/closure#42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants