Bonjour à tous
afin de tester vos packages d’application Yunohost, un script de tests unitaires a été développé.
Ce script permet de vérifier que le package s’installe sans erreur dans différentes configuration.
- Vérification du package avec Package linter
- Installation en sous-dossier
- Installation à la racine du domaine
- Installation sans accès par url (Pour les applications n’ayant pas d’interface web)
- Installation en privé
- Installation en public
- Mise à jour sur la même version du package
- Backup puis restore
- Installation multi-instances
- Test d’utilisateur incorrect
- Test de domaine incorrect
- Test de path mal formé (path/ au lieu de /path)
- Test de port déjà utilisé
Le script package_check
utilise un conteneur LXC pour manipuler le package dans un environnement non parasité par les précédentes installation.
L’usage de package_check
implique la création préalable d’un fichier check_process
indiquant les tests à effectuer et les arguments du manifest. Ce fichier doit se trouver à la racine du package à tester.
La documentation explique en détail comment créer ce fichier.
Si ce fichier n’est pas présent, package_check sera utilisé en mode dégradé. Il va tenter de repérer les arguments domain, path et admin dans le manifest pour exécuter un nombre restreint de test, en fonction des arguments trouvés.
Le script s’utilise très simplement:
./package_check.sh dir/APP_ynh
ou
./package_check.sh https://github.com/USER/APP_ynh
Attention
En raison de la jeunesse de ce script de test unitaire, il est conseillé de l’utiliser dans une machine virtuelle. Tout les bugs n’ayant pas encore été décelés.
Pour utiliser le script package_check, vous pouvez simplement le cloner.
git clone https://github.com/YunoHost/package_check
N’hésitez pas à remonter tout bug rencontré dans le bug tracker.
Hello
To test your apps packages for Yunohost, a unit testing script was developed.
This script will verify that package installs without error in different configurations.
- Check the package with Package linter
- Installation in a subdir
- Installation at root of domain
- Installation without url access (For apps without web UI)
- Private installation.
- Public installation.
- Upgrade on same package version
- Backup then restore
- Multi-instances installation
- Test with wrong user
- Test with wrong domain
- Test malformed path (path/ instead od /path)
- Test port already use
Package_check
script use an LXC container to manipulate the package in a non parasited environnement by previous installs
The use of package_check
implies first creating a check_process
file indicating tests to perform and arguments of the manifest. This file must be at root of the package dir.
The documentation explain in detail how to create this file.
If this file is not present, package_check will be used in downgraded mode. It try to retrieve domain, path and admin user arguments in the manifest for execute some tests, based on arguments found.
The script are simple to use
./package_check.sh dir/APP_ynh
or
./package_check.sh https://github.com/USER/APP_ynh
Be careful
Because of the youth of this unit test script, it is advisable to use in a virtual machine. All bugs are not revealed yet.
For use the script, you may simply clone it.
git clone https://github.com/YunoHost/package_check
Don’t hesitate to report any bug found in the bug tracker.