Skip to content

Commit db098bf

Browse files
amanchopra1905Ishavyas9
authored andcommitted
HYP CLI doc revamped
1 parent 52092f8 commit db098bf

6 files changed

+126
-187
lines changed

docs/hyperexecute-cli-run-tests-on-hyperexecute-grid.md

+42-47
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: hyperexecute-cli-run-tests-on-hyperexecute-grid
33
title: HyperExecute CLI - Run test on HyperExecute
4-
hide_title: true
4+
hide_title: false
55
sidebar_label: HyperExecute CLI - Run test on HyperExecute
66
description: Explains about HyperExecute CLI
77
keywords:
@@ -24,6 +24,11 @@ site_name: LambdaTest
2424
slug: hyperexecute-cli-run-tests-on-hyperexecute-grid/
2525
---
2626

27+
import CodeBlock from '@theme/CodeBlock';
28+
import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys";
29+
import Tabs from '@theme/Tabs';
30+
import TabItem from '@theme/TabItem';
31+
2732
<script type="application/ld+json"
2833
dangerouslySetInnerHTML={{ __html: JSON.stringify({
2934
"@context": "https://schema.org",
@@ -47,32 +52,24 @@ slug: hyperexecute-cli-run-tests-on-hyperexecute-grid/
4752
})
4853
}}
4954
></script>
50-
51-
52-
# HyperExecute CLI
53-
5455
`HyperExecute CLI` is a command line interface that is required to run tests on HyperExecute. This page outlines all you need to know about the CLI and also explains about the different flags & functionalities supported by the HyperExecute CLI.
5556

56-
***
57-
58-
### Downloading the HyperExecute CLI
57+
## Download the HyperExecute CLI
5958

6059
You can download the `HyperExecute CLI` for your OS from the links given below :
6160

6261
| Platform | Download Link |
6362
| ---------| --------------------------- |
63+
| Linux | https://downloads.lambdatest.com/hyperexecute/linux/hyperexecute |
6464
| Windows | https://downloads.lambdatest.com/hyperexecute/windows/hyperexecute.exe |
6565
| macOS | https://downloads.lambdatest.com/hyperexecute/darwin/hyperexecute |
66-
| Linux | https://downloads.lambdatest.com/hyperexecute/linux/hyperexecute |
6766

6867
## HyperExecute CLI Supported Flags
6968

7069
HyperExecute CLI provides different command-line flags that let you control the HyperExecute platform as per your customised requirements. You can run `hyperexecute.exe --help` on your terminal to explore the different flags.
7170

7271
<img loading="lazy" src={require('../assets/images/hyperexecute/cli/cli-help.png').default} alt="Image" className="doc_img"/>
7372

74-
***
75-
7673
The various flags that are supported are listed below.
7774

7875
| Flags | Type | Description
@@ -288,15 +285,22 @@ The secrets file contains highly sensitive information and must be strictly excl
288285

289286
***
290287

291-
## Running HyperExecute CLI
288+
## Trigger your Test from HyperExecute CLI
292289

293-
In order to trigger your test on Hyperexecute, just need to use the following command. Please replace the placeholder values with your details.
290+
In order to trigger your job on HyperExecute, execute the following command in your terminal. You will need to insert the name of your YAML file in place of the `YOUR_YAML_FILE` before running this command.
294291

295-
``` bash
296-
./hyperexecute --user <your_username> --key <your_access_key> --config <your_yaml_file_name>
297-
```
292+
<div className="lambdatest__codeblock">
293+
<CodeBlock className="language-bash">
294+
{`./hyperexecute --user ${ YOUR_LAMBDATEST_USERNAME()} --key ${ YOUR_LAMBDATEST_ACCESS_KEY()} --config YOUR_YAML_FILE `}
295+
</CodeBlock>
296+
</div>
298297

299-
> **Note**: If you're running on a minimal alpine image, please make sure to install essential linux dependencies for HyperExecute CLI to work.
298+
:::tip
299+
In case of macOS, if you get a permission denied warning while executing CLI, simply run `chmod u+x ./hyperexecute` to allow permission. In case you get a security popup, allow it from your **System Preferences****Security & Privacy****General** tab.
300+
:::
301+
302+
:::note
303+
If you're running on a minimal alpine image, please make sure to install essential linux dependencies for HyperExecute CLI to work.
300304
(An example with our sample repo has been given below):
301305
``` bash
302306
apk add libc6-compat git bash
@@ -306,44 +310,35 @@ In order to trigger your test on Hyperexecute, just need to use the following co
306310
chmod +x hyperexecute
307311
./hyperexecute --user <lt_user> --key <lt_access_key> --config yaml/win/behave_hyperexecute_autosplit_sample.yaml
308312
```
309-
310-
***
311-
312-
### `.gitignore` & `.hyperexecuteignore`
313-
314-
The HyperExecute CLI binary ignores all the files listed in the `.gitignore` file during the testing process.
315-
316-
We also provide a similar functionality using te `.hyperexecuteignore`. [Learn More](/support/docs/hyperexecute-gitignore/)
317-
318-
> Feel free to go over the [frequently asked questions](/support/docs/hyperexecute-cli-faqs/) about the HyperExecute CLI.
313+
:::
319314

