-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add make lint and make test targets #2722
Copy link
Copy link
Closed
Description
While I was working on #2721, I tried to add a make lint and a make test targets but I don't know what could be the best solution. I wanted to run them in Docker since I don't have PHP installed directly on my machine and to ease contributions, but we need to install PHPUnit and PHP_CodeSniffer first. I see 4 options:
- since these programs are each contained in a single file, we could add them to the repository and add simple targets like that:
.PHONY: test
test: ## Run the test suite
docker run \
--rm \
--volume $(shell pwd):/var/www/FreshRSS:z \
--env FRESHRSS_ENV=test \
--name freshrss-test \
freshrss/freshrss:$(TAG) \
php ./bin/phpunit --bootstrap ./tests/bootstrap.php ./testsI don't like this solution because admins would download those files while it's only necessary for developers. Also, Alpine image doesn't work because it misses Phar extension. And it's a lot of new lines not related to FRSS!
- second option is to create a dedicated Docker image containing the programs used in test mode, maybe lighter and based on a PHP image instead of a FreshRSS one
- introduce Composer so we add it to the FRSS images and we can use it to install PHPUnit and PHP_CodeSniffer
- last option is to keep things as they are and let people install the programs by themselves. It's a bit unfriendly for newcomers
I see no "perfect" solutions and each has its drawbacks. Maybe someone can enlight my thougts? :)
Reactions are currently unavailable