Skip to content

Commit

Permalink
Fixes Scrutinizer integration (mostly failing tests) (#682)
Browse files Browse the repository at this point in the history
* attempt to fix scrutinizer tests; also removing current workaround

* RawDataParserTest: marked a test as memory-heavy

because it keeps failing due to not enough memory:

https://scrutinizer-ci.com/g/smalot/pdfparser/inspections/2ffb5293-e8a3-422b-a726-48229a359df4

* .scrutinizer: fixed some config issues; added options to speed up checks

* at least 1 test keeps failing because of memory; attempt to increase memory in config

* try test again without memory-heave group
  • Loading branch information
k00ni authored Feb 27, 2024
1 parent 2939dfa commit ddf03ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
19 changes: 11 additions & 8 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
build:
cache:
directories:
- vendor # Cache for already installed composer package -> speed up composer install
nodes:
analysis:
environment:
php:
version: 8.2
ini:
memory_limit: "-1"
variables:
XDEBUG_MODE: 'coverage'
tests:
override:
- php-scrutinizer-run
-
# Forces a certain PHPUnit version (=7.5.x), otherwise some tests fail due
# to not enough memory.
# @https://github.com/smalot/pdfparser/issues/410
# @https://github.com/smalot/pdfparser/pull/412
command: make prepare-for-scrutinizer && make install-dev-tools && make run-phpunit ARGS="--exclude-group memory-heavy --coverage-clover coverage/clover.xml"
command: make install-dev-tools && make run-phpunit ARGS="--migrate-configuration" && make run-phpunit ARGS="--exclude-group memory-heavy --coverage-clover coverage/clover.xml"
coverage:
file: coverage/clover.xml
format: clover
environment:
php:
version: 7.4
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
install-dev-tools:
composer update --working-dir=dev-tools

# Workaround to force PHPUnit 7.5.x when running Scrutinizer.
# Scrutinizer fails due to not enough memory when using a newer PHPUnit version (tested with 9.5).
# @see: https://github.com/smalot/pdfparser/issues/410
# @see: https://github.com/smalot/pdfparser/pull/412
prepare-for-scrutinizer:
cd dev-tools && sed -e 's/>=7.5/^7.5/g' composer.json > composer.json2 && rm composer.json && mv composer.json2 composer.json

run-php-cs-fixer:
dev-tools/vendor/bin/php-cs-fixer fix $(ARGS)

Expand Down

0 comments on commit ddf03ea

Please sign in to comment.