mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 13:12:41 +00:00
Restore complete Database coverage
Also suppress PostgreSQL database function tests from normal coverage, and add a "coverage:full" task to run them if needed.
This commit is contained in:
parent
51755a2ce6
commit
f2245861e3
3 changed files with 25 additions and 0 deletions
18
RoboFile.php
18
RoboFile.php
|
@ -50,6 +50,21 @@ class RoboFile extends \Robo\Tasks {
|
||||||
* recommended if debugging facilities are not otherwise needed.
|
* recommended if debugging facilities are not otherwise needed.
|
||||||
*/
|
*/
|
||||||
public function coverage(array $args): Result {
|
public function coverage(array $args): Result {
|
||||||
|
// run tests with code coverage reporting enabled
|
||||||
|
$exec = $this->findCoverageEngine();
|
||||||
|
return $this->runTests($exec, "coverage", array_merge(["--coverage-html", self::BASE_TEST."coverage"], $args));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Produces a code coverage report, with redundant tests
|
||||||
|
*
|
||||||
|
* Depending on the environment, some tests that normally provide
|
||||||
|
* coverage may be skipped, while working alternatives are normally
|
||||||
|
* suppressed for reasons of time. This coverage report will try to
|
||||||
|
* run all tests which may cover code.
|
||||||
|
*
|
||||||
|
* See also help for the "coverage" task for more details.
|
||||||
|
*/
|
||||||
|
public function coverageFull(array $args): Result {
|
||||||
// run tests with code coverage reporting enabled
|
// run tests with code coverage reporting enabled
|
||||||
$exec = $this->findCoverageEngine();
|
$exec = $this->findCoverageEngine();
|
||||||
return $this->runTests($exec, "typical", array_merge(["--coverage-html", self::BASE_TEST."coverage"], $args));
|
return $this->runTests($exec, "typical", array_merge(["--coverage-html", self::BASE_TEST."coverage"], $args));
|
||||||
|
@ -88,6 +103,9 @@ class RoboFile extends \Robo\Tasks {
|
||||||
case "quick":
|
case "quick":
|
||||||
$set = ["--exclude-group", "optional,slow"];
|
$set = ["--exclude-group", "optional,slow"];
|
||||||
break;
|
break;
|
||||||
|
case "coverage":
|
||||||
|
$set = ["--exclude-group", "optional,excludeFromCoverage"];
|
||||||
|
break;
|
||||||
case "full":
|
case "full":
|
||||||
$set = [];
|
$set = [];
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -772,6 +772,12 @@ trait SeriesArticle {
|
||||||
$this->compareExpectations($state);
|
$this->compareExpectations($state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testMarkMultipleMissingEditions() {
|
||||||
|
$this->assertSame(0, Arsse::$db->articleMark($this->user, ['starred'=>true], (new Context)->editions([500,501])));
|
||||||
|
$state = $this->primeExpectations($this->data, $this->checkTables);
|
||||||
|
$this->compareExpectations($state);
|
||||||
|
}
|
||||||
|
|
||||||
public function testMarkMultipleEditionsUnread() {
|
public function testMarkMultipleEditionsUnread() {
|
||||||
Arsse::$db->articleMark($this->user, ['read'=>false], (new Context)->editions([2,4,7,1001]));
|
Arsse::$db->articleMark($this->user, ['read'=>false], (new Context)->editions([2,4,7,1001]));
|
||||||
$now = Date::transform(time(), "sql");
|
$now = Date::transform(time(), "sql");
|
||||||
|
|
|
@ -7,6 +7,7 @@ declare(strict_types=1);
|
||||||
namespace JKingWeb\Arsse\TestCase\Db\PosgreSQL;
|
namespace JKingWeb\Arsse\TestCase\Db\PosgreSQL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @group excludeFromCoverage
|
||||||
* @covers \JKingWeb\Arsse\Database<extended>
|
* @covers \JKingWeb\Arsse\Database<extended>
|
||||||
* @covers \JKingWeb\Arsse\Misc\Query<extended>
|
* @covers \JKingWeb\Arsse\Misc\Query<extended>
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue