This page explains how to run batch tests from the command line in a cloud environment.
In the case of tests using MagicPod cloud devices or external cloud services, it is possible to run these simply as a batch via the MagicPod Web API.
On this page, we introduce two execution methods:
magicpod-api-client method
After requesting to start a batch run, this method waits until execution is complete and returns the execution result as a response.curl / Invoke-RestMethod method
This method only sends a request to start a batch run and does not return the execution result as a response.
For this reason, if you are integrating MagicPod with a CI service and need to retrieve execution results for use in subsequent jobs, we recommend using the magicpod-api-client method. Since you can obtain the execution results with a single command, the implementation is simpler.
Execution Methods
1. magicpod-api-client Method
First, download the magicpod-api-client.
You can either download it manually from this page, or copy and run the following command in your terminal or command prompt.
After downloading, unzip the file and place it in a suitable location.
curl -L "https://app.magicpod.com/api/v1.0/magicpod-clients/api/{os}/latest/" -H "Authorization: Token {apikey}" --output {filename}.zip
Please replace {os}, {apikey}, and {filename} in the command according to your environment, as described below:
- {os}: Mac: mac, Windows: windows, Linux: linux or linux_arm64
- {apikey}: API token
- {filename}: Arbitrary file name
(If you download the file manually from the page, select one of the following depending on your OS:linux64_magicpod-api-client.zip, mac64_magicpod-api-client.zip, or win64_magicpod-api-client.exe.zip.)
Next, open MagicPod and click the Details button on the Batch runs tab to open the batch run settings page.
On the batch run settings page, create or select a test configuration that matches your execution requirements.
Then, from the top-right three-dot menu, select Run from command line.
After selecting an execution method, a command corresponding to the currently selected test configuration and the chosen execution method will be displayed on the screen.
Copy this command and paste it into your terminal or command prompt to start the batch run.
Among the Execution method options, the difference between those with and without (detailed settings) lies in how the test configuration is specified in the command:
Without (detailed settings):
The command specifies a Batch Run Settings number.With (detailed settings):
The command explicitly specifies each individual configuration parameter.
Since the execution behavior is essentially the same in both cases, we recommend creating and editing test configurations in the UI and using the execution method without (detailed settings).
If you want to modify some configuration values directly in the command before running the tests, you have two options:
Select with (detailed settings) and edit some of the individual configuration parameters.
Select without (detailed settings), specify the Batch Run Settings number, and additionally overwrite specific configuration parameters.
For details on the latter approach, please refer to this page.
2. curl, Invoke-RestMethod Method
First, open MagicPod and click the Details button on the Batch runs tab to open the batch run settings page.
On the batch run settings page, create or select a test configuration that matches your execution requirements.
Then, from the top-right three-dot menu, select Run from command line.
After selecting an execution method, a command corresponding to the currently selected test configuration and the chosen execution method will be displayed on the screen.
Copy this command and paste it into your terminal or command prompt to start the batch run.
Among the Execution method options, the difference between those with and without (detailed settings) lies in how the test configuration is specified in the command:
Without (detailed settings):
The command specifies a Batch Run Settings number.With (detailed settings):
The command explicitly specifies each individual configuration parameter.
Since the execution behavior is essentially the same in both cases, we recommend creating and editing test configurations in the UI and using the execution method without (detailed settings).
If you want to modify some configuration values directly in the command before running the tests, you have two options:
Select with (detailed settings) and edit some of the individual configuration parameters.
Select without (detailed settings), specify the Batch Run Settings number, and additionally overwrite specific configuration parameters.
For details on the latter approach, please refer to this page.