Skip to content

Commit

Permalink
Try to add coverage tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Firesphere committed Oct 15, 2023
1 parent 119d04d commit 697a146
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions .ddev/php/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xdebug.mode=coverage
7 changes: 6 additions & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ jobs:
- run: cp .github/assets/SearchIndex.php.test app/src/SearchIndex.php
- run: cp example.env .env
- run: ddev sake dev/build
- run: ddev exec phpunit tests
- run: ddev xdebug
- run: ddev exec phpunit tests --coverage-clover ./coverage.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"defects":{"Firesphere\\ElasticSearch\\Tests\\EndToEndTest::testSearching":4,"Firesphere\\ElasticSearch\\Extensions\\DataObjectElasticExtensionTest::testCreatingObject":4,"Firesphere\\ElasticSearch\\Extensions\\DataObjectElasticExtensionTest::testOnAfterDelete":4,"Firesphere\\ElasticSearch\\Queries\\QueryBuilderTest::testBuildQuery":4,"Firesphere\\ElasticSearch\\Tests\\ElasticCoreServiceTest::testUpdateIndex":4},"times":{"Firesphere\\ElasticSearch\\Tests\\EndToEndTest::testSearching":0.005,"Firesphere\\ElasticSearch\\Extensions\\DataObjectElasticExtensionTest::testCreatingObject":2.175,"Firesphere\\ElasticSearch\\Extensions\\DataObjectElasticExtensionTest::testOnAfterDelete":2.074,"Firesphere\\ElasticSearch\\Tests\\SynonymSetTest::testRequireDefaultRecords":1.764,"Firesphere\\ElasticSearch\\Queries\\QueryBuilderTest::testBuildQuery":0.002,"Firesphere\\ElasticSearch\\Tests\\ElasticCoreServiceTest::testConstruct":0.121,"Firesphere\\ElasticSearch\\Tests\\ElasticCoreServiceTest::testUpdateIndex":0.132,"Firesphere\\ElasticSearch\\Tasks\\ConfigureSynonymsTaskTest::testRun":0.482}}
21 changes: 21 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Standard module phpunit configuration.
Requires PHPUnit ^9
-->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">.</directory>
</include>
<exclude>
<directory suffix=".php">tests/</directory>
<directory suffix=".php">thirdparty/</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="Default">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>

0 comments on commit 697a146

Please sign in to comment.