Skip to content

Commit

Permalink
Improve phpunit config and fail builds on warning, incomplete and ris…
Browse files Browse the repository at this point in the history
…ky test cases. Execute tests in the random order (#2225)
  • Loading branch information
sidz authored Aug 15, 2024
1 parent 32b9cc1 commit e2cb89b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
40 changes: 23 additions & 17 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,32 @@
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
failOnWarning="true"
failOnIncomplete="true"
failOnRisky="true"
executionOrder="random"
bootstrap="tests/bootstrap.php"
>
<coverage>
<include>
<directory>src/</directory>
</include>
<exclude>
<file>src/Query/Match.php</file>
</exclude>
</coverage>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
<testsuites>
<testsuite name="default">
<directory>tests/</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory>src/</directory>
</include>
<exclude>
<file>src/Query/Match.php</file>
</exclude>
</coverage>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>

<testsuites>
<testsuite name="default">
<directory>tests/</directory>
</testsuite>
</testsuites>
</phpunit>
2 changes: 1 addition & 1 deletion tests/Node/InfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testHasPlugin(): void
$this->assertFalse($info->hasPlugin('foo'));

if (\version_compare($_SERVER['ES_VERSION'], '8.4.0', '>=')) {
$this->markTestIncomplete('The Ingest Attachment plugin is now included in Elasticsearch. https://www.elastic.co/guide/en/elasticsearch/plugins/8.4/ingest-attachment.html');
$this->markTestSkipped('The Ingest Attachment plugin is now included in Elasticsearch. https://www.elastic.co/guide/en/elasticsearch/plugins/8.4/ingest-attachment.html');
} else {
$this->assertTrue($info->hasPlugin('ingest-attachment'));
}
Expand Down

0 comments on commit e2cb89b

Please sign in to comment.