From bd48aebc93facc42040bb6872420b21756927e76 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 4 Apr 2022 09:42:14 +0200 Subject: [PATCH 1/4] Update master php testing versions Signed-off-by: Joas Schilling --- .github/workflows/lint.yml | 2 +- .github/workflows/phpunit.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b21df917..0272d0c1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - php-versions: ['7.4', '8.0'] + php-versions: ['7.4', '8.0', "8.1"] name: php${{ matrix.php-versions }} steps: diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 9c6a9951..c9b0a5af 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -71,7 +71,7 @@ jobs: # do not stop on another job's failure fail-fast: false matrix: - php-versions: ['7.4', '8.0'] + php-versions: ['7.4', '8.0', "8.1"] databases: ['mysql'] server-versions: ['master'] From 5a46b1c69f15905af607f7805346774ef8d93ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 4 Apr 2022 11:16:43 +0200 Subject: [PATCH 2/4] Align phpunit.yml with other applications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- .github/workflows/phpunit.yml | 58 ++++++++++++++++++++++------------- tests/{unit => }/phpunit.xml | 4 +-- 2 files changed, 39 insertions(+), 23 deletions(-) rename tests/{unit => }/phpunit.xml (81%) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index c9b0a5af..386003cd 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -22,7 +22,7 @@ jobs: databases: ['sqlite'] server-versions: ['master'] - name: php${{ matrix.php-versions }}-${{ matrix.databases }} + name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} steps: - name: Checkout server @@ -47,22 +47,26 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} + tools: phpunit extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite - tools: phpunit:8.5.13 coverage: none + - name: Set up PHPUnit + working-directory: apps/${{ env.APP_NAME }} + run: composer i + - name: Set up Nextcloud env: DB_PORT: 4444 run: | mkdir data ./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password - php -f index.php ./occ app:enable --force ${{ env.APP_NAME }} + php -S localhost:8080 & - name: PHPUnit - working-directory: apps/${{ env.APP_NAME }}/tests/unit - run: phpunit -c phpunit.xml + working-directory: apps/${{ env.APP_NAME }}/tests + run: ../vendor/bin/phpunit -c phpunit.xml mysql: runs-on: ubuntu-latest @@ -71,11 +75,11 @@ jobs: # do not stop on another job's failure fail-fast: false matrix: - php-versions: ['7.4', '8.0', "8.1"] + php-versions: ['7.4', '8.0', '8.1'] databases: ['mysql'] server-versions: ['master'] - name: php${{ matrix.php-versions }}-${{ matrix.databases }} + name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} services: mysql: @@ -109,22 +113,26 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: mbstring, iconv, fileinfo, intl, mysql, pdo_mysql - tools: phpunit:8.5.13 + tools: phpunit + extensions: mbstring, iconv, fileinfo, intl, mysql, pdo_mysql, zip, gd coverage: none + - name: Set up PHPUnit + working-directory: apps/${{ env.APP_NAME }} + run: composer i + - name: Set up Nextcloud env: DB_PORT: 4444 run: | mkdir data ./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password - php -f index.php ./occ app:enable --force ${{ env.APP_NAME }} + php -S localhost:8080 & - name: PHPUnit - working-directory: apps/${{ env.APP_NAME }}/tests/unit - run: phpunit -c phpunit.xml + working-directory: apps/${{ env.APP_NAME }}/tests + run: ../vendor/bin/phpunit -c phpunit.xml pgsql: runs-on: ubuntu-latest @@ -137,7 +145,7 @@ jobs: databases: ['pgsql'] server-versions: ['master'] - name: php${{ matrix.php-versions }}-${{ matrix.databases }} + name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} services: postgres: @@ -173,22 +181,26 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} + tools: phpunit extensions: mbstring, iconv, fileinfo, intl, pgsql, pdo_pgsql - tools: phpunit:8.5.13 coverage: none + - name: Set up PHPUnit + working-directory: apps/${{ env.APP_NAME }} + run: composer i + - name: Set up Nextcloud env: DB_PORT: 4444 run: | mkdir data ./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password - php -f index.php ./occ app:enable --force ${{ env.APP_NAME }} + php -S localhost:8080 & - name: PHPUnit - working-directory: apps/${{ env.APP_NAME }}/tests/unit - run: phpunit -c phpunit.xml + working-directory: apps/${{ env.APP_NAME }}/tests + run: ../vendor/bin/phpunit -c phpunit.xml oci: runs-on: ubuntu-latest @@ -201,7 +213,7 @@ jobs: databases: ['oci'] server-versions: ['master'] - name: php${{ matrix.php-versions }}-${{ matrix.databases }} + name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} services: oracle: @@ -233,9 +245,13 @@ jobs: with: php-version: ${{ matrix.php-versions }} extensions: mbstring, iconv, fileinfo, intl, oci8 - tools: phpunit:8.5.13 + tools: phpunit coverage: none + - name: Set up PHPUnit + working-directory: apps/${{ env.APP_NAME }} + run: composer i + - name: Set up Nextcloud run: | mkdir data @@ -244,5 +260,5 @@ jobs: ./occ app:enable --force ${{ env.APP_NAME }} - name: PHPUnit - working-directory: apps/${{ env.APP_NAME }}/tests/unit - run: phpunit -c phpunit.xml + working-directory: apps/${{ env.APP_NAME }}/tests + run: ../vendor/bin/phpunit -c phpunit.xml diff --git a/tests/unit/phpunit.xml b/tests/phpunit.xml similarity index 81% rename from tests/unit/phpunit.xml rename to tests/phpunit.xml index f246d3f4..2274197b 100644 --- a/tests/unit/phpunit.xml +++ b/tests/phpunit.xml @@ -12,9 +12,9 @@ - ../../../impersonate + ../../impersonate - ../../../impersonate/tests + ../../impersonate/tests From f1672633731b812552012b532c22c661e90914b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 4 Apr 2022 11:23:21 +0200 Subject: [PATCH 3/4] Add phpunit to require-dev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 22673b20..0df69ae5 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ "lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l" }, "require-dev": { + "phpunit/phpunit": "^9.5", "nextcloud/coding-standard": "^0.5.0", "christophwurst/nextcloud": "dev-master" } From bd1f7b2b1f0690523a176bb57770eb5655e29f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 4 Apr 2022 11:31:38 +0200 Subject: [PATCH 4/4] Fix bootstrap path in phpunit.xml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- tests/phpunit.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit.xml b/tests/phpunit.xml index 2274197b..92f058a7 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -1,5 +1,5 @@ -