From 80ff156cb7b78fbecbb328ccab8527da11d08c3f Mon Sep 17 00:00:00 2001 From: itismadness Date: Fri, 17 Apr 2020 16:01:52 +0000 Subject: [PATCH] Fix casing on path for logchecker integration tests --- .travis.yml | 2 +- composer.json | 2 +- tests/LogcheckerTest.php | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f5183ba..59e5176 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ before_install: install: - if [[ $PREFER_LOWEST != 1 ]]; then travis_retry composer update --no-interaction --prefer-dist; fi - if [[ $PREFER_LOWEST == 1 ]]; then travis_retry composer update --no-interaction --prefer-dist --prefer-lowest; fi - - if [[ $LINT != 1 ]]; then pip3 install --user cchardet xld_logchecker eac_logchecker; fi + - if [[ $LINT != 1 ]]; then pip3 install cchardet xld_logchecker eac_logchecker; fi script: - if [[ $LINT == 1 ]]; then composer run lint; fi diff --git a/composer.json b/composer.json index cbeadc2..f0beada 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "brainmaestro/composer-git-hooks": "^2.8" }, "scripts": { - "test": "phpunit", + "test": "phpunit -v", "lint": "phpcs", "lint:fix": "phpcbf", "static-analysis": "phpstan analyze src/" diff --git a/tests/LogcheckerTest.php b/tests/LogcheckerTest.php index 896e557..aadb237 100644 --- a/tests/LogcheckerTest.php +++ b/tests/LogcheckerTest.php @@ -26,16 +26,20 @@ class LogcheckerTest extends TestCase */ public function testLogchecker(string $ripper, string $filePath, string $fileName): void { - $basePath = implode(DIRECTORY_SEPARATOR, [__DIR__, 'logs', $ripper]); + $basePath = implode(DIRECTORY_SEPARATOR, [__DIR__, 'logs', strtolower($ripper)]); if (!Checksum::logcheckerExists($ripper)) { $this->markTestSkipped("Need to install {$ripper} logchecker"); } $detailsFile = implode(DIRECTORY_SEPARATOR, [$basePath, 'details', str_replace('.log', '.json', $fileName)]); + if (!file_exists($detailsFile)) { + $this->markTestIncomplete("Missing details file:\n- " . $detailsFile . "\n- " . $filePath); + } $htmlFile = implode(DIRECTORY_SEPARATOR, [$basePath, 'html', $fileName]); - if (!file_exists($detailsFile) || !file_exists($htmlFile)) { - $this->markTestIncomplete('Missing details or html output file: ' . $filePath); + if (!file_exists($htmlFile)) { + $this->markTestIncomplete("Missing html file:\n- " . $htmlFile . "\n- " . $filePath); } + $logchecker = new Logchecker(); $logchecker->newFile($filePath); $logchecker->parse();