mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-28 14:08:45 -04:00
* Slightly more robust SessionTest and cleanup Improvement of #9311 I noticed that my `/tmp` directory got filled up with random `sess_*` files and empty `frss_test_sessions_*` directories after repeatedly running PHPUnit, which means there was no proper cleanup being done in the tests. See the first commit for changes, since I also moved the test to a more appropriate directory name (alongside `tests/lib/Minz`, `tests/app/Minz` was newly added in #9311). Before the PR: * Check output of `ls -lah /tmp/{frss_test_sessions_*,sess_*}; rm -r /tmp/{frss_test_sessions_*,sess_*}` to confirm there are initially no temporary files existing. * Run `composer run phpunit`. * Check output of the previous command again to confirm there is a new `sess_*` file and an empty `frss_test_sessions_*` directory. After the PR: * Check output of `ls -lah /tmp/{frss_test_sessions_*,sess_*}; rm -r /tmp/{frss_test_sessions_*,sess_*}` to confirm that no temporary files exist initially. * Run `composer run phpunit`. * Check output of the previous command again to confirm there are no temporary files, since they are now being cleaned up correctly. * Move SessionTest from tests/app/Minz to tests/lib/Minz
FreshRSS tests
See our documentation about running tests.
make test-all
See test.yml for the GitHub Actions automated tests.
See composer.json for the different tests and versions, to be run locally.
Details about this tests folder
Unit tests are based on PHPUnit. Here is an example of manual install:
cd ./tests/
wget -O phpunit.phar https://phar.phpunit.de/phpunit-10.phar
php phpunit.phar --bootstrap bootstrap.php
The shellchecks.sh script is used to safeguard shell scripts from common
shell script bugs and to ensure a consistent style.
It requires ShellCheck and shfmt.