Browse Source

Fix casing on path for logchecker integration tests

tags/0.9.0
itismadness 4 years ago
parent
commit
80ff156cb7
3 changed files with 9 additions and 5 deletions
  1. +1
    -1
      .travis.yml
  2. +1
    -1
      composer.json
  3. +7
    -3
      tests/LogcheckerTest.php

+ 1
- 1
.travis.yml View File

@@ -29,7 +29,7 @@ before_install:
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; fi
- if [[ $PREFER_LOWEST == 1 ]]; then travis_retry composer update --no-interaction --prefer-dist --prefer-lowest; 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: script:
- if [[ $LINT == 1 ]]; then composer run lint; fi - if [[ $LINT == 1 ]]; then composer run lint; fi


+ 1
- 1
composer.json View File

@@ -30,7 +30,7 @@
"brainmaestro/composer-git-hooks": "^2.8" "brainmaestro/composer-git-hooks": "^2.8"
}, },
"scripts": { "scripts": {
"test": "phpunit",
"test": "phpunit -v",
"lint": "phpcs", "lint": "phpcs",
"lint:fix": "phpcbf", "lint:fix": "phpcbf",
"static-analysis": "phpstan analyze src/" "static-analysis": "phpstan analyze src/"


+ 7
- 3
tests/LogcheckerTest.php View File

@@ -26,16 +26,20 @@ class LogcheckerTest extends TestCase
*/ */
public function testLogchecker(string $ripper, string $filePath, string $fileName): void 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)) { if (!Checksum::logcheckerExists($ripper)) {
$this->markTestSkipped("Need to install {$ripper} logchecker"); $this->markTestSkipped("Need to install {$ripper} logchecker");
} }


$detailsFile = implode(DIRECTORY_SEPARATOR, [$basePath, 'details', str_replace('.log', '.json', $fileName)]); $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]); $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 = new Logchecker();
$logchecker->newFile($filePath); $logchecker->newFile($filePath);
$logchecker->parse(); $logchecker->parse();


Loading…
Cancel
Save