7 Smoke Test Utility
The Smoke Test utility is provided with the RStudio Launcher Plugin SDK to provide the Plugin developer a way to exercise the basic functionality of the Plugin, particularly in a way that allows the developer to easily attach a debugger to the Plugin. The Smoke Test utility is not intended to replace integration testing with the RStudio Launcher and the RStudio product which will use the launcher.
7.1 Plugin Options
The Smoke Test utility will start the Plugin with the following options, which should not be changed:
--heartbeat-interval-seconds=0
--enable-debug-logging=1
--unprivileged=1
if the Smoke Test utility is launched without root privileges
Other options may be changed via the Plugin’s configuration file, which is usually located at /etc/rstudio/launcher.<plugin-name>.conf
.
When running the Smoke Test utility in unprivileged mode (see Starting the Tester for more details) it is advisable to change the scratch-path
option to a location that is readable and writable by the run-as user.
7.2 Starting the Tester
The Smoke Test utility takes two required arguments: the full or relative path to the Plugin to test, and the user to test as. It can be run in two modes: privileged and unprivileged. To run the Smoke Test utility in privileged mode, start it with root privileges. For example:
sudo ./rlps-smoke-test ../plugins/MyPlugin/rstudio-myplugin-launcher someUser
.
To run the Smoke test utility in unprivileged mode, start it as the user specified in the second argument.
Privileged mode is the most common running environment for a Plugin; however, there are some situations where the Plugin cannot be run in privileged mode, such as within a Docker container, so it is advisable to test both scenarios.
When the Smoke Test utility starts, it will send the Plugin a Bootstrap Request and print the response. The Bootstrap response must be successful, or future requests will fail. Next the utility will enter a loop of printing the menu, waiting for input, and performing the requested action, until the user explicitly exits the utility. At any time, the user can provide q
or Q
as input to exit the utility.
7.3 Using the Tester
Each time the Smoke Test utility completes a requested action, it will print a menu of available actions. After an action is chosen, the utility will perform the action and print any responses from the Plugin. These responses must be manually verified, as their expected values may vary between Plugin implementations.
This section documents what each menu item will do. For an example of how a Plugin might respond to each of these tests, the Smoke Test utility may be run using the provided sample Local Launcher Plugin.