Skip to content

Improve fatal detection in php-test-standalone-plugins with E2E test rather than using PHPUnit #1051

@westonruter

Description

@westonruter

Currently, php-test-standalone-plugins workflow (via the test-plugins command) is just checking to see if each standalone plugin causes a fatal when it is active in isolation from the other plugins:

public function test_plugin_does_not_fatal() {
return $this->assertTrue( true );
}

This seems like using the wrong tool, PHPUnit, for the job. Indeed, PHPStan flags this assertion as an error:

phpstan: Call to method PHPUnit\Framework\Assert::assertTrue() with true will always evaluate to true.

It seems better to not use PHPUnit here, but rather to use curl to fetch the homepage and make sure it returns a 200 status code and includes </html> in the response body. Even better would be to start using Playwright to do actual E2E tests.

I also think the test-plugins command should also be renamed to reduce confusion with test-php-plugins and test-php, for example, test-e2e.

Originally discussed in #1044 (comment) and #1044 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    InfrastructureIssues for the overall performance plugin infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions