Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update PHPUnit tests #649

Merged
merged 3 commits into from
Sep 2, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/phpunit-sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ jobs:
matrix:
php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
include:
- php-versions: '8.2'
server-versions: master
coverage: true

name: SQLite PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}

Expand Down Expand Up @@ -95,7 +99,7 @@ jobs:
php-version: ${{ matrix.php-versions }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
coverage: none
coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -131,7 +135,17 @@ jobs:
# Only run if phpunit config file exists
if: steps.check_phpunit.outcome == 'success'
working-directory: apps/${{ env.APP_NAME }}
run: composer run test:unit
run: composer run test:unit${{ matrix.coverage && ':coverage' }}

- name: Upload Unit coverage
if: matrix.coverage == true
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
root_dir: ./apps/${{ env.APP_NAME }}
files: ./apps/${{ env.APP_NAME }}/tests/clover.unit.xml
fail_ci_if_error: false

- name: Check PHPUnit integration script is defined
id: check_integration
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: CC0-1.0

/vendor/
**/vendor/
/.php-cs-fixer.cache

node_modules/
Expand Down
29 changes: 17 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,30 @@
"optimize-autoloader": true,
"classmap-authoritative": true,
"platform": {
"php": "8.0"
"php": "8.1"
},
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
},
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": true
}
},
"scripts": {
"post-install-cmd": [
"@composer bin phpunit install --ansi"
],
"cs:fix": "php-cs-fixer fix",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
"test:unit": "vendor/bin/phpunit -c tests/phpunit.xml"

"test:unit": "phpunit -c tests/phpunit.xml --no-coverage",
"test:unit:coverage": "phpunit -c tests/phpunit.xml"
},
"require-dev": {
"christophwurst/nextcloud_testing": "^1.0.0",
"nextcloud/coding-standard": "^1.0.0",
"nextcloud/ocp": "dev-master",
"phpunit/phpunit": "^9.5"
},
"autoload-dev": {
"psr-4": {
"OCP\\": "vendor/nextcloud/ocp/OCP"
}
"nextcloud/coding-standard": "^1.2",
"bamarni/composer-bin-plugin": "^1.8"
}
}
Loading
Loading