Skip to content

Commit 1052836

Browse files
committed
chore: consolidate test files into /tests directory
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 1ac195d commit 1052836

861 files changed

Lines changed: 49 additions & 46 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/integration-s3-primary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
110110
- name: Integration
111111
run: |
112-
cd build/integration
112+
cd tests/integration
113113
bash run.sh --tags "~@failure-s3" dav_features/webdav-related.feature
114114
115115
- name: S3 logs

.github/workflows/integration-sqlite.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,16 @@ jobs:
2626
with:
2727
filters: |
2828
src:
29-
- '.github/workflows/**'
29+
- '.github/workflows/integration-sqlite.yml'
3030
- '3rdparty/**'
31-
- '**/*.php'
32-
- '**/lib/**'
33-
- '**/tests/**'
34-
- '**/vendor-bin/**'
35-
- 'build/integration/**'
36-
- '.php-cs-fixer.dist.php'
31+
- 'apps/*/lib/**'
32+
- 'core/**.php'
33+
- 'core/shipped.json'
34+
- 'lib/**'
35+
- 'tests/integration/**'
36+
- '**/vendor*/**'
3737
- 'composer.json'
3838
- 'composer.lock'
39-
- 'core/shipped.json'
4039
4140
integration-sqlite:
4241
runs-on: ubuntu-latest
@@ -163,7 +162,7 @@ jobs:
163162
./occ config:system:set memcache.distributed --value='\OC\Memcache\Redis'
164163
165164
- name: Run integration
166-
working-directory: build/integration
165+
working-directory: tests/integration
167166
env:
168167
LDAP_HOST: localhost
169168
run: bash run.sh ${{ matrix.test-suite }} no-tail-log

