Currently pbs_benchpress in PTL has hard coded list of plugins which gets loaded from ptl.utils.plugins directory. Due to hard coded list, it doesn’t allow user to load custom plugin to do extra stuff before and after test runs. For example force restart server before each test case or send test execution status to some central database etc…
So I am proposing little change in pbs_benchpress command which adds new argument called ‘–extra-plugins’ which will allow user to specify list of custom plugins which will get loaded along with other hard coded plugins in pbs_benchpress.
Design document: https://pbspro.atlassian.net/wiki/spaces/PD/pages/823459843/Allow+extra+user+plugins+in+pbs_benchpress
Hi Hiren, this looks like a good addition. I have few questions.
- does myplugins.xyzplugin has to be in the current directory?
- Similarly if my plugin is dependent on other plugins, do all of them have to be under same path?
- If plugin fail to load for some reason then would pbs_benchpress exits or continue to run
Also just a suggestion. Instead of calling --extra-plugins how about calling them --myplugins?
a small typo "will allow use to write ptl "
Nope, but it should be in PYTHONPATH (or in default installation directory i.e. site-packages) so that python can import it.
I will update DD for this.
Theoretically it is possible have nested plugin but practically no one will write those because if you write nested plugin then for Nose it is just one plugin. And till now I have never seen any plugin which is dependent on other plugin.
Now to your question: No it doesn’t have to be in same path, as to make nested plugin you will have to import another plugin class so python will take care of finding appropriate plugin class.
pbs_benchpress will exit with message saying failed to load particular module.
I don’t have any preference of naming of argument but if we want to rename current name then how about ‘–user-pluings’ instead ‘–myplugins’?
Thanks Hiren for your reply.
please update EDD with this as well
‘–user-plugins’ sounds good to me.
Ok, updated DD for same and will update code in few.
Design doc looks good to me.
Thanks for making the changes Hiren. Looks good to me.