Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/object-storage-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
php -f tests/enable_all.php

- name: PHPUnit
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/object-storage-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
php -f tests/enable_all.php

- name: Wait for S3
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/object-storage-swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
php -f tests/enable_all.php

- name: PHPUnit
env:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/phpunit-32bits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
paths:
- 'version.php'
- '.github/workflows/phpunit-32bits.yml'
- 'tests/phpunit-autotest.xml'
workflow_dispatch:
schedule:
- cron: "15 1 * * 1-6"
Expand Down Expand Up @@ -47,22 +48,24 @@ jobs:
uses: shivammathur/setup-php@cf4cade2721270509d5b1c766ab3549210a39a2a #v2.33.0
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype, curl, dom, fileinfo, gd, imagick, intl, json, mbstring, openssl, pdo_sqlite, posix, sqlite, xml, zip, apcu
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, imagick, intl, json, libxml, mbstring, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite, apcu, ldap
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apcu, bz2, ctype, curl, dom, fileinfo, gd, iconv, imagick, intl, json, ldap, libxml, mbstring, openssl, pcntl, pdo_sqlite, posix, redis, session, simplexml, sqlite, xmlreader, xmlwriter, zip, zlib

I would love to have the list sorted 🙈

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but I reused the order of the other jobs to have it easier to compare.
It’s a mystery to me why no other job have the ldap module though, is php-32bit the only CI running user_ldap tests?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ldap module could be enabled by default though.

Copy link
Member

@blizzz blizzz Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately phpunit warnings and skipped tests are not printed

Update: but rather integration tests and they run and ldap is enabled, e.g.: https://github.com/nextcloud/server/actions/runs/15561112793

coverage: none
ini-file: development
ini-values:
apc.enabled=on, apc.enable_cli=on, disable_functions= # https://github.com/shivammathur/setup-php/discussions/573
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up dependencies
run: composer i

- name: Set up Nextcloud
env:
DB_PORT: 4444
run: |
composer install
mkdir data
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=rootpassword --admin-user admin --admin-pass admin
php -f index.php
php -f tests/enable_all.php

- name: PHPUnit
run: composer run test -- --exclude-group PRIMARY-azure,PRIMARY-s3,PRIMARY-swift,Memcached,Redis,RoutingWeirdness
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
./occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
php -f tests/enable_all.php

- name: PHPUnit
run: composer run test:db -- --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.db.xml' || '' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-memcached.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
mkdir data
cp tests/preseed-config.php config/config.php
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
php -f tests/enable_all.php

- name: PHPUnit memcached tests
run: composer run test -- --group Memcache,Memcached --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.xml' || '' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-mysql-sharding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
./occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
php -f tests/enable_all.php

- name: PHPUnit
run: composer run test:db -- --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.db.xml' || '' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
./occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
php -f tests/enable_all.php

- name: PHPUnit
run: composer run test:db -- --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.db.xml' || '' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-nodb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
php -f tests/enable_all.php

- name: PHPUnit nodb testsuite
run: composer run test -- --exclude-group DB,SLOWDB --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.nodb.xml' || '' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-object-store-primary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
php -f tests/enable_all.php

- name: Wait for S3
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-oci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
./occ maintenance:install --verbose --database=oci --database-name=${{ matrix.oracle-versions < 23 && 'XE' || 'FREE' }} --database-host=127.0.0.1 --database-port=1521 --database-user=system --database-pass=oracle --admin-user admin --admin-pass admin
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
php -f tests/enable_all.php

- name: PHPUnit
run: composer run test:db -- --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.db.xml' || '' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
./occ maintenance:install --verbose --database=pgsql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
php -f tests/enable_all.php

- name: PHPUnit database tests
run: composer run test:db -- --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.db.xml' || '' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
php -f tests/enable_all.php

- name: Nextcloud debug information
run: ./occ app:list && echo "======= System config =======" && ./occ config:list system
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use OCP\IConfig;
use OCP\L10N\IFactory;
use OCP\Share\IManager;
use OCP\Util;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase;
Expand All @@ -37,6 +38,21 @@ protected function setUp(): void {
$this->factory = $this->createMock(IFactory::class);
$this->initialStateService = $this->createMock(InitialStateService::class);
$this->config = $this->createMock(IConfig::class);

/* Empty static array to avoid inter-test conflicts */
\OC_Util::$styles = [];
self::invokePrivate(Util::class, 'scripts', [[]]);
self::invokePrivate(Util::class, 'scriptDeps', [[]]);
self::invokePrivate(Util::class, 'scriptsInit', [[]]);
}

protected function tearDown(): void {
parent::tearDown();

\OC_Util::$styles = [];
self::invokePrivate(Util::class, 'scripts', [[]]);
self::invokePrivate(Util::class, 'scriptDeps', [[]]);
self::invokePrivate(Util::class, 'scriptsInit', [[]]);
}

public function testHandleIgnoresNonMatchingEvent(): void {
Expand All @@ -61,7 +77,7 @@ public function testHandleWithLoadAdditionalScriptsEvent(): void {
$this->overwriteService(InitialStateService::class, $this->initialStateService);
$this->overwriteService(IConfig::class, $this->config);

$scriptsBefore = \OCP\Util::getScripts();
$scriptsBefore = Util::getScripts();
$this->assertNotContains('files_sharing/l10n/language_mock', $scriptsBefore);
$this->assertNotContains('files_sharing/js/additionalScripts', $scriptsBefore);
$this->assertNotContains('files_sharing/js/init', $scriptsBefore);
Expand All @@ -71,14 +87,12 @@ public function testHandleWithLoadAdditionalScriptsEvent(): void {
$listener->handle($this->event);

// assert array $scripts contains the expected scripts
$scriptsAfter = \OCP\Util::getScripts();
$scriptsAfter = Util::getScripts();
$this->assertContains('files_sharing/l10n/language_mock', $scriptsAfter);
$this->assertContains('files_sharing/js/additionalScripts', $scriptsAfter);
$this->assertNotContains('files_sharing/js/init', $scriptsAfter);

$this->assertContains('files_sharing/css/icons', \OC_Util::$styles);

$this->assertTrue(true);
}

public function testHandleWithLoadAdditionalScriptsEventWithShareApiEnabled(): void {
Expand All @@ -92,17 +106,15 @@ public function testHandleWithLoadAdditionalScriptsEventWithShareApiEnabled(): v
$this->overwriteService(IConfig::class, $this->config);
$this->overwriteService(IFactory::class, $this->factory);

$scriptsBefore = \OCP\Util::getScripts();
$scriptsBefore = Util::getScripts();
$this->assertNotContains('files_sharing/js/init', $scriptsBefore);

// Util static methods can't be easily mocked, so just ensure no exceptions
$listener->handle($this->event);

$scriptsAfter = \OCP\Util::getScripts();
$scriptsAfter = Util::getScripts();

// assert array $scripts contains the expected scripts
$this->assertContains('files_sharing/js/init', $scriptsAfter);

$this->assertTrue(true);
}
}
9 changes: 3 additions & 6 deletions tests/enable_all.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<?php
/**
* SPDX-FileCopyrightText: 2016-2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016-2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2012-2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

require_once __DIR__ . '/../lib/base.php';

function enableApp($app) {
try {
(new \OC_App())->enable($app);
} catch (Exception $e) {
echo $e;
}
(new \OC_App())->enable($app);
echo "Enabled application {$app}\n";
}

foreach (new \DirectoryIterator(__DIR__ . '/../apps/') as $file) {
Expand Down
Loading