Bug #8425
Ajouter des vrais tests du multitenant
0%
Description
Pour l'instant on a juste des tests des chargeurs de settings ce qui est bien mais loin d'être suffisant, ces nouveaux testent plus globalement les settings.
Ces tests sont séparés des tests actuels (dans un autre répertoire) car ils ne peuvent pas partager les mêmes settings, en gros on devrait avoir 3 batteries de tests:- pour le hobo server
- pour le worker hobo
- pour le multitenant et modules agents (ça va ensemble)
Ces tests supposent une base PostgreSQL locale et que l'utilisateur courant a le droit de créer des bases (qui s'appelleront test_fake_agent)
Fichiers
Révisions associées
multitenant: allow testing multitenant applications (#8425)
Django setup of db for tests always call "migrate" which the multitenant
application inactivate. This commit redirect this command to migrate-schemas
if we know that we are currently testing. It's copied from
django-tenant-schemas.
tests: add tests for the multitenant framework (#8425)
tests/test_settings.py is moved in this new test suite. Tested are the
hobo_notify script and the simple creation of user objects.
multitenant: fix Tenant.get_hobo_json() (#8425)
Bug found using the new test suite.
agent/common: fix hobo_notify (#8425)
two trivial bugs found using the new tests
add merge-coverage script (#8425)
add merge-junit-results script (#8425)
add a jenkins script (#8425)
agent/common: does not send notifications when in a FakeTenant (#8425)
It breaks initial role migrations and new tenants deploy.
add authentic2 agent tests (#8425)
Historique
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
J'en profite pour rajouter la possibilité de supprimer un tenant, en renommant le répertoire et en y ajoutant le suffixe '.invalid'. Ce suffixe fait que le tenant est alors ignoré.
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
- Fichier 0001-multitenant-add-support-for-deletion-of-a-tenant-842.patch 0001-multitenant-add-support-for-deletion-of-a-tenant-842.patch ajouté
- Fichier 0002-multitenant-allow-testing-multitenant-applications-8.patch 0002-multitenant-allow-testing-multitenant-applications-8.patch ajouté
- Fichier 0003-tests-add-tests-for-the-multitenant-framework-8425.patch 0003-tests-add-tests-for-the-multitenant-framework-8425.patch ajouté
- Fichier 0004-multitenant-fix-Tenant.get_hobo_json-8425.patch 0004-multitenant-fix-Tenant.get_hobo_json-8425.patch ajouté
- Fichier 0005-agent-common-fix-hobo_notify-8425.patch 0005-agent-common-fix-hobo_notify-8425.patch ajouté
Nouvelle série.
Mis à jour par Frédéric Péters il y a plus de 8 ans
Avoir deux séries de tests, ça ne posera pas de problème à la génération d'un fichier coverage unique ?
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
J'ai déjà ce souci sur authentic et j'ai trouvé ça: http://git.entrouvert.org/authentic.git/tree/merge-coverage.py
Mis à jour par Frédéric Péters il y a plus de 8 ans
Pour moi c'est bien, en ajoutant le merge-coverage.py dans le dépôt (et en pensant ensuite à aller modifier le job côté jenkins) (ou ajouter un jenkins.sh équivalent).
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
- Fichier 0001-multitenant-add-support-for-deletion-of-a-tenant-842.patch 0001-multitenant-add-support-for-deletion-of-a-tenant-842.patch ajouté
- Fichier 0002-multitenant-allow-testing-multitenant-applications-8.patch 0002-multitenant-allow-testing-multitenant-applications-8.patch ajouté
- Fichier 0003-tests-add-tests-for-the-multitenant-framework-8425.patch 0003-tests-add-tests-for-the-multitenant-framework-8425.patch ajouté
- Fichier 0004-multitenant-fix-Tenant.get_hobo_json-8425.patch 0004-multitenant-fix-Tenant.get_hobo_json-8425.patch ajouté
- Fichier 0005-agent-common-fix-hobo_notify-8425.patch 0005-agent-common-fix-hobo_notify-8425.patch ajouté
- Fichier 0006-add-merge-coverage-script-8425.patch 0006-add-merge-coverage-script-8425.patch ajouté
- Fichier 0007-add-merge-junit-results-script-8425.patch 0007-add-merge-junit-results-script-8425.patch ajouté
- Fichier 0008-add-a-jenkins-script-8425.patch 0008-add-a-jenkins-script-8425.patch ajouté
Voilà voilà. Le script jenkins.sh tourne correctement dans un virtualenv.
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
- Fichier 0009-agent-common-does-not-send-notifications-when-in-a-F.patch 0009-agent-common-does-not-send-notifications-when-in-a-F.patch ajouté
- Fichier 0010-add-authentic2-agent-tests-8425.patch 0010-add-authentic2-agent-tests-8425.patch ajouté
En sus un test de l'agent authentic2, qui a déjà trouvé un bug.
Mis à jour par Frédéric Péters il y a plus de 8 ans
- Statut changé de Nouveau à Résolu (à déployer)
Poussés et publiés dans une 0.16.
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
- Statut changé de Résolu (à déployer) à Fermé
multitenant: add support for deletion of a tenant (#8425)
As we do not really store the tenant models, supermethod is not called.
Tenant directory is not deleted but renamed with an '.invalid' suffix.
Those suffixed directories are ignored by the method to list available
tenants.