autotest-external.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,16 @@ function execute_tests {
9595
# back to root folder
9696
cd "$BASEDIR"
9797

98-
# revert changes to tests/data
99-
git checkout tests/data
98+
# revert changes to tests/fixtures/data
99+
git checkout tests/fixtures/data
100100

101101
# reset data directory
102102
rm -rf "$DATADIR"
103103
mkdir "$DATADIR"
104104

105105
# remove the old config file
106106
#rm -rf config/config.php
107-
cp tests/preseed-config.php config/config.php
107+
cp tests/fixtures/preseed-config.php config/config.php
108108

109109
# drop database
110110
if [ "$1" == "mysql" ] ; then
@@ -141,7 +141,7 @@ EOF
141141
fi
142142

143143
# copy autoconfig
144-
cp "$BASEDIR/tests/autoconfig-$1.php" "$BASEDIR/config/autoconfig.php"
144+
cp "$BASEDIR/tests/fixtures/autoconfig-$1.php" "$BASEDIR/config/autoconfig.php"
145145

146146
# trigger installation
147147
echo "Installing ...."

autotest.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function print_syntax {
5353
echo -e "\t\"dbconfigname\" can be one of: $DBCONFIGS" >&2
5454
echo -e "\t\"testfile\" is the name of a test file, for example lib/template.php" >&2
5555
echo -e "\nExample: ./autotest.sh sqlite lib/template.php" >&2
56-
echo "will run the test suite from \"tests/lib/template.php\"" >&2
56+
echo "will run the test suite from \"tests/unit/lib/template.php\"" >&2
5757
echo -e "\nIf no arguments are specified, all tests will be run with all database configs" >&2
5858
}
5959

@@ -181,8 +181,8 @@ function execute_tests {
181181
# back to root folder
182182
cd "$BASEDIR"
183183

184-
# revert changes to tests/data
185-
git checkout tests/data
184+
# revert changes to tests/fixtures/data
185+
git checkout tests/fixtures/data
186186

187187
# reset data directory
188188
rm -rf "$DATADIR"
@@ -192,12 +192,12 @@ function execute_tests {
192192
tests/objectstore/start-swift-ceph.sh
193193
cp tests/objectstore/swift.config.php config/autotest-storage-swift.config.php
194194
fi
195-
cp tests/preseed-config.php config/config.php
195+
cp tests/fixtures/preseed-config.php config/config.php
196196

197197
if [ "$ENABLE_REDIS" == "true" ] ; then
198-
cp tests/redis.config.php config/redis.config.php
198+
cp tests/fixtures/redis.config.php config/redis.config.php
199199
elif [ "$ENABLE_REDIS_CLUSTER" == "true" ] ; then
200-
cp tests/redis-cluster.config.php config/redis.config.php
200+
cp tests/fixtures/redis-cluster.config.php config/redis.config.php
201201
fi
202202

203203
_DB=$DB
@@ -207,7 +207,7 @@ function execute_tests {
207207
if [ ! -z "$USEDOCKER" ] ; then
208208
echo "Fire up the mysql docker"
209209
DOCKER_CONTAINER_ID=$(docker run \
210-
-v $BASEDIR/tests/docker/mariadb:/etc/mysql/conf.d \
210+
-v $BASEDIR/tests/fixtures/docker/mariadb:/etc/mysql/conf.d \
211211
-e MYSQL_ROOT_PASSWORD=owncloud \
212212
-e MYSQL_USER="$DATABASEUSER" \
213213
-e MYSQL_PASSWORD=owncloud \
@@ -233,7 +233,7 @@ function execute_tests {
233233
if [ ! -z "$USEDOCKER" ] ; then
234234
echo "Fire up the mysql docker"
235235
DOCKER_CONTAINER_ID=$(docker run \
236-
-v $BASEDIR/tests/docker/mysqlmb4:/etc/mysql/conf.d \
236+
-v $BASEDIR/tests/fixtures/docker/mysqlmb4:/etc/mysql/conf.d \
237237
-e MYSQL_ROOT_PASSWORD=owncloud \
238238
-e MYSQL_USER="$DATABASEUSER" \
239239
-e MYSQL_PASSWORD=owncloud \
@@ -265,13 +265,13 @@ function execute_tests {
265265
echo "MySQL(utf8mb4) is up."
266266
_DB="mysql"
267267

268-
cp tests/docker/mysqlmb4.config.php config
268+
cp tests/fixtures/docker/mysqlmb4.config.php config
269269
fi
270270
if [ "$DB" == "mariadb" ] ; then
271271
if [ ! -z "$USEDOCKER" ] ; then
272272
echo "Fire up the mariadb docker"
273273
DOCKER_CONTAINER_ID=$(docker run \
274-
-v $BASEDIR/tests/docker/mariadb:/etc/mysql/conf.d \
274+
-v $BASEDIR/tests/fixtures/docker/mariadb:/etc/mysql/conf.d \
275275
-e MYSQL_ROOT_PASSWORD=owncloud \
276276
-e MYSQL_USER="$DATABASEUSER" \
277277
-e MYSQL_PASSWORD=owncloud \
@@ -420,7 +420,7 @@ if [ -z "$1" ]
420420
done
421421
else
422422
FILENAME="$2"
423-
if [ ! -z "$2" ] && [ ! -f "tests/$FILENAME" ] && [ "${FILENAME:0:2}" != "--" ]; then
423+
if [ ! -z "$2" ] && [ ! -f "tests/unit/$FILENAME" ] && [ "${FILENAME:0:2}" != "--" ]; then
424424
FILENAME="../$FILENAME"
425425
fi
426426
execute_tests "$1" "$FILENAME" "$3"

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@
7878
],
7979
"test": [
8080
"Composer\\Config::disableProcessTimeout",
81-
"phpunit --fail-on-warning --fail-on-risky --display-warnings --display-deprecations --display-phpunit-deprecations --display-skipped --colors=always --configuration tests/phpunit-autotest.xml"
81+
"phpunit --fail-on-warning --fail-on-risky --display-warnings --display-deprecations --display-phpunit-deprecations --display-skipped --colors=always --configuration tests/unit/phpunit-autotest.xml"
8282
],
8383
"test:db": "@composer run test -- --group DB --group SLOWDB --exclude-group S3 --exclude-group PRIMARY-swift --exclude-group PRIMARY-s3 --exclude-group PRIMARY-azure",
84-
"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",
84+
"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",
8585
"rector": "rector --config=build/rector.php && composer cs:fix",
8686
"rector:strict": "rector --config=build/rector-strict.php && composer cs:fix",
8787
"openapi": "./build/openapi-checker.sh"

tests/apps/testapp_dependency_missing/appinfo/info.xml renamed to tests/fixtures/apps/testapp_dependency_missing/appinfo/info.xml

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)