320315
## Running HyperExecute CLI in Quiet Mode
321316

322-
Each time a job is run in Hyperexecute, a large number of logs are produced. These logs are sometimes beneficial for thorough debugging and analysis, it occasionally overwhelms Continuous Integration (CI) systems with an excessive amount of logs, especially when handling a large number of test executions. Hyperexecute provides a **"Quiet mode"** as a solution to this issue and to give users more control over the logging output. By only displaying significant updates during the test execution, this enables you to run tests with less logs.
323-
324-
### Enabling Quiet Mode using CLI
325-
First, you need to paas these commands in CLI or terminal to enable the **Quiet Mode** and then trigger the command to execute your job.
326-
327-
For macOS / Linux:
328-
329-
```bash
330-
env | grep CI
331-
# Used to check if the CI variable is set to true or not
317+
Each time a job is run in Hyperexecute, a large number of logs are produced. These logs are sometimes beneficial for thorough debugging and analysis, it occasionally overwhelms Continuous Integration (CI) systems with an excessive amount of logs, especially when handling a large number of test executions.
332318

333-
export CI=true
334-
# If it's not set to true, then use this command to set as true
335-
```
319+
Hyperexecute provides a **"Quiet mode"** as a solution to this issue and to give users more control over the logging output. By only displaying significant updates during the test execution, this enables you to run tests with less logs.
336320

337-
For Windows:
321+
To enable the **Quiet Mode**, you need to paas these commands in your terminal and then trigger the command to execute your job.
338322

339-
```bash
340-
env | grep CI
341-
# Used to check if the CI variable is set to true or not
323+
<Tabs className="docs__val">
324+
<TabItem value="bash" label="Linux / macOS" default>
325+
```yaml
326+
env | grep CI # Used to check if the CI variable is set to true or not
327+
export CI=true # If it's not set to true, then use this command to set as true
328+
```
329+
</TabItem>
342330

343-
set CI=true
344-
# If it's not set to true, then use this command to set as true
345-
```
331+
<TabItem value="powershell" label="Windows" default>
332+
```yaml
333+
env | grep CI # Used to check if the CI variable is set to true or not
334+
set CI=true # If it's not set to true, then use this command to set as true
335+
```
336+
</TabItem>
337+
</Tabs>
346338

347339
#### Output
348340

349341
<img loading="lazy" src={require('../assets/images/hyperexecute/cli/cli-execute.png').default} alt="Image" width="1350" height="619" className="doc_img"/>
342+
<br /><br />
343+
> 📕 Use the HyperExecute CLI's [Frequently Asked Questions](/support/docs/hyperexecute-cli-faqs/) to gain more knowledge about it.
344+

docs/hyperexecute-inherit-config.md

+35-40
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,13 @@ YAML inheritance in HyperExecute allows you to reuse common configuration settin
4141

4242
For example, you can create a base YAML file with common settings like **browsers**, **OS versions**, and **devices**, and then inherit from it in other YAML files for different environments or test types. This **reduces boilerplate code and errors** while making it easy to switch between environments and manage complex test execution configurations.
4343

44-
### Prerequisites
44+
## Prerequisites
4545

4646
- You must inherit a YAML file of the same version as your original file.
47-
4847
- The mode of execution, i.e. Matrix, AutoSplit, or Hybrid, must remain the same in both of the YAML files.
49-
5048
- The files that you want to inherit cannot be cyclically dependent. If you want to inherit **A.yaml** in **B.yaml**, then **A.yaml** cannot inherit **B.yaml**.
5149

52-
### How do you use the Inheritance feature?
50+
## How do you use the Inheritance feature?
5351

5452
You can use the inheritance feature by entering the following flag in your YAML file:
5553

@@ -69,22 +67,22 @@ base:
6967

7068
Go through the example attached below to understand how the resultant YAML will function if you inherit a base YAML in your parent YAML file.
7169

