Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/integration-s3-primary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
- name: Integration
run: |
cd build/integration
cd tests/integration
bash run.sh --tags "~@failure-s3" dav_features/webdav-related.feature
- name: S3 logs
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/integration-sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,16 @@ jobs:
with:
filters: |
src:
- '.github/workflows/**'
- '.github/workflows/integration-sqlite.yml'
- '3rdparty/**'
- '**/*.php'
- '**/lib/**'
- '**/tests/**'
- '**/vendor-bin/**'
- 'build/integration/**'
- '.php-cs-fixer.dist.php'
- 'apps/*/lib/**'
- 'core/**.php'
- 'core/shipped.json'
- 'lib/**'
- 'tests/integration/**'
- '**/vendor*/**'
- 'composer.json'
- 'composer.lock'
- 'core/shipped.json'

integration-sqlite:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -163,7 +162,7 @@ jobs:
./occ config:system:set memcache.distributed --value='\OC\Memcache\Redis'

- name: Run integration
working-directory: build/integration
working-directory: tests/integration
env:
LDAP_HOST: localhost
run: bash run.sh ${{ matrix.test-suite }} no-tail-log
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/object-storage-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
run: |
composer install
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
cp tests/fixtures/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
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 @@ -103,7 +103,7 @@ jobs:
run: |
composer install
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
cp tests/fixtures/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

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 @@ -99,7 +99,7 @@ jobs:
run: |
composer install
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
cp tests/fixtures/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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
run: |
mkdir data
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
cp tests/fixtures/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
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 @@ -94,7 +94,7 @@ jobs:
- name: Set up Nextcloud
run: |
mkdir data
cp tests/preseed-config.php config/config.php
cp tests/fixtures/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
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 @@ -158,7 +158,7 @@ jobs:
run: |
mkdir data
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
cp tests/fixtures/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
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 @@ -120,7 +120,7 @@ jobs:
run: |
mkdir data
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
cp tests/fixtures/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
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 @@ -99,7 +99,7 @@ jobs:
run: |
mkdir data
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
cp tests/fixtures/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
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:
run: |
composer install
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
cp tests/fixtures/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
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 @@ -120,7 +120,7 @@ jobs:
run: |
mkdir data
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
cp tests/fixtures/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
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 @@ -114,7 +114,7 @@ jobs:
run: |
mkdir data
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
cp tests/fixtures/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
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 @@ -101,7 +101,7 @@ jobs:
run: |
mkdir data
cp tests/redis.config.php config/
cp tests/preseed-config.php config/config.php
cp tests/fixtures/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
Expand Down
8 changes: 4 additions & 4 deletions autotest-external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,16 @@ function execute_tests {
# back to root folder
cd "$BASEDIR"

# revert changes to tests/data
git checkout tests/data
# revert changes to tests/fixtures/data
git checkout tests/fixtures/data

# reset data directory
rm -rf "$DATADIR"
mkdir "$DATADIR"

# remove the old config file
#rm -rf config/config.php
cp tests/preseed-config.php config/config.php
cp tests/fixtures/preseed-config.php config/config.php

# drop database
if [ "$1" == "mysql" ] ; then
Expand Down Expand Up @@ -141,7 +141,7 @@ EOF
fi

# copy autoconfig
cp "$BASEDIR/tests/autoconfig-$1.php" "$BASEDIR/config/autoconfig.php"
cp "$BASEDIR/tests/fixtures/autoconfig-$1.php" "$BASEDIR/config/autoconfig.php"

# trigger installation
echo "Installing ...."
Expand Down
22 changes: 11 additions & 11 deletions autotest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function print_syntax {
echo -e "\t\"dbconfigname\" can be one of: $DBCONFIGS" >&2
echo -e "\t\"testfile\" is the name of a test file, for example lib/template.php" >&2
echo -e "\nExample: ./autotest.sh sqlite lib/template.php" >&2
echo "will run the test suite from \"tests/lib/template.php\"" >&2
echo "will run the test suite from \"tests/unit/lib/template.php\"" >&2
echo -e "\nIf no arguments are specified, all tests will be run with all database configs" >&2
}

Expand Down Expand Up @@ -181,8 +181,8 @@ function execute_tests {
# back to root folder
cd "$BASEDIR"

# revert changes to tests/data
git checkout tests/data
# revert changes to tests/fixtures/data
git checkout tests/fixtures/data

# reset data directory
rm -rf "$DATADIR"
Expand All @@ -192,12 +192,12 @@ function execute_tests {
tests/objectstore/start-swift-ceph.sh
cp tests/objectstore/swift.config.php config/autotest-storage-swift.config.php
fi
cp tests/preseed-config.php config/config.php
cp tests/fixtures/preseed-config.php config/config.php

if [ "$ENABLE_REDIS" == "true" ] ; then
cp tests/redis.config.php config/redis.config.php
cp tests/fixtures/redis.config.php config/redis.config.php
elif [ "$ENABLE_REDIS_CLUSTER" == "true" ] ; then
cp tests/redis-cluster.config.php config/redis.config.php
cp tests/fixtures/redis-cluster.config.php config/redis.config.php
fi

_DB=$DB
Expand All @@ -207,7 +207,7 @@ function execute_tests {
if [ ! -z "$USEDOCKER" ] ; then
echo "Fire up the mysql docker"
DOCKER_CONTAINER_ID=$(docker run \
-v $BASEDIR/tests/docker/mariadb:/etc/mysql/conf.d \
-v $BASEDIR/tests/fixtures/docker/mariadb:/etc/mysql/conf.d \
-e MYSQL_ROOT_PASSWORD=owncloud \
-e MYSQL_USER="$DATABASEUSER" \
-e MYSQL_PASSWORD=owncloud \
Expand All @@ -233,7 +233,7 @@ function execute_tests {
if [ ! -z "$USEDOCKER" ] ; then
echo "Fire up the mysql docker"
DOCKER_CONTAINER_ID=$(docker run \
-v $BASEDIR/tests/docker/mysqlmb4:/etc/mysql/conf.d \
-v $BASEDIR/tests/fixtures/docker/mysqlmb4:/etc/mysql/conf.d \
-e MYSQL_ROOT_PASSWORD=owncloud \
-e MYSQL_USER="$DATABASEUSER" \
-e MYSQL_PASSWORD=owncloud \
Expand Down Expand Up @@ -265,13 +265,13 @@ function execute_tests {
echo "MySQL(utf8mb4) is up."
_DB="mysql"

cp tests/docker/mysqlmb4.config.php config
cp tests/fixtures/docker/mysqlmb4.config.php config
fi
if [ "$DB" == "mariadb" ] ; then
if [ ! -z "$USEDOCKER" ] ; then
echo "Fire up the mariadb docker"
DOCKER_CONTAINER_ID=$(docker run \
-v $BASEDIR/tests/docker/mariadb:/etc/mysql/conf.d \
-v $BASEDIR/tests/fixtures/docker/mariadb:/etc/mysql/conf.d \
-e MYSQL_ROOT_PASSWORD=owncloud \
-e MYSQL_USER="$DATABASEUSER" \
-e MYSQL_PASSWORD=owncloud \
Expand Down Expand Up @@ -420,7 +420,7 @@ if [ -z "$1" ]
done
else
FILENAME="$2"
if [ ! -z "$2" ] && [ ! -f "tests/$FILENAME" ] && [ "${FILENAME:0:2}" != "--" ]; then
if [ ! -z "$2" ] && [ ! -f "tests/unit/$FILENAME" ] && [ "${FILENAME:0:2}" != "--" ]; then
FILENAME="../$FILENAME"
fi
execute_tests "$1" "$FILENAME" "$3"
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@
],
"test": [
"Composer\\Config::disableProcessTimeout",
"phpunit --fail-on-warning --fail-on-risky --display-warnings --display-deprecations --display-phpunit-deprecations --display-skipped --colors=always --configuration tests/phpunit-autotest.xml"
"phpunit --fail-on-warning --fail-on-risky --display-warnings --display-deprecations --display-phpunit-deprecations --display-skipped --colors=always --configuration tests/unit/phpunit-autotest.xml"
],
"test:db": "@composer run test -- --group DB --group SLOWDB --exclude-group S3 --exclude-group PRIMARY-swift --exclude-group PRIMARY-s3 --exclude-group PRIMARY-azure",
"test:files_external": "phpunit --fail-on-warning --fail-on-risky --display-warnings --display-deprecations --display-phpunit-deprecations --colors=always --configuration tests/phpunit-autotest-external.xml",
"test:files_external": "phpunit --fail-on-warning --fail-on-risky --display-warnings --display-deprecations --display-phpunit-deprecations --colors=always --configuration tests/unit/phpunit-autotest-external.xml",
"rector": "rector --config=build/rector.php && composer cs:fix",
"rector:strict": "rector --config=build/rector-strict.php && composer cs:fix",
"openapi": "./build/openapi-checker.sh"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions tests/fixtures/data/strängé filename (duplicate #2).txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added tests/fixtures/data/testimage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading