Skip to content

Add make lint and make test targets #2722

@marienfressinaud

Description

@marienfressinaud

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 ./tests

I 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? :)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions