Running tests in a containerized workbench
You can run tests in a containerized workbench after you deploy your Docker images. You need not install the workbench on your computer to run your tests.
Before you begin
- You must have configured a Docker container.
- You must have exported test assets to a location from where Docker can import them.
Notes:
- You must use a Bash shell to run the commands for executing tests. In Windows operating system, you can use Git Bash.
- The version number of the container images and the desktop products must match. If you have a
previous version of the container image, you must uninstall it and then install the current version.
To uninstall the image, you must use the following commands:
To stop the container:
docker stop "CONTAINER ID"
To uninstall the image:
docker rmi -f "image ID"
Procedure
-
Run the following command to load the workbench image into the Docker repository:
tar --wildcards --to-command='docker load' -xzf <workbenchImageName> 'images/'*
For example, workbenchImageName could be ibm-rtw-<versionNumber>.tar.gz.
When the workbench image is loaded into the Docker repository, the following message is displayed:-Loaded image: imageFileName:versionNumber
-
To run tests on the Docker environment without using any agents, complete the following
steps:
Table 1. Command Description --rm Removes the container after the run is completed. -e Sets the environment variables. RATIONAL_LICENSE_FILE=<PORT>@<HOST> Specifies the port number of Rational License Key Server, usually 27000, and the server IP address. The floating license for the product and VT-packs must be on the license server. hostTestAssets:/containerTestAssets Specifies the folder location on the host computer and the container that contains the compressed test assets (.zip format). You must use both the locations to map one or more shared volumes to transfer data such as test assets, logs, and execution results between the host and the container. hostImportedData:/containerImportedData Specifies the workspace location on the host computer and the container that contains the test assets that are not compressed. The results of the test execution are saved to the directory you specify on the host computer. TEST_IMPORT_PATH=<PATH> Specifies the location of the compressed test assets to be imported into the container. The location path is on the container side and not the host. For example, /containerTestAssets/archiveName.zip. The volume and path names are user-defined and must be consistent. imageName:imageVersion Specifies the name of the image and its version to run. cmdline Specifies the existing command-line arguments to define the location of the workspace, project name, test name, results file name, and the location of the exported logs.