Skip to content

Commit 0375aa7

Browse files
Merge pull request LambdaTest#1774 from amanchopra1905/stage
updated the gattling doc -feedback
2 parents 3571fb7 + 8c3c1fd commit 0375aa7

File tree

1 file changed

+98
-2
lines changed

1 file changed

+98
-2
lines changed

docs/hyperexecute-gattling-testing.md

Lines changed: 98 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,26 @@ import TabItem from '@theme/TabItem';
5454
></script>
5555
Gatling is an open-source load and performance testing framework designed for testing web applications. It uses a powerful Scala-based DSL to define test scenarios and is capable of simulating thousands of concurrent users, making it ideal for stress and performance testing.
5656

57-
This guide provides a structured approach to integrating the Gatling performance testing framework with the LambdaTest HyperExecute platform
57+
## 🚀 Why Choose HyperExecute for Gatling Performance Testing?
58+
While Gatling is powerful on its own, running large-scale performance tests using traditional setups often introduces significant bottlenecks:
59+
60+
### ⚠️ Common Challenges with Traditional Runners
61+
- **Infrastructure Limitations:** Tests run sequentially or on underpowered machines, leading to long execution times.
62+
- **Manual Setup & Maintenance:** Developers must handle environment configuration, dependency resolution, and runtime orchestration manually.
63+
- **Limited Scalability:** Scaling tests across multiple machines requires complex setup and resource coordination.
64+
- **Debugging Overhead:** Analyzing failures or performance issues often involves sifting through scattered logs and inconsistent outputs.
65+
66+
### ✅ How HyperExecute Solves These Challenges
67+
LambdaTest’s HyperExecute platform is purpose-built to streamline and supercharge your Gatling test execution:
68+
69+
- **⚡ Smart Test Distribution:** Automatically splits and runs tests across multiple machines for faster execution and optimal resource utilization.
70+
- **🧪 Isolated, Reproducible Environments:** Each test job runs in its own isolated environment with managed dependencies for consistent results.
71+
- **📊 Built-in Reporting & Artifact Management:** Uploads Gatling reports and logs as artifacts that can be easily accessed and analyzed post-run.
72+
- **🔁 Built-in Retry & Stability Handling:** Supports automatic retries for failed scenarios to minimize false negatives and flakiness.
73+
- **🔍 Deep Debugging Insights:** Rich logs, structured output, and centralized monitoring help you trace performance bottlenecks with ease.
74+
75+
### 🚀 Result: Scalable, Reliable, and Faster Gatling Test Cycles
76+
By integrating Gatling with HyperExecute, you can move beyond traditional limitations and run large-scale load tests with speed, precision, and confidence. This guide provides a structured approach to integrating the Gatling performance testing framework with the LambdaTest HyperExecute platform.
5877

5978
## Prerequisites
6079
To run the Tests on HyperExecute from your Local System, you are required:
@@ -84,6 +103,75 @@ Download the HyperExecute CLI and copy it into the root folder of the downloaded
84103
| macOS | https://downloads.lambdatest.com/hyperexecute/darwin/hyperexecute |
85104

86105
### Step 3: Configure your hyperexecute.yml file
106+
The core of HyperExecute configuration lies in the `hyperexecute.yaml` file. Let’s understand how it is constructed — step by step:
107+
108+
#### 1. Define Test Environment and Execution Strategy
109+
The first step is to define the environment your tests will run on using the runson parameter. You can also configure intelligent parallelization and test exit conditions.
110+
111+
```yaml
112+
version: 0.1
113+
runson: linux # OS to run the tests (e.g., linux, win)
114+
autosplit: true
115+
concurrency: 1 # Defines the number of test sessions to run concurrently
116+
scenarioCommandStatusOnly: true
117+
```
118+
119+
#### 2. Dependency Resolution with Maven
120+
Before running the actual performance test, ensure all project dependencies are resolved locally for a reproducible build. This step pulls all required Maven dependencies to a local directory (.m2), ensuring environment consistency.
121+
122+
```yaml
123+
pre:
124+
- mvn -Dmaven.repo.local=./.m2 dependency:resolve
125+
```
126+
127+
#### 3. Configure Test Discovery (Optional)
128+
Test discovery determines what files or test suites should be run. You can customize this to dynamically scan simulation classes.
129+
130+
```yaml
131+
testDiscovery:
132+
type: raw
133+
mode: static
134+
command: echo "Test"
135+
```
136+
The `command` is a placeholder here. In advanced setups, you can provide a script to programmatically discover test files.
137+
138+
#### 4. Configure the Test Execution Command
139+
Specify the command that runs your Gatling tests via Maven:
140+
141+
```yaml
142+
testRunnerCommand: mvn gatling:test
143+
```
144+
145+
#### 5. Add Background Services (Optional)
146+
If your test depends on a backend server or application under test, you can spin it up in the background:
147+
148+
```yaml
149+
background:
150+
- mvn spring-boot:run -Dspring-boot.run.main-class=dev.simonverhoeven.gatlingdemo.GatlingDemoApplication || true
151+
```
152+
153+
When `autosplit` is enabled, this command can be intelligently distributed across runners.
154+
155+
#### 6. Upload Test Reports
156+
Once the test completes, use uploadArtefacts to store Gatling reports:
157+
158+
```yaml
159+
uploadArtefacts:
160+
- name: TestReport
161+
path:
162+
- target/gatling/**
163+
```
164+
165+
These will be visible in the HyperExecute logs UI after the run.
166+
167+
#### 7. Add Retry Logic (Optional)
168+
You can automatically retry failed tests to avoid flakiness.
169+
170+
```yaml
171+
retryOnFailure: true
172+
maxRetries: 1
173+
```
174+
87175
Here is a complete working YAML configuration that runs Gatling performance tests on linux runners via HyperExecute:
88176

89177
```yaml reference title="hyperexecute.yaml"
@@ -103,4 +191,12 @@ From the project root directory, execute the below CLI command in your terminal:
103191

104192
> **NOTE :** 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**.
105193

106-
<img loading="lazy" src={require('../assets/images/hyperexecute/frameworks/performance_testing/gattling.png').default} alt="automation-dashboard" width="1920" height="868" className="doc_img"/>
194+
<img loading="lazy" src={require('../assets/images/hyperexecute/frameworks/performance_testing/gattling.png').default} alt="automation-dashboard" width="1920" height="868" className="doc_img"/>
195+
196+
## Advanced Parameters
197+
Optimize your test pipeline using the following advanced features:
198+
199+
- ✅ [Smart Test Splitting](/support/docs/hyperexecute-test-splitting-and-multiplexing/) – Automatically distribute tests across parallel runners
200+
- ⚡ [Fail Fast](/support/docs/hyperexecute-failfast/) – Stop test runs on the first failure
201+
- 📊 [Detailed Reports](/support/docs/hyperexecute-reports/) – Real-time terminal logs & rich test reports
202+
- 🔄 [Auto-Healing](/support/docs/hyperexecute-auto-healing/) – Automatically recover from certain failures

0 commit comments

Comments
 (0)