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

[#1453] Replaced Xdebug with PCOV for coverage. #1466

Merged
merged 1 commit into from
Dec 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
5 changes: 1 addition & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,7 @@ jobs:

- run:
name: Test with PHPUnit
command: |
XDEBUG_ENABLE=true docker compose up -d cli php nginx # Restart stack with XDEBUG enabled for coverage.
docker compose exec -T -e XDEBUG_MODE=coverage cli vendor/bin/phpunit || [ "${VORTEX_CI_PHPUNIT_IGNORE_FAILURE:-0}" -eq 1 ]
docker compose up -d cli php nginx # Restart stack without XDEBUG enabled for coverage.
command: docker compose exec -T cli vendor/bin/phpunit || [ "${VORTEX_CI_PHPUNIT_IGNORE_FAILURE:-0}" -eq 1 ]

- run:
name: Test with Behat
Expand Down
5 changes: 4 additions & 1 deletion .docker/cli.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ ENV WEBROOT=${WEBROOT} \
# reduce build time.

# Adding more tools.
RUN apk add --no-cache ncurses pv tzdata
RUN apk add --no-cache ncurses pv tzdata autoconf g++ make \
&& pecl install pcov \
&& docker-php-ext-enable pcov \
&& apk del g++ make autoconf

# Adding patches and scripts.
COPY patches /app/patches
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,7 @@ jobs:
timeout-minutes: 30

- name: Test with PHPUnit
run: |
XDEBUG_ENABLE=true docker compose up -d cli php nginx # Restart stack with XDEBUG enabled for coverage.
docker compose exec -T -e XDEBUG_MODE=coverage cli vendor/bin/phpunit
docker compose up -d cli php nginx # Restart stack without XDEBUG enabled for coverage.
run: docker compose exec -T cli vendor/bin/phpunit
continue-on-error: ${{ vars.VORTEX_CI_PHPUNIT_IGNORE_FAILURE == '1' }}

- name: Test with Behat
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/vortex-test-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: pcov
ini-values: pcov.directory=.

- name: Install dependencies
run: composer install
Expand All @@ -36,7 +38,7 @@ jobs:
working-directory: .vortex/installer

- name: Run tests
run: XDEBUG_MODE=coverage composer test
run: composer test
working-directory: .vortex/installer

- name: Upload coverage report as an artifact
Expand Down
6 changes: 0 additions & 6 deletions .vortex/docs/content/tools/phpunit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,6 @@ automated coverage assessment, and in `.logs/coverage/phpunit/.coverage-html` as
HTML coverage report, useful for visual report assessment during test
development.

The tests need to run with `XDEBUG_MODE=coverage` environment variable set.

```shell
XDEBUG_MODE=coverage cli vendor/bin/phpunit
```

CI runs tests with coverage by default and stores the reports as artifacts.

### Ignoring lines from coverage
Expand Down
Loading