wojciech.kapcia@tigase.net opened 8 years ago
|
|
%wojtek We can do that, however in most test cases accounts may differ between each test in same test case. So we should annotate each method then? In fact in this case I'm more in a favour of creation base test class (ie. AbstractTest) and in it add methods to create accounts and clean them - actual test should only call them in method annotated with |
|
Waiting for clarification from Wojciech. |
|
Andrzej Wójcik wrote:
OK, the biggest problem is lack of admin account. I think that in general we need at least one admin account (that does all the work) - this could be default and created before running a full test (hence idea with annotations - test case/method could be annoted with "requiredJID" and it could be ensured - i.e. created if missing), and in addition each test should (must?) create accounts/items it needs. It can be done with Before/After, but... it could be possible already but not implemented. |
|
I've rewritten our base classes used for testing and I've implemented few managers. Unfortunately, it was not possible to use annotations to provide accounts, vhosts, pubsub nodes as each of this items require different options and a lot of them may be used. Instead of using annotations I created managers with methods returning builders. Using this builders you may pass settings and call Thanks to managers and builders it is not required to unregister accounts, delete pubsub nodes or remove vhosts - it will be done automatically by managers when proper test scope will be left (ie. objects created in I also added verification that admin account exists on server and if not then tests will automatically create this account (done once per test suite). |
|
Andrzej Wójcik wrote:
%andrzej.wojcik Will this work for individual tests? For example:
|
|
%andrzej.wojcik OK, it seems that Would it make sense to call it always but store the result so the actual check would be done only on first call? |
|
You are right, but |
|
Thank you for the update - now it's run, but seems to fail:
|
|
I've checked and there was a wrong implementation of exception handling and I've changed it. Now it works fine. |
|
After finishing the test there is a contradictory exception:
It seems that removal of the admin account was called yet account manager complains about it? Should we delete admin account (or any other automatically created account) only if it was created when starting the test? |
|
As we discussed, I've allowed removal of admin account if account was created by TTS-NG. |
|
Works correctly now. |
Type |
New Feature
|
Priority |
Normal
|
Assignee | |
RedmineID |
5207
|
Estimation |
10h
|
In TTS we had a "test case" that would simply create needed account.
I think, that for TTS-NG, instead of having a separate test run at the beginning orchestrating all things required (accounts, pubsub nodes) we could use more generic approach and annote tests with
dependsOn
and list JIDs/nodes and those would be created if needed.This could be extended to VHosts as well, as we are creating them in some cases instead of using main vhost.
RFC type of issue, all comments are welcomed (%bmalkow %kobit ) and when finished it can be implemented.