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

Runtime error causing crash #13

Open
tacman opened this issue Jan 3, 2025 · 1 comment
Open

Runtime error causing crash #13

tacman opened this issue Jan 3, 2025 · 1 comment

Comments

@tacman
Copy link

tacman commented Jan 3, 2025

I'm trying to help debug twigphp/Twig#4528 (reply in thread) and thought it'd be cool to add smoke testing to it. But it's causing my machine to freeze until the process finally dies:

You can re-create it by cutting and pasting this. I think the problem is with the guard tag, but thought I'd report it here in case you can improve the testing itself.

symfony new ignore-dump-in-production --webapp && cd ignore-dump-in-production
bin/console make:controller AppController
sed -i "s|/app|/|" src/Controller/AppController.php

cat <<'EOF' > templates/app/index.html.twig
{% extends 'base.html.twig' %}
{% block body %}
    {% guard function dump  %}
       {{ dump() }}
    {% else %}
        dump cannot be used in production
    {% endguard %}
{% endblock %}
EOF

composer require --dev pierstoval/smoke-testing
cat <<'EOF' > tests/AllRoutesTest.php
<?php

namespace App\Tests;
use Pierstoval\SmokeTesting\SmokeTestStaticRoutes;

class AllRoutesTest extends SmokeTestStaticRoutes
{
    // That's all!
}
EOF

vendor/bin/phpunit

On my machine. this dies:

No security vulnerability advisories found.
Using version ^1.1 for pierstoval/smoke-testing
PHPUnit 9.6.22 by Sebastian Bergmann and contributors.

Testing 
Killed
@Pierstoval
Copy link
Owner

I just tried it and it works fine on my machine:

image

Maybe it's related to PHP or its config?

Can you upload the output of php --version and php -i so I can see if it's coming from my package itself?

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

No branches or pull requests

2 participants