visit
Difference between GUI and CLI
The operating system of any device is nothing but an interface between user and hardware components of that device. The operating system offers a GUI vs CLI user interface to interact with an electronic device. Some operating systems provide GUI and CLI while others offer only CLI. GUI means a Graphical user interface while CLI means the command line interface. As the name suggests, one has to write commands to perform a certain task in the CLI system. On the other hand, GUI offers graphics that consists of icons and images that enable a user to do a task directly. CLI requires expertise in commands for performing a certain task while GUI can be operated by a beginner.For its working, GUI uses computer graphics. One can click on the icon; drag the object with help of mouse. There is no need to remembering commands in this. GUI comes with numerous components. With the help of a textbox editor, one can enter input data in this. A menu offers a list of options to choose from. Buttons enable the user to select a particular option. The checkbox element enables the user to select an option to choose from multiple alternatives. Linux and Windows use a Graphical User Interface. It consists of icons, search boxes, windows, menus, and many other graphical elements.source =When to use the CLI
It’s not one tool is better than the other one (CLI vs GUI) in general but we have to put them in context and see the requirements. One tool might be better for this situation but the other one can be the best tool for another occasion.CI/CD compatibility
In software engineering, CI/CD or CICD generally refers to the combined practices of continuous integration and either continuous delivery or continuous deployment.CI/CD bridges the gaps between development and operation activities and teams by enforcing automation in building, testing and deployment of applications. Modern day DevOps practices involve continuous development, continuous testing, continuous integration, continuous deployment and continuous monitoring of software applications throughout its development life cycle. The CI/CD practice or CI/CD pipeline forms the backbone of modern day DevOps operations.Hence, CI/CD is the perfect use-case for the CLI as it allows the user to create automated workflows that can define, scale and capture exceptions for a deployment and testing process of an application from the point of its inception (infrastructure dependencies) to the point of going live (final live test was successful).source =Check Python version
Before you go any further, make sure you have Python and that the expected version is available from your command line. You can check this by running:mariusmitrofan@Rungutan ~ >> python --version
Python 2.7.16
mariusmitrofan@Rungutan ~ >> python3 --version
Python 3.8.2
Install/Upgrade PIP
The following commands show ensure that pip is installed through the standard library and then updated to the latest version.mariusmitrofan@Rungutan ~ >> python3 -m ensurepip --default-pip
mariusmitrofan@Rungutan ~ >> pip3 install --upgrade pip
mariusmitrofan@Rungutan ~ >> sudo -H pip3 install --upgrade pip
Password:
Collecting pip
Downloading //files.pythonhosted.org/packages/fe/ef/60d7ba03b5c442309ef42e7d69959f73aacccd0d86008362a681c4698e83/pip-21.0.1-py3-none-any.whl (1.5MB)
|████████████████████████████████| 1.5MB 2.3MB/s
Installing collected packages: pip
Found existing installation: pip 19.2.3
Uninstalling pip-19.2.3:
Successfully uninstalled pip-19.2.3
Successfully installed pip-21.0.1
Install/Upgrade the Rungutan CLI
Now that your system is up and running with the latest (and stable) version of Python3 and PIP3, you can proceed to actually install the Rungutan CLI as so:mariusmitrofan@Rungutan ~ >> sudo -H pip3 install --upgrade rungutan
Collecting rungutan
Using cached rungutan-1.6.3-py3-none-any.whl (16 kB)
Requirement already satisfied: simplejson in /private/var/root/Library/Python/3.8/lib/python/site-packages (from rungutan) (3.17.2)
Installing collected packages: rungutan
Successfully installed rungutan-1.6.3
mariusmitrofan@Rungutan ~ >> rungutan version
1.6.3
mariusmitrofan@Rungutan ~ >> rungutan help
usage: rungutan []
To see help text, you can run:
rungutan help
rungutan version
rungutan configure --help
rungutan domains --help
rungutan team --help
rungutan results --help
rungutan raw_results --help
rungutan tests --help
rungutan templates --help
rungutan crons --help
rungutan notifications --help
rungutan vault --help
Rungutan CLI utility for interacting with //rungutan.com
positional arguments:
command Command to run
optional arguments:
-h, --help show this help message and exit
How do I authenticate?
In order to authenticate against the Rungutan platform, you need to provide 2 values:In case your API Key gets leaked, use the “Refresh API Key” button to delete the old one and generate a new one for your account!
Authenticate using CLI arguments
In order to use the CLI arguments to authenticate, you would run the following command and input the parameters as they are being requested:mariusmitrofan@Rungutan ~ >> rungutan configure
TEAM_ID: rungutan
API_KEY: ENShJ5w1Jw8yaIcYdYLDy8WWkAEPIjNL7Cn1cl4F
mariusmitrofan@Rungutan ~ >> rungutan templates list
{
"Templates": [
{
"template_id": "some-template-id-here",
"test_name": "DEMO - Launch tests in APAC",
"template_name": "DEMO - Launch tests in APAC",
"domain_name": "some-domain-name",
"threads_per_region": 2,
"num_clients": 250,
"hatch_rate": 10,
"created_date": "2021-02-10T06:16:14Z",
"run_time": 30,
"member_email": "some-email-address",
"test_region": "ap-northeast-1,ap-northeast-2"
}
]
}
Authenticate using environment variables
In order to use the environment variables, you have to make sure the following two environment key variables are defined:The only difference is that instead of running the “rungutan configure” command, you would simply skip it, and directly run the command that you desire, by ensuring that the environment variables are present, as following:mariusmitrofan@Rungutan ~ >> export RUNGUTAN_TEAM_ID=rungutan
mariusmitrofan@Rungutan ~ >> export RUNGUTAN_API_KEY=ENShJ5w1Jw8yaIcYdYLDy8WWkAEPIjNL7Cn1cl4F
mariusmitrofan@Rungutan ~ >> rungutan templates list
{
"Templates": [
{
"template_id": "some-template-id-here",
"test_name": "DEMO - Launch tests in APAC",
"template_name": "DEMO - Launch tests in APAC",
"domain_name": "some-domain-name",
"threads_per_region": 2,
"num_clients": 250,
"hatch_rate": 10,
"created_date": "2021-02-10T06:16:14Z",
"run_time": 30,
"member_email": "some-email-address",
"test_region": "ap-northeast-1,ap-northeast-2"
}
]
}
When should I use which?
Usually, environment variable authentication is used in systems in which the user does not have direct terminal access, does not need to access it directly or should not be accessed directly.The most basic use case for using environment variables is in defining CI/CD pipelines, in which usually those environment variables are defined at the project/sub-project levels as secrets which are injected automatically into any new job.For more details on how to do this with GitHub Actions, see our .Can I use the CLI with multiple teams?
Of course, but it of course requires that you authenticate with each of those teams separately and it is only available through the CLI arguments logic.So, instead of simply running “rungutan configure”, you could authenticate twice as so:mariusmitrofan@Rungutan ~ >> rungutan configure --profile rungutan
TEAM_ID: rungutan
API_KEY: ENShJ5w1Jw8yaIcYdYLDy8WWkAEPIjNL7Cn1cl4F
mariusmitrofan@Rungutan ~ >> rungutan configure --profile rungutan2
TEAM_ID: rungutan2
API_KEY: ENShJ5w1Jw8yaIcYdYLDy8WWkAEPIjNL7Cn1cl4F
mariusmitrofan@Rungutan ~ >> rungutan templates list --profile rungutan
{
"Templates": [
{
"template_id": "some-template-id-here",
"test_name": "DEMO - Launch tests in APAC",
"template_name": "DEMO - Launch tests in APAC",
"domain_name": "some-domain-name",
"threads_per_region": 2,
"num_clients": 250,
"hatch_rate": 10,
"created_date": "2021-02-10T06:16:14Z",
"run_time": 30,
"member_email": "some-email-address",
"test_region": "ap-northeast-1,ap-northeast-2"
}
]
}
mariusmitrofan@Rungutan ~ >> rungutan templates list
{
"Templates": [
{
"template_id": "some-template-id-here",
"test_name": "DEMO - Launch tests in APAC",
"template_name": "DEMO - Launch tests in APAC",
"domain_name": "some-domain-name",
"threads_per_region": 2,
"num_clients": 250,
"hatch_rate": 10,
"created_date": "2021-02-10T06:16:14Z",
"run_time": 30,
"member_email": "some-email-address",
"test_region": "ap-northeast-1,ap-northeast-2"
}
]
}
mariusmitrofan@Rungutan ~ >> rungutan tests add --template_id some-template-id-here --test_name "Test ran from the CLI" --wait_to_finish
{
"test_id": "a-new-test-id-here",
"test_name": "Test ran from the CLI",
"message": "Successfully created new test"
}
Waiting for test to finish...
{
"Results": {
"region": "overall",
"failures": [],
"public_ips": [
"3.35.12.2",
"15.164.226.216",
"52.199.126.145",
"13.230.29.159"
],
"requests": [
{
"Method": "GET",
"Path": "/",
"num_requests": 16092,
"min_response_time": 13,
"median_response_time": 48,
"avg_response_time": 59,
"max_response_time": 653,
"response_time_percentiles": {
"55": 50,
"65": 57,
"75": 65,
"85": 83,
"95": 135
},
"total_rps": 537,
"total_rpm": 32220
},
{
"Method": "GET",
"Path": "/blog/",
"num_requests": 16053,
"min_response_time": 13,
"median_response_time": 44,
"avg_response_time": 50,
"max_response_time": 738,
"response_time_percentiles": {
"55": 45,
"65": 49,
"75": 55,
"85": 66,
"95": 90
},
"total_rps": 536,
"total_rpm": 32160
}
]
},
"ResultsMetadata": {
"team_id": "rungutan",
"test_id": "a-new-test-id-here"
}
}
Previously published at