Skip to content

Commit aa90639

Browse files
committed
fix(tests): Simplify error handling in tests/enable_all.php
Simply let the Exception bubble up instead of caching it and using grep to then detect it. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent 143bcf9 commit aa90639

14 files changed

Lines changed: 15 additions & 19 deletions

.github/workflows/object-storage-azure.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
cp tests/redis.config.php config/
100100
cp tests/preseed-config.php config/config.php
101101
./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
102-
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
102+
php -f tests/enable_all.php
103103
104104
- name: PHPUnit
105105
env:

.github/workflows/object-storage-s3.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
cp tests/redis.config.php config/
101101
cp tests/preseed-config.php config/config.php
102102
./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
103-
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
103+
php -f tests/enable_all.php
104104
105105
- name: Wait for S3
106106
run: |

.github/workflows/object-storage-swift.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
cp tests/redis.config.php config/
9797
cp tests/preseed-config.php config/config.php
9898
./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
99-
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
99+
php -f tests/enable_all.php
100100
101101
- name: PHPUnit
102102
env:

.github/workflows/phpunit-32bits.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
run: |
6666
mkdir data
6767
./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
68-
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
68+
php -f tests/enable_all.php
6969
7070
- name: PHPUnit
7171
run: composer run test -- --exclude-group PRIMARY-azure,PRIMARY-s3,PRIMARY-swift,Memcached,Redis,RoutingWeirdness

.github/workflows/phpunit-mariadb.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
cp tests/redis.config.php config/
123123
cp tests/preseed-config.php config/config.php
124124
./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
125-
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
125+
php -f tests/enable_all.php
126126
127127
- name: PHPUnit
128128
run: composer run test:db -- --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.db.xml' || '' }}

.github/workflows/phpunit-memcached.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
mkdir data
9797
cp tests/preseed-config.php config/config.php
9898
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
99-
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
99+
php -f tests/enable_all.php
100100
101101
- name: PHPUnit memcached tests
102102
run: composer run test -- --group Memcache,Memcached --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.xml' || '' }}

.github/workflows/phpunit-mysql-sharding.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ jobs:
154154
cp tests/redis.config.php config/
155155
cp tests/preseed-config.php config/config.php
156156
./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
157-
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
157+
php -f tests/enable_all.php
158158
159159
- name: PHPUnit
160160
run: composer run test:db -- --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.db.xml' || '' }}

.github/workflows/phpunit-mysql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
cp tests/redis.config.php config/
123123
cp tests/preseed-config.php config/config.php
124124
./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
125-
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
125+
php -f tests/enable_all.php
126126
127127
- name: PHPUnit
128128
run: composer run test:db -- --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.db.xml' || '' }}

.github/workflows/phpunit-nodb.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
cp tests/redis.config.php config/
103103
cp tests/preseed-config.php config/config.php
104104
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
105-
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
105+
php -f tests/enable_all.php
106106
107107
- name: PHPUnit nodb testsuite
108108
run: composer run test -- --exclude-group DB,SLOWDB --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.nodb.xml' || '' }}

.github/workflows/phpunit-object-store-primary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
cp tests/redis.config.php config/
9696
cp tests/preseed-config.php config/config.php
9797
./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
98-
php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
98+
php -f tests/enable_all.php
9999
100100
- name: Wait for S3
101101
run: |

0 commit comments

Comments
 (0)