Radarr: Better test option for custom script

Created on 29 Aug 2017  路  15Comments  路  Source: Radarr/Radarr

Description:

I added a really simple custom script in "Connections" tab just to test it. The script is named script.sh, and it only does the following:

touch /tmp/test.log

When I click on the Button "Test", it shows "Testing 'script.sh' suceeded!" but /tmp/test.log is not created. What's the logic behing the "Test" button? I plan to create a lot of scripts but if a simple one is not working I don't have confidence in going further.

Radarr Version:

Version
0.2.0.778
Mono Version
5.0.1.1 (2017-02/5077205 Wed May 31 10:51:59 BST 2017)

feature request

Most helpful comment

I support a option to give fake values for the sake of just testing a script.

All 15 comments

Did nothing show up in the debug log?

I had the same problem yesterday. How I tested was to manually move a movie to the downloaded folder over and over again (take a small size movie).
I think the test button just verifies if it actually is able to find the script and has permissions on it (don't quote me on this).

As all the variables are set via env variables it would be difficult to have the test button do anything at all I think.

How I tested was to manually move a movie to the downloaded folder over and over again (take a small size movie).

I'm using Transmission: it downloads to /var/media/mydisk/transmission/downloads/my-movie and then a new copy is made to /var/media/mydisk/my-movie when it completes. What would be "downloaded folder" @tr1plus ?

I'm also using transmission. You should move it to /var/media/mydisk/transmission/downloads/my-movie in that case. It should be the same path as the one in the "drone factory"

I'm not using Drone Factory...

I have /var/media/mydisk/transmission/My.Movie.RELEASE.2017. When the download completes, this becomes /var/media/mydisk/My Movie (2017). The transmission movie folder is not removed because in "Completed Download Handling", "Remove" I've set it to off.

I still didn't get it how do you test in this scenario to force the script call... Can you guide me? Thanks in advance.

In the end, I could test between downloads.

I had to add a shebang #!/bin/sh to my script and a chmod +x on it to make it work. Maybe this could be added to the wiki somehow... @galli-leo what do you think?

@msdos You can edit the wiki too ;P

Also sonarr has a similar issue open, not sure if we really can execute the script. (Because the parameters obviously wouldn't be there, making most scripts fail anyways).

@galli-leo I didn't know I had permission for that - https://github.com/Radarr/Radarr/wiki/Custom-Post-Processing-Scripts/4d75d3175777146e4a9fad7912839aaa957f9f9d

Also sonarr has a similar issue open, not sure if we really can execute the script. (Because the parameters obviously wouldn't be there, making most scripts fail anyways).

Good point. If there's no workaround for that, I think you should add a notice to the interface stating that the "Test" is only checking if the script exists.

If you have the number of the similar issue in Sonarr, it would be nice to add the link here for future reference.

Maybe the test would create a "fake" folder with fake files (for example, Raddar Movie Test Folder) just so the parameters would be there for testing?

I think a test here should work like a test from any other Notification. It should contain static fake test data in the environment variables with a Radarr_EventType of "Test". Custom scripts are (or should be) looking at the Radarr_EventType anyway for decision making. This way the script author can decide how to handle the test.

@fhscholl Well but then the test would be useless, wouldn't it? Because you couldn't really test moving files or other stuff.

@galli-leo Not at all. The test would show that communication from Radarr to the Custom Script was working as opposed to just showing that the file exists like it does now. Radarr doesn't support end-to-end functional testing with any other notification test today; they all use bogus information and bogus paths.

If a user wants to do functional testing on a Custom Script, he/she can stage an environment and create a test script that populates the environment with known good test data before calling the Custom Script.

If a user wants to test that Radarr can locate the path of a Custom Script and execute it, click the test button in the UI.

I support a option to give fake values for the sake of just testing a script.

Closing
v0.2 is no longer being actively developed.

If this is still an issue/request on recent v3 builds, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NewUser9 picture NewUser9  路  3Comments

danielb2 picture danielb2  路  3Comments

onedr0p picture onedr0p  路  3Comments

mattman86 picture mattman86  路  3Comments

HitsvilleUK picture HitsvilleUK  路  3Comments