Skip to content

Commit

Permalink
DEBUG test speed without saving
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jan 15, 2022
1 parent c7354d6 commit 0530eec
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions demos/init-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,20 +365,21 @@ public function importFromFilesystem(string $path, bool $isSub = null): void
if (in_array($fileinfo->getFilename(), ['demos', 'src', 'tests'], true) || $isSub) {
$entity = $this->createEntity();

$entity->save([
// test speed without saving
[
$this->fieldName()->name => $fileinfo->getFilename(),
$this->fieldName()->is_folder => $fileinfo->isDir(),
$this->fieldName()->type => pathinfo($fileinfo->getFilename(), \PATHINFO_EXTENSION),
]);
];

if ($fileinfo->isDir()) {
$entity->SubFolder->importFromFilesystem($fileinfo->getPath() . '/' . $fileinfo->getFilename(), true);
}

// skip full/slow import for Behat testing
if ($_ENV['CI'] ?? null) {
break;
}
// if ($_ENV['CI'] ?? null) {
// break;
// }
}
}
}
Expand Down

0 comments on commit 0530eec

Please sign in to comment.