[slurm-users] Unit Testing job_submit.lua

Ole Holm Nielsen Ole.H.Nielsen at fysik.dtu.dk
Sat Feb 18 08:36:33 UTC 2023


On 17-02-2023 23:10, Groner, Rob wrote:
> I'm trying to setup some testing of our job_submit.lua plugin so I can 
> verify that changes I make to it don't break anything.
> 
> I looked into luaunit for testing, and that seems like it would do what 
> I need....let me set the value of inputs, call the slurm_job_submit() 
> function with them, and then evaluate the results.
> 
> But the setting of inputs is causing me issues.  I know plenty of C, and 
> very little of Lua.  I see that the slurm_job_submit() function gets 
> passed a job_desc_msg_t variable or pointer (or at least, I ASSUME it's 
> that) and somehow knows what's inside it, even though "slurm.h" isn't 
> included anywhere.  When I try to create a local variable of that type 
> and set some values in it, it doesn't go well.
> 
> Is there an easier way to unit test that file and the slurm_job_submit() 
> function in particular?

FWIW, I've written about my experiences with the job_submit.lua plugin 
in the Wiki page 
https://wiki.fysik.dtu.dk/Niflheim_system/Slurm_configuration/#job-submit-plugins

My example plugin at 
https://github.com/OleHolmNielsen/Slurm_tools/tree/master/plugins may 
perhaps serve as inspiration.

Maybe you'll find some of that information useful?

/Ole



More information about the slurm-users mailing list