Anyway, I guess what I'm getting to is:
It would be great if we could execute each script we have setup with NZBGet in a Test Mode (5th type) that would basically just takes advantage of piping it's output to the NZBGet logs giving us some idea of whether it's going to work as we expect it to in advance. Some sort of button that becomes available in the NZBGet configuration when previewing a scripts configuration... Perhaps of the colour red and containing the keyword 'Test'.
Each Script maintainer would have to add support for this (so it would be just an optional thing)... When the new Test button was pressed it would execute the script the same way it might have otherwise done so using the other modes (Scan/Post Process/Queue/Schedule) (but as the new Test? mode). You could easily prevent breaking existing scripts by just setting a new Environment Variable when called (this would be how you distinguish that your being ran in a test mode or not). Hence, set the internal variables (passed from the configuration) to something like NZBTEST_VAR (or whatever).
Script maintainers who choose to listen and execute upon these can read in the configuration the user specified and do a test (or series of tests) pertaining to whatever the script function is and report back to the the user through the NZBGet logs. Let the user know that everything looks good... or report to them an error or something they should consider.
You could make it even more backwards compatible by only put the new 'Test' button next to scripts that create some directive they define in their configuration... Something like:
Code: Select all
### TESTABLE ###
Other scripts that preform other tasks might do something as simple as test that the remote authentication is right. ClintonHall might test the APIs specified to the remote CouchPotato, Sonarr servers, etc. But it would just give the user that warm fuzzy feeling that the new script they've added is set up correctly. It also gives developers a better troubleshooting understanding or starting point.
I know for my TidyIt script; i would just ahead and run it in Disabled mode allowing them to see what it 'would' do if ran fully enabled. Stuff like that...
Thoughts?
Edit: Hugbug; i took out reference to the installation of NZBGet since it's not pertaining to the feature I'm proposing anyway.