Skip to content

Commit e2cb89b

Browse files
authored
Improve phpunit config and fail builds on warning, incomplete and risky test cases. Execute tests in the random order (#2225)
1 parent 32b9cc1 commit e2cb89b

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

phpunit.xml.dist

+23-17
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,32 @@
22
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
33
<phpunit
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
5+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
66
colors="true"
77
beStrictAboutOutputDuringTests="true"
88
verbose="true"
9+
failOnWarning="true"
10+
failOnIncomplete="true"
11+
failOnRisky="true"
12+
executionOrder="random"
913
bootstrap="tests/bootstrap.php"
1014
>
11-
<coverage>
12-
<include>
13-
<directory>src/</directory>
14-
</include>
15-
<exclude>
16-
<file>src/Query/Match.php</file>
17-
</exclude>
18-
</coverage>
19-
<listeners>
20-
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
21-
</listeners>
22-
<testsuites>
23-
<testsuite name="default">
24-
<directory>tests/</directory>
25-
</testsuite>
26-
</testsuites>
15+
<coverage>
16+
<include>
17+
<directory>src/</directory>
18+
</include>
19+
<exclude>
20+
<file>src/Query/Match.php</file>
21+
</exclude>
22+
</coverage>
23+
24+
<listeners>
25+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
26+
</listeners>
27+
28+
<testsuites>
29+
<testsuite name="default">
30+
<directory>tests/</directory>
31+
</testsuite>
32+
</testsuites>
2733
</phpunit>

tests/Node/InfoTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testHasPlugin(): void
5050
$this->assertFalse($info->hasPlugin('foo'));
5151

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

0 commit comments

Comments
 (0)