Running Your Own Agent
Testable Agents are responsible for executing test cases and reporting back the results. Shared agents are provided in regions across the globe for your use. In certain cases it makes sense for users to run their own agents. These situations include:
- Your product sits behind a firewall and is not reachable from outside that firewall.
- Your test requires IP address whitelisting. The global shared agents are dynamically allocated and removed so a fixed range of IPs cannot be guaranteed.
- Ensure complete isolation from other user's test cases.
Agents you run yourself are private to your account and are not accessible by any other Testable clients.
Docker must be installed before you can start the agent. Instructions on how to install docker can be found at https://docs.docker.com/engine/installation/.
Create an API Key
Login to Testable and go to Settings -> Api Key. Create a new API key. You will need this to run the agent.
docker run --net host -e AGENT_REGION_NAME=[region-name] -e AGENT_KEY=[api-key] -v /logs -d testable/agent
That's it. The region name can be anything you want. This name will appear in the Regions multi-select when you create or update your test configuration. The AGENT_KEY is the API key you created earlier (Settings -> Api Keys).
Full set of accepted environment variables:
- AGENT_REGION_NAME (required): The name of the region.
- AGENT_KEY (required): Api key to authenticate your agent with (create api keys at Settings -> Api Keys)
- AGENT_LOG_LEVEL: The logger level. Choices are (error, warn, info, verbose, debug). Defaults to info.
- AGENT_LOG_CONSOLE: Whether or not to log to the console. Defaults to false.
- AGENT_CONCURRENT_CLIENTS: Number of concurrent clients the agent can execute at any one time. Defaults to 500.
- AGENT_REGION_DESCRIPTION: The description that appears with the region name when configuring test cases. Defaults to the region name if not specified.
- AGENT_UPDATE_LAT_LONG: A boolean that indicates whether or not to update the location of your agent at runtime. Defaults to false. If true, Testable will geo locate your IP address. On the test results, your agent will appear at this location on the map.
- AGENT_LATITUDE: The latitude at which your agents are located. If set along with AGENT_LONGITUDE, your region's location will be updated to these values and the geo location of your IP address ignored.
- AGENT_LONGITUDE: The longitude at which your agents are located. If set along with AGENT_LATITUDE, your region's location will be updated to these values and the geo location of your IP address ignored.
Logging is written to /logs/agent.log within the container. Mount the
/logs volume if you would like to access the log from outside of Docker. 10 days worth of logs are kept in the container using a daily rolling strategy.
Execute a Test Case In Your Region
Create a new test case and under the Configuration step you will see your agent's region in the list. Select it as one of the regions for your test and when your test starts it will execute on one of your agents.
Note that you can have multiple regions of your own each with multiple agents.
I don't see my region in the list?
Try reloading the Testable page and it should appear as a region to select for your test configuration.