Skip to content

Commit b3ed791

Browse files
authored
Merge pull request #338 from dmason30/switch-to-pcov
Add pcov coverage & experimental skip nova tests on PRs
2 parents a76e9f1 + 84089de commit b3ed791

File tree

6 files changed

+15
-10
lines changed

6 files changed

+15
-10
lines changed

.travis.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,20 @@ matrix:
2323
- php: 7.4
2424

2525
before_script:
26-
- travis_retry composer self-update
27-
- travis_retry composer config --global github-protocols https
28-
- travis_retry composer config http-basic.nova.laravel.com $NOVA_USERNAME $NOVA_PASSWORD
29-
- travis_retry composer install --no-interaction --prefer-source
26+
- if php -v | grep -q 'Xdebug'; then phpenv config-rm xdebug.ini; fi
27+
- pecl install pcov
28+
- travis_retry composer self-update;
29+
- travis_retry composer config --global github-protocols https;
30+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then travis_retry composer config http-basic.nova.laravel.com $NOVA_USERNAME $NOVA_PASSWORD; fi'
31+
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then composer remove --dev laravel/nova --no-interaction --no-update; fi'
32+
- travis_retry composer install --no-interaction --prefer-source;
3033
- psql -c "CREATE DATABASE testing;" -U postgres
3134
- psql -c "CREATE USER homestead WITH PASSWORD 'secret';" -U postgres
3235

3336
script:
3437
- mkdir -p build/logs
35-
- php vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml
38+
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then php vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml --exclude-group nova; fi'
39+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then php vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml; fi'
3640

3741
after_success:
3842
- travis_retry php vendor/bin/php-coveralls -v

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"phpunit/phpunit": "^8.0",
3737
"sebastian/phpcpd": "^5.0",
3838
"squizlabs/php_codesniffer": "^3.4",
39-
"symfony/thanks": "^1.2"
39+
"symfony/thanks": "^1.2",
40+
"doctrine/dbal": "^2.10"
4041
},
4142
"autoload": {
4243
"psr-4": {

tests/Feature/Nova/BelongsToManyTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
use GeneaLabs\LaravelModelCaching\Tests\Fixtures\Book;
44
use GeneaLabs\LaravelModelCaching\Tests\Fixtures\Store;
55

6+
/** @group nova */
67
class BelongsToManyTest extends NovaTestCase
78
{
8-
/** @group test */
99
public function testAttachRelationFlushesCache()
1010
{
1111
$beforeStore = Store::with(['books'])->get()->first();
@@ -35,7 +35,6 @@ public function testAttachRelationFlushesCache()
3535
$this->assertSame('new foo', $book->title);
3636
}
3737

38-
/** @group test */
3938
public function testDetachRelationFlushesCache()
4039
{
4140
/** @var Store $store */
@@ -66,7 +65,6 @@ public function testDetachRelationFlushesCache()
6665
$this->assertCount(1, $books);
6766
}
6867

69-
/** @group test */
7068
public function testUpdateRelationFlushesCache()
7169
{
7270
$beforeStore = Store::with(['books'])->get()->first();
@@ -86,7 +84,6 @@ public function testUpdateRelationFlushesCache()
8684
$this->assertSame('foo', $book->title);
8785
}
8886

89-
/** @group test */
9087
public function testDeleteRelationFlushesCache()
9188
{
9289
$beforeStore = Store::with(['books'])->get()->first();

tests/Feature/Nova/CreateTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use GeneaLabs\LaravelModelCaching\Tests\Fixtures\Author;
44

5+
/** @group nova */
56
class CreateTest extends NovaTestCase
67
{
78
public function testCreateFlushesCacheForModel()

tests/Feature/Nova/DeleteTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use GeneaLabs\LaravelModelCaching\Tests\Fixtures\Author;
44

5+
/** @group nova */
56
class DeleteTest extends NovaTestCase
67
{
78
public function testDeleteFlushesCacheForModel()

tests/Feature/Nova/UpdateTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use GeneaLabs\LaravelModelCaching\Tests\Fixtures\Author;
44

5+
/** @group nova */
56
class UpdateTest extends NovaTestCase
67
{
78
public function testUpdateFlushesCacheForModel()

0 commit comments

Comments
 (0)