chore: Install phpunit via vendor bintags/v28.0.0beta1
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | ||||
with: | with: | ||||
php-version: ${{ matrix.php-versions }} | php-version: ${{ matrix.php-versions }} | ||||
tools: phpunit:9 | |||||
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | ||||
env: | env: | ||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||
- name: Set up Nextcloud | - name: Set up Nextcloud | ||||
run: | | run: | | ||||
composer install | |||||
mkdir data | mkdir data | ||||
./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 | ./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 | ||||
./occ app:enable --force ${{ env.APP_NAME }} | ./occ app:enable --force ${{ env.APP_NAME }} | ||||
- name: PHPUnit | - name: PHPUnit | ||||
run: | | run: | | ||||
echo "<?php return ['run' => true,'host' => 'localhost','user' => 'test','password' => 'test', 'root' => '${{ env.FTP_ROOT }}'];" > apps/${{ env.APP_NAME }}/tests/config.ftp.php | echo "<?php return ['run' => true,'host' => 'localhost','user' => 'test','password' => 'test', 'root' => '${{ env.FTP_ROOT }}'];" > apps/${{ env.APP_NAME }}/tests/config.ftp.php | ||||
phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/FtpTest.php | |||||
composer run test:files_external apps/files_external/tests/Storage/FtpTest.php | |||||
- name: ftpd logs | - name: ftpd logs | ||||
if: always() | if: always() | ||||
run: | | run: | |
with: | with: | ||||
php-version: ${{ matrix.php-versions }} | php-version: ${{ matrix.php-versions }} | ||||
extensions: ctype, curl, dom, fileinfo, gd, imagick, intl, json, mbstring, oci8, openssl, pcntl, pdo_sqlite, posix, sqlite, xml, zip | extensions: ctype, curl, dom, fileinfo, gd, imagick, intl, json, mbstring, oci8, openssl, pcntl, pdo_sqlite, posix, sqlite, xml, zip | ||||
tools: phpunit:9 | |||||
coverage: none | coverage: none | ||||
ini-file: development | ini-file: development | ||||
env: | env: | ||||
- name: Set up Nextcloud | - name: Set up Nextcloud | ||||
run: | | run: | | ||||
composer install | |||||
mkdir data | mkdir data | ||||
./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=1521 --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin | ./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=1521 --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin | ||||
php -f index.php | php -f index.php | ||||
- name: PHPUnit | - name: PHPUnit | ||||
working-directory: tests | |||||
run: phpunit --configuration phpunit-autotest.xml --group DB,SLOWDB | |||||
run: composer run test:db | |||||
- name: Run repair steps | - name: Run repair steps | ||||
run: | | run: | |
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | ||||
with: | with: | ||||
php-version: ${{ matrix.php-versions }} | php-version: ${{ matrix.php-versions }} | ||||
tools: phpunit:9 | |||||
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | ||||
env: | env: | ||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
with: | with: | ||||
php-version: ${{ matrix.php-versions }} | php-version: ${{ matrix.php-versions }} | ||||
extensions: ctype, curl, dom, fileinfo, gd, imagick, intl, json, mbstring, openssl, pdo_sqlite, posix, sqlite, xml, zip, apcu | extensions: ctype, curl, dom, fileinfo, gd, imagick, intl, json, mbstring, openssl, pdo_sqlite, posix, sqlite, xml, zip, apcu | ||||
tools: phpunit:9 | |||||
coverage: none | coverage: none | ||||
ini-file: development | ini-file: development | ||||
ini-values: | ini-values: | ||||
env: | env: | ||||
DB_PORT: 4444 | DB_PORT: 4444 | ||||
run: | | run: | | ||||
composer install | |||||
mkdir data | 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 | ./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 index.php | ||||
- name: PHPUnit | - name: PHPUnit | ||||
working-directory: tests | |||||
run: phpunit --configuration phpunit-autotest.xml --exclude-group PRIMARY-azure,PRIMARY-s3,PRIMARY-swift,Memcached,Redis,RoutingWeirdness | |||||
run: composer run test -- --exclude-group PRIMARY-azure,PRIMARY-s3,PRIMARY-swift,Memcached,Redis,RoutingWeirdness |
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | ||||
with: | with: | ||||
php-version: ${{ matrix.php-versions }} | php-version: ${{ matrix.php-versions }} | ||||
tools: phpunit:9 | |||||
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | ||||
env: | env: | ||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||
- name: Set up Nextcloud | - name: Set up Nextcloud | ||||
run: | | run: | | ||||
composer install | |||||
mkdir data | mkdir data | ||||
./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 | ./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 | ||||
./occ app:enable --force ${{ env.APP_NAME }} | ./occ app:enable --force ${{ env.APP_NAME }} | ||||
- name: PHPUnit | - name: PHPUnit | ||||
run: | | run: | | ||||
echo "<?php return ['run' => true, 'secret' => 'actually-not-secret', 'passwordsalt' => 'actually-not-secret', 'hostname' => 'localhost','key' => 'minio','secret' => 'minio123', 'bucket' => 'bucket', 'port' => 9000, 'use_ssl' => false, 'autocreate' => true, 'use_path_style' => true];" > apps/${{ env.APP_NAME }}/tests/config.amazons3.php | echo "<?php return ['run' => true, 'secret' => 'actually-not-secret', 'passwordsalt' => 'actually-not-secret', 'hostname' => 'localhost','key' => 'minio','secret' => 'minio123', 'bucket' => 'bucket', 'port' => 9000, 'use_ssl' => false, 'autocreate' => true, 'use_path_style' => true];" > apps/${{ env.APP_NAME }}/tests/config.amazons3.php | ||||
phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/Amazons3Test.php | |||||
phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/VersionedAmazonS3Test.php | |||||
composer run test:files_external apps/files_external/tests/Storage/Amazons3Test.php | |||||
composer run test:files_external apps/files_external/tests/Storage/VersionedAmazonS3Test.php | |||||
- name: S3 logs | - name: S3 logs | ||||
if: always() | if: always() | ||||
run: | | run: | | ||||
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | ||||
with: | with: | ||||
php-version: ${{ matrix.php-versions }} | php-version: ${{ matrix.php-versions }} | ||||
tools: phpunit:9 | |||||
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | ||||
env: | env: | ||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||
- name: Set up Nextcloud | - name: Set up Nextcloud | ||||
run: | | run: | | ||||
composer install | |||||
mkdir data | mkdir data | ||||
./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 | ./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 | ||||
./occ app:enable --force ${{ env.APP_NAME }} | ./occ app:enable --force ${{ env.APP_NAME }} | ||||
- name: PHPUnit | - name: PHPUnit | ||||
run: | | run: | | ||||
echo "<?php return ['run' => true,'hostname' => 'localhost','key' => 'ignored','secret' => 'ignored', 'bucket' => 'bucket', 'port' => 4566, 'use_ssl' => false, 'autocreate' => true, 'use_path_style' => true];" > apps/${{ env.APP_NAME }}/tests/config.amazons3.php | echo "<?php return ['run' => true,'hostname' => 'localhost','key' => 'ignored','secret' => 'ignored', 'bucket' => 'bucket', 'port' => 4566, 'use_ssl' => false, 'autocreate' => true, 'use_path_style' => true];" > apps/${{ env.APP_NAME }}/tests/config.amazons3.php | ||||
phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/Amazons3Test.php | |||||
phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/VersionedAmazonS3Test.php | |||||
composer run test:files_external apps/files_external/tests/Storage/Amazons3Test.php | |||||
composer run test:files_external apps/files_external/tests/Storage/VersionedAmazonS3Test.php | |||||
- name: S3 logs | - name: S3 logs | ||||
if: always() | if: always() | ||||
run: | | run: | |
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | ||||
with: | with: | ||||
php-version: ${{ matrix.php-versions }} | php-version: ${{ matrix.php-versions }} | ||||
tools: phpunit:9 | |||||
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd, redis | extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd, redis | ||||
env: | env: | ||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | ||||
with: | with: | ||||
php-version: ${{ matrix.php-versions }} | php-version: ${{ matrix.php-versions }} | ||||
tools: phpunit:9 | |||||
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | ||||
env: | env: | ||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||
- name: Set up Nextcloud | - name: Set up Nextcloud | ||||
run: | | run: | | ||||
composer install | |||||
mkdir data | mkdir data | ||||
echo '<?php $CONFIG=["${{ matrix.key }}" => ["class" => "OC\Files\ObjectStore\S3", "arguments" => ["bucket" => "nextcloud", "autocreate" => true, "key" => "minio", "secret" => "minio123", "hostname" => "localhost", "port" => 9000, "use_ssl" => false, "use_path_style" => true, "uploadPartSize" => 52428800]]];' > config/config.php | echo '<?php $CONFIG=["${{ matrix.key }}" => ["class" => "OC\Files\ObjectStore\S3", "arguments" => ["bucket" => "nextcloud", "autocreate" => true, "key" => "minio", "secret" => "minio123", "hostname" => "localhost", "port" => 9000, "use_ssl" => false, "use_path_style" => true, "uploadPartSize" => 52428800]]];' > 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 | ./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 | ||||
curl -f -m 1 --retry-connrefused --retry 10 --retry-delay 10 http://localhost:9000/minio/health/ready | curl -f -m 1 --retry-connrefused --retry 10 --retry-delay 10 http://localhost:9000/minio/health/ready | ||||
- name: PHPUnit | - name: PHPUnit | ||||
working-directory: tests | |||||
run: phpunit --configuration phpunit-autotest.xml --group DB,SLOWDB | |||||
run: composer run test:db | |||||
- name: S3 logs | - name: S3 logs | ||||
if: always() | if: always() | ||||
run: | | run: | |
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 | ||||
with: | with: | ||||
php-version: ${{ matrix.php-versions }} | php-version: ${{ matrix.php-versions }} | ||||
tools: phpunit:9 | |||||
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | ||||
env: | env: | ||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||
- name: Set up Nextcloud | - name: Set up Nextcloud | ||||
run: | | run: | | ||||
composer install | |||||
mkdir data | mkdir data | ||||
./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 | ./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 | ||||
./occ app:enable --force ${{ env.APP_NAME }} | ./occ app:enable --force ${{ env.APP_NAME }} | ||||
- name: PHPUnit | - name: PHPUnit | ||||
run: | | run: | | ||||
echo "<?php return ['run' => true, 'host' => 'localhost:2222','user' => 'test','password' => 'test', 'root' => 'data'];" > apps/${{ env.APP_NAME }}/tests/config.sftp.php | echo "<?php return ['run' => true, 'host' => 'localhost:2222','user' => 'test','password' => 'test', 'root' => 'data'];" > apps/${{ env.APP_NAME }}/tests/config.sftp.php | ||||
phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/SftpTest.php | |||||
composer run test:files_external apps/files_external/tests/Storage/SftpTest.php | |||||
- name: sftpd logs | - name: sftpd logs | ||||
if: always() | if: always() | ||||
run: | | run: | |
"lint": "find . -name \\*.php -not -path './lib/composer/*' -not -path './build/stubs/*' -print0 | xargs -0 -n1 php -l", | "lint": "find . -name \\*.php -not -path './lib/composer/*' -not -path './build/stubs/*' -print0 | xargs -0 -n1 php -l", | ||||
"psalm": "psalm --no-cache --threads=$(nproc)", | "psalm": "psalm --no-cache --threads=$(nproc)", | ||||
"psalm:ci": "psalm --no-cache --threads=1", | "psalm:ci": "psalm --no-cache --threads=1", | ||||
"psalm:update-baseline": "psalm --no-cache --threads=$(nproc) --update-baseline" | |||||
"psalm:update-baseline": "psalm --no-cache --threads=$(nproc) --update-baseline", | |||||
"test": "phpunit --configuration tests/phpunit-autotest.xml", | |||||
"test:db": "@composer run test -- --group DB,SLOWDB", | |||||
"test:files_external": "phpunit --configuration tests/phpunit-autotest-external.xml" | |||||
} | } | ||||
} | } |
OC_Hook::clear(); | OC_Hook::clear(); | ||||
set_include_path(get_include_path() . PATH_SEPARATOR . '/usr/share/php'); | |||||
set_include_path( | |||||
get_include_path() . PATH_SEPARATOR | |||||
. '/usr/share/php' . PATH_SEPARATOR | |||||
. __DIR__ . '/..' | |||||
); |
timeoutForMediumTests="900" | timeoutForMediumTests="900" | ||||
timeoutForLargeTests="900" | timeoutForLargeTests="900" | ||||
convertDeprecationsToExceptions="true" | convertDeprecationsToExceptions="true" | ||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> | |||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"> | |||||
<testsuite name="ownCloud"> | <testsuite name="ownCloud"> | ||||
<directory suffix=".php">lib/</directory> | <directory suffix=".php">lib/</directory> | ||||
<directory suffix=".php">Core/</directory> | <directory suffix=".php">Core/</directory> |
{ | |||||
"config": { | |||||
"sort-packages": true, | |||||
"platform": { | |||||
"php": "8.0" | |||||
} | |||||
}, | |||||
"require": { | |||||
"phpunit/phpunit": "9.6" | |||||
} | |||||
} |