72-
**Parent YAML**:
70+
### Parent YAML
71+
7372
```yaml
7473
---
7574
version: 0.1
76-
testSuiteTimeout: 10
77-
testSuiteStep: 8
75+
runson: win
7876
7977
base:
8078
yamls:
8179
- ./level1/base1.yaml
8280
83-
runson: win
8481
autosplit: true
82+
concurrency: 2
83+
8584
retryOnFailure: false
8685
maxRetries: 5
87-
concurrency: 2
8886
8987
env:
9088
CACHE_DIR: m2_cache_dir
@@ -96,6 +94,12 @@ preDirectives:
9694
- echo yaml/level0/level1/base1.yaml
9795
- mvn dependency:resolve
9896
97+
testDiscovery:
98+
type: raw
99+
command: grep 'test name' xml/testng_win.xml | awk '{print$2}' | sed 's/name=//g' | sed 's/\x3e//g'
100+
101+
testRunnerCommand: mvn test `-Dplatname=win `-Dmaven.repo.local=./.m2 dependency:resolve `-DselectedTests=$test
102+
99103
postDirectives:
100104
commands:
101105
- ls
@@ -108,26 +112,20 @@ uploadArtefacts:
108112
path:
109113
- target/surefire-reports/html/**
110114

111-
testDiscovery:
112-
type: raw
113-
command: grep 'test name' xml/testng_win.xml | awk '{print$2}' | sed 's/name=//g' | sed 's/\x3e//g'
114-
115-
testRunnerCommand: mvn test `-Dplatname=win `-Dmaven.repo.local=./.m2 dependency:resolve `-DselectedTests=$test
115+
jobLabel: ['parent']
116116
```
117117
118-
**Base YAML**:
118+
### Base YAML
119119
```yaml
120120
---
121121
version: 0.1
122-
testSuiteTimeout: 10
123-
testSuiteStep: 0
124-
125-
126122
runson: mac
123+
127124
autosplit: true
125+
concurrency: 1
126+
128127
retryOnFailure: true
129128
maxRetries: 5
130-
concurrency: 1
131129

132130
env:
133131
CACHE_DIR: m2_cache_dir
@@ -137,6 +135,12 @@ preDirectives:
137135
- pwd
138136
- mvn dependency:resolve
139137

138+
testDiscovery:
139+
type: raw
140+
mode: static
141+
142+
testRunnerCommand: echo test
143+
140144
postDirectives:
141145
commands:
142146
- ls
@@ -149,29 +153,20 @@ uploadArtefacts:
149153
path:
150154
- target/surefire-reports/html/**
151155

152-
testDiscovery:
153-
type: raw
154-
mode: static
155-
156-
testRunnerCommand: echo test
157-
158156
jobLabel: ['base1']
159157
```
160158
161-
162-
**Resultant YAML**:
159+
### Resultant YAML
163160
```yaml
164161
---
165162
version: 0.1
166-
testSuiteTimeout: 10
167-
testSuiteStep: 8
168-
169-
170163
runson: mac
164+
171165
autosplit: true
166+
concurrency: 1
167+
172168
retryOnFailure: true
173169
maxRetries: 5
174-
concurrency: 1
175170

176171
env:
177172
CACHE_DIR: m2_cache_dir
@@ -181,6 +176,13 @@ preDirectives:
181176
- pwd
182177
- mvn dependency:resolve
183178

179+
testDiscovery:
180+
type: raw
181+
mode: static
182+
command: grep 'test name' xml/testng_win.xml | awk '{print$2}' | sed 's/name=//g' | sed 's/\x3e//g'
183+
184+
testRunnerCommand: mvn test `-Dplatname=win `-Dmaven.repo.local=./.m2 dependency:resolve `-DselectedTests=$test
185+
184186
postDirectives:
185187
commands:
186188
- ls
@@ -193,13 +195,6 @@ uploadArtefacts:
193195
path:
194196
- target/surefire-reports/html/**
195197

196-
testDiscovery:
197-
type: raw
198-
mode: static
199-
command: grep 'test name' xml/testng_win.xml | awk '{print$2}' | sed 's/name=//g' | sed 's/\x3e//g'
200-
201-
testRunnerCommand: mvn test `-Dplatname=win `-Dmaven.repo.local=./.m2 dependency:resolve `-DselectedTests=$test
202-
203198
jobLabel: ['base1']
204199

205200
```

docs/hyperexecute-running-your-first-job.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ The generic command required to initiate test execution is given below. You will
113113

114114
<div className="lambdatest__codeblock">
115115
<CodeBlock className="language-bash">
116-
{`./hyperexecute --user="${ YOUR_LAMBDATEST_USERNAME()}" --key "${ YOUR_LAMBDATEST_ACCESS_KEY()}" --config "YOUR_YAML_FILE" `}
116+
{`./hyperexecute --user ${ YOUR_LAMBDATEST_USERNAME()} --key ${ YOUR_LAMBDATEST_ACCESS_KEY()} --config "YOUR_YAML_FILE" `}
117117
</CodeBlock>
118118
</div>
119119

0 commit comments

Comments
 (0)