Merge pull request #54200 from nextcloud/test-disable-autoload-apps

test: add env option to disable loading all installed apps during tests
pull/54345/head
Robin Appelman 2025-08-11 15:43:49 +07:00 committed by GitHub
commit 615c6916e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 6 deletions

@ -23,13 +23,16 @@ require_once __DIR__ . '/autoload.php';
\OC::$composerAutoloader->addPsr4('Tests\\', OC::$SERVERROOT . '/tests/', true);
// load all apps
$appManager = Server::get(IAppManager::class);
foreach (new \DirectoryIterator(__DIR__ . '/../apps/') as $file) {
if ($file->isDot()) {
continue;
$dontLoadApps = getenv('TEST_DONT_LOAD_APPS');
if (!$dontLoadApps) {
// load all apps
$appManager = Server::get(IAppManager::class);
foreach (new \DirectoryIterator(__DIR__ . '/../apps/') as $file) {
if ($file->isDot()) {
continue;
}
$appManager->loadApp($file->getFilename());
}
$appManager->loadApp($file->getFilename());
}
OC_Hook::clear();