Skip to content

Commit

Permalink
Update CI setup to ensure 100% code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Dec 1, 2022
1 parent 2cf9795 commit 56a511b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ jobs:
coverage: xdebug
ini-file: development
- run: composer install
- run: vendor/bin/phpunit --coverage-text
- run: docker pull busybox:latest
- run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml
if: ${{ matrix.php >= 7.3 }}
- run: vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
- run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml -c phpunit.xml.legacy
if: ${{ matrix.php < 7.3 }}
- name: Check 100% code coverage
shell: php {0}
run: |
<?php
$metrics = simplexml_load_file('clover.xml')->project->metrics;
exit((int) $metrics['statements'] === (int) $metrics['coveredstatements'] ? 0 : 1);
3 changes: 1 addition & 2 deletions tests/FunctionalClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ public function testCreateStartAndRemoveContainer()
// get all events between starting and removing for this container
$promise = $this->client->events($start, $end, array('container' => array($container['Id'])));
$ret = \React\Async\await($promise);

$this->assertIsArray($ret);
assert(is_array($ret));

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

0 comments on commit 56a511b

Please sign in to comment.