From 2c96a06d6e08c11dde4d8182b32c0d1a3560471b Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Fri, 9 Sep 2016 01:26:46 +0900 Subject: [PATCH] Exclude long tests on Travis Tests that run too long without output tends to break Travis builds. This is typically the case when running code-coverage, so we need to exclude a few test cases to ensure that the builds are stable. --- tests/PhpSpreadsheetTests/SampleTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/PhpSpreadsheetTests/SampleTest.php b/tests/PhpSpreadsheetTests/SampleTest.php index 1c35fa87..96ff3e1d 100644 --- a/tests/PhpSpreadsheetTests/SampleTest.php +++ b/tests/PhpSpreadsheetTests/SampleTest.php @@ -25,6 +25,20 @@ class SampleTest extends \PHPUnit_Framework_TestCase '20 Read OOCalc with PCLZip', // Crash: Call to undefined method \PhpOffice\PhpSpreadsheet\Shared\ZipArchive::statName() '21 Pdf', // for now we don't have 3rdparty libs to tests PDF, but it should be added ]; + + // Unfortunately some tests are too long be ran with code-coverage + // analysis on Travis, so we need to exclude them + global $argv; + if (in_array('--coverage-clover', $argv)) { + $tooLongToBeCovered = [ + '06 Largescale', + '06 Largescale with cellcaching', + '06 Largescale with cellcaching sqlite', + '06 Largescale with cellcaching sqlite3', + ]; + $skipped = array_merge($skipped, $tooLongToBeCovered); + } + $helper = new \PhpOffice\PhpSpreadsheet\Helper\Sample(); $samples = []; foreach ($helper->getSamples() as $name => $sample) {