Skip to content

Commit 56a511b

Browse files
committed
Update CI setup to ensure 100% code coverage
1 parent 2cf9795 commit 56a511b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,14 @@ jobs:
3131
coverage: xdebug
3232
ini-file: development
3333
- run: composer install
34-
- run: vendor/bin/phpunit --coverage-text
34+
- run: docker pull busybox:latest
35+
- run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml
3536
if: ${{ matrix.php >= 7.3 }}
36-
- run: vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
37+
- run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml -c phpunit.xml.legacy
3738
if: ${{ matrix.php < 7.3 }}
39+
- name: Check 100% code coverage
40+
shell: php {0}
41+
run: |
42+
<?php
43+
$metrics = simplexml_load_file('clover.xml')->project->metrics;
44+
exit((int) $metrics['statements'] === (int) $metrics['coveredstatements'] ? 0 : 1);

tests/FunctionalClientTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ public function testCreateStartAndRemoveContainer()
9090
// get all events between starting and removing for this container
9191
$promise = $this->client->events($start, $end, array('container' => array($container['Id'])));
9292
$ret = \React\Async\await($promise);
93-
94-
$this->assertIsArray($ret);
93+
assert(is_array($ret));
9594

9695
$status = array(); // array_column($ret, 'status'); // PHP 5.5+
9796
foreach ($ret as $one) {

0 commit comments

Comments
 (0)