Skip to content

Commit

Permalink
Fix casing on path for logchecker integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
itismadness committed Apr 17, 2020
1 parent b151153 commit 80ff156
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
10 changes: 7 additions & 3 deletions tests/LogcheckerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,20 @@ public function logDataProvider(): array
*/
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();
Expand Down

0 comments on commit 80ff156

Please sign in to comment.