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

Switch to phpunit #17355

Merged
merged 15 commits into from
Jul 3, 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: 18 additions & 0 deletions .github/actions/test_tests-phpunit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -e -u -x -o pipefail

PHPUNIT_ADDITIONNAL_OPTIONS=""
if [[ "$CODE_COVERAGE" = true ]]; then
export COVERAGE_DIR="coverage-functional"
PHPUNIT_ADDITIONNAL_OPTIONS="--coverage-filter src --coverage-clover phpunit/$COVERAGE_DIR/clover.xml"

else
PHPUNIT_ADDITIONNAL_OPTIONS="--no-coverage";
fi

#temporary hack to prevent dual configuration
ln -s ../tests/config/ phpunit/

vendor/bin/phpunit $PHPUNIT_ADDITIONNAL_OPTIONS

unset COVERAGE_DIR
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ jobs:
run: |
.github/actions/init_initialize-9.5-db.sh
docker compose exec -T app .github/actions/test_update-from-9.5.sh
- name: "PHPUnit tests"
if: env.skip != 'true'
run: |
docker compose exec -T app .github/actions/test_tests-phpunit.sh
- name: "Functional tests"
if: "${{ env.skip != 'true' && (success() || failure()) }}"
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
- name: "Install database"
run: |
docker compose exec -T app .github/actions/test_install.sh
- name: "PHPUnit tests"
run: |
docker compose exec -T app .github/actions/test_tests-phpunit.sh
- name: "Functional tests"
run: |
docker compose exec -T app .github/actions/test_tests-functional.sh
Expand All @@ -77,5 +80,5 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./tests/coverage-functional/clover.xml,./tests/coverage-ldap/clover.xml,./tests/coverage-imap/clover.xml
files: ./phpunit/coverage-functional/clover.xml,./tests/coverage-functional/clover.xml,./tests/coverage-ldap/clover.xml,./tests/coverage-imap/clover.xml
override_branch: ${{ inputs.branch }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ phpunit.xml
/inc/downstream.php
/docker-compose.override.yaml
/.devcontainer/docker-compose.override.yaml
/.phpunit.result.cache
/phpunit/files/
/phpunit/config
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^1.11",
"phpstan/phpstan-deprecation-rules": "^1.2",
"phpunit/phpunit": "^9.6",
"squizlabs/php_codesniffer": "^3.10",
"symfony/browser-kit": "^5.4",
"symfony/http-client": "^5.4",
Expand Down
Loading