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

Add missing arguments when calling the legacy extension #609

Merged
merged 1 commit into from
Oct 27, 2023
Merged

Add missing arguments when calling the legacy extension #609

merged 1 commit into from
Oct 27, 2023

Conversation

janklan
Copy link
Contributor

@janklan janklan commented Oct 15, 2023

I'm getting a bunch of errors similar to what was reported in #608. Is it possible the fix is this simple?

For the record, the errors are along the lines of:

Exception in third-party event subscriber: Symfony\Component\Panther\ServerExtensionLegacy::executeAfterTest(): Argument #2 ($time) must be of type float, PHPUnit\Event\Telemetry\HRTime given, called in /srv/app/vendor/symfony/panther/src/ServerExtension.php on line 92
#0 /srv/app/vendor/symfony/panther/src/ServerExtension.php(92): Symfony\Component\Panther\ServerExtensionLegacy->executeAfterTest('testUpdateValue', Object(PHPUnit\Event\Telemetry\HRTime))
#1 /srv/app/vendor/phpunit/phpunit/src/Event/Dispatcher/DirectDispatcher.php(100): PHPUnit\Event\Test\FinishedSubscriber@anonymous->notify(Object(PHPUnit\Event\Test\Finished))
#2 /srv/app/vendor/phpunit/phpunit/src/Event/Dispatcher/DeferringDispatcher.php(45): PHPUnit\Event\DirectDispatcher->dispatch(Object(PHPUnit\Event\Test\Finished))
#3 /srv/app/vendor/phpunit/phpunit/src/Event/Emitter/DispatchingEmitter.php(952): PHPUnit\Event\DeferringDispatcher->dispatch(Object(PHPUnit\Event\Test\Finished))
#4 /srv/app/vendor/phpunit/phpunit/src/Framework/TestRunner.php(238): PHPUnit\Event\DispatchingEmitter->testFinished(Object(PHPUnit\Event\Code\TestMethod), 1)
#5 /srv/app/vendor/phpunit/phpunit/src/Framework/TestCase.php(489): PHPUnit\Framework\TestRunner->run(Object(App\Tests\Service\ValueStoreServiceTest))
#6 /srv/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php(340): PHPUnit\Framework\TestCase->run()
#7 /srv/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php(340): PHPUnit\Framework\TestSuite->run()
#8 /srv/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php(340): PHPUnit\Framework\TestSuite->run()
#9 /srv/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(63): PHPUnit\Framework\TestSuite->run()
#10 /srv/app/vendor/phpunit/phpunit/src/TextUI/Application.php(189): PHPUnit\TextUI\TestRunner->run(Object(PHPUnit\TextUI\Configuration\Configuration), Object(PHPUnit\Runner\ResultCache\DefaultResultCache), Object(PHPUnit\Framework\TestSuite))
#11 /srv/app/vendor/phpunit/phpunit/phpunit(99): PHPUnit\TextUI\Application->run(Array)
#12 /srv/app/vendor/bin/phpunit(123): include('/srv/app/vendor...')
#13 {main}

@@ -89,7 +89,7 @@ public function __construct(private $extension)

public function notify(TestFinishedEvent $event): void
{
$this->extension->executeAfterTest();
$this->extension->executeAfterTest($event->test()->name(), (float) $event->telemetryInfo()->time()->seconds());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not convinced the $time should be in seconds, especially when the value should be a float, but the value isn't used in the legacy extension anyway, so this effectively mutes the error.

@dunglas dunglas merged commit 531fda4 into symfony:main Oct 27, 2023
11 of 13 checks passed
@dunglas
Copy link
Member

dunglas commented Oct 27, 2023

Thanks!

@driehle
Copy link

driehle commented Nov 30, 2023

@janklan @dunglas

Would it be possible to make a new release that includes this change? This would solve both #608 and #612. The latest release is, unfortunatly, still 2.1.0 from May 30th.

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.

4 participants