:octocat: mute debug output on CI

This commit is contained in:
smiley
2022-07-26 16:38:34 +02:00
parent df29c1c277
commit 1fd3109339
5 changed files with 18 additions and 3 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ jobs:
run: composer update --no-ansi --no-interaction --no-progress --no-suggest
- name: "Run tests with phpunit"
run: php vendor/bin/phpunit --configuration=phpunit.xml
run: php vendor/bin/phpunit --configuration=phpunit.xml.dist
- name: "Send code coverage report to Codecov.io"
uses: codecov/codecov-action@v3
+1
View File
@@ -15,3 +15,4 @@
docs/*
vendor/*
composer.lock
phpunit.xml
+4
View File
@@ -23,4 +23,8 @@
<logging>
<junit outputFile=".build/logs/junit.xml"/>
</logging>
<php>
<!-- whether the test runs on CI or not - set to false to allow debug output -->
<const name="TEST_IS_CI" value="true"/>
</php>
</phpunit>
+6
View File
@@ -17,6 +17,7 @@ use chillerlan\QRCode\Output\{QROutputInterface, QRString};
use PHPUnit\Framework\TestCase;
use PHPUnit\Util\Color;
use Generator;
use function defined;
/**
* Tests the QRMatix class
@@ -41,6 +42,11 @@ final class QRMatrixTest extends TestCase{
* Matrix debugging console output
*/
public static function debugMatrix(QRMatrix $matrix):void{
if(defined('TEST_IS_CI') && TEST_IS_CI === true){
return;
}
$opt = new QROptions;
$opt->outputType = QROutputInterface::STRING_TEXT;
$opt->eol = Color::colorize('reset', "\x00\n");
+6 -2
View File
@@ -12,6 +12,7 @@
namespace chillerlan\QRCodeTest;
use chillerlan\QRCodeTest\Data\QRMatrixTest;
use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Common\{EccLevel, Mode, Version};
use chillerlan\QRCode\Output\QROutputInterface;
@@ -79,8 +80,11 @@ abstract class QRCodeReaderTestAbstract extends TestCase{
}
/** @noinspection PhpUndefinedMethodInspection */
$this::assertSame($expected, (string)(new QRCode)
->readFromSource($this->FQN::fromFile(__DIR__.'/samples/'.$img, $this->options)));
$result = (new QRCode)->readFromSource($this->FQN::fromFile(__DIR__.'/samples/'.$img, $this->options));
QRMatrixTest::debugMatrix($result->getMatrix());
$this::assertSame($expected, (string)$result);
}
public function testReaderMultiSegment():void{