fix more tests
add per command and per run limits
move `import resource` inside function, to be compatible with windows