You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: content/guides/gitlab-ci-integration/index.md
+37-29
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,7 @@ date: 2025-03-11T13:35:00+02:00
11
11
12
12
---
13
13
14
-
At Gatling, we strongly believe the shift-left approach is fundamental to ensuring application quality. This methodology, which involves integrating testing as early as possible in the development cycle, is particularly crucial for performance testing. Detecting and resolving performance issues before production deployment helps prevent critical and costly situations.
15
-
16
-
In this guide, we demonstrate how to integrate performance testing into your CI/CD pipeline using Gatling and Gitlab CI. This approach enables you to automate your performance tests and ensure application reliability.
14
+
Performance testing is a critical component of modern software development. By integrating Gatling Enterprise with GitLab CI, you can incorporate performance testing into your development workflow, ensuring your applications meet performance standards before reaching production.
17
15
18
16
## Prerequisites
19
17
@@ -25,66 +23,76 @@ In this guide, we demonstrate how to integrate performance testing into your CI/
25
23
26
24
### Create the Scenario
27
25
28
-
In this tutorial, we create a small scenario using our JS SDK. Our users will load the home page of our [e-commerce website demo](https://ecomm.gatling.io/).
26
+
Let's create a simple scenario that loads our [e-commerce demo website](https://ecomm.gatling.io/).
In our example, we generate 1 user coming at once to see if our simulation is working. After that, we define our assertions, which allows us to assert the maximum or minimum response time, the percentage of successful requests, and more. In our case, we only check if we have more than 90% successful requests.
32
+
We'll start with a single user to verify our simulation works correctly. Then we'll add assertionsto validate our test results. In this example, we'll check that more than 90% of requests are successful.
Now that we have our test locally, we need to deploy the package to Gatling Enterprise to create a simulation.
40
+
Now that we have our test ready, we need to deploy the package to Gatling Enterprise.
43
41
44
42
{{< alert info >}}
45
-
This video showcases the JavaScript SDK, but the same process applies to all SDKs that Gatling provides.
43
+
While this video demonstrates the JavaScript SDK specifically, the deployment process remains identical across all Gatling SDKs and CI/CD platforms we support.
46
44
{{< /alert >}}
47
45
48
46
{{< youtube jYPc6lwBAAQ >}}
49
47
50
48
### Create the Simulation
51
49
52
-
Now that our package is on Gatling Enterprise, we need to create a simulation.
50
+
{{< alert info >}}
51
+
This step is applicable to all CI/CD platforms supported by Gatling Enterprise.
52
+
{{< /alert >}}
53
+
54
+
Next, we'll create a simulation in Gatling Enterprise using our deployed package.
53
55
54
56
{{< youtube 7Gb4BcHU0P8 >}}
55
57
56
58
### Copy Your Simulation ID
57
59
58
-
Don't forget to copy your`simulation Id`(click on the three dots to the right of your simulation name); we will need it later.
60
+
Make sure to copy the`simulation Id`by clicking the three dots menu next to your simulation name, as we'll use this ID in subsequent steps.
59
61
60
62
### Create an API Key
61
63
62
-
Now, for Gitlab to communicate with Gatling Enterprise and launch the simulation, you need to create an API key.
64
+
{{< alert info >}}
65
+
This step is applicable to all CI/CD platforms supported by Gatling Enterprise.
66
+
{{< /alert >}}
67
+
68
+
To enable Gitlab CI to interact with Gatling Enterprise and trigger simulations, you'll need to generate an API key.
63
69
64
70
{{< youtube iP4_WM9wTNA >}}
65
71
66
-
Now that everything is set up on the Gatling Enterprise side, it's time to create our CI script on Gitlab.
72
+
With Gatling Enterprise configured, we can now proceed to setting up our GitLab CI pipeline.
67
73
68
74
## Gitlab CI
69
75
70
76
### Set up the Secrets and Environment
71
77
72
-
To successfully launch our workflow, we begin by configuring a secret in our Gitlab repository. This secret is essential for securely managing access to external services and APIs. To add the secret, follow these steps:
78
+
To run simulations from GitLab CI, you'll first need to configure a secure API token. Follow these steps to set up the required variable:
79
+
80
+
1. Navigate to your GitLab repository
81
+
2. Access the `Settings` menu
82
+
3. Select `CI/CD` from the sidebar
83
+
4. Click on `Variables`
84
+
5. Press the `Add variable` button
85
+
6. Choose `Masked and hidden` for `Visibility`
86
+
7. Enter `GATLING_ENTERPRISE_API_TOKEN` as the `Key`
87
+
8. Paste your API token as the `Value`
73
88
74
-
1. Navigate to your Gitlab repository
75
-
2. Go to the `Settings` tab
76
-
3. Click on `CI/CD`
77
-
4. Select `Variables`
78
-
5. Click on the `Add variable` button
79
-
6. Select `Masked and hidden` on `Visibility`
80
-
6. Set `GATLING_ENTERPRISE_API_TOKEN` on `Key`
81
-
7. Set the value of the `GATLING_ENTERPRISE_API_TOKEN` to `Value`
89
+
If you need to generate a new API token, follow our guide [here]({{< ref "../reference/execute/cloud/admin/api-tokens" >}}).
82
90
83
-
If you don't have an API token yet, you can learn how to create one by following the instructions on this [page]({{< ref "../reference/execute/cloud/admin/api-tokens" >}})
91
+
### Configure the Pipeline
84
92
85
-
### Understand the Workflow
93
+
Let's set up a basic GitLab CI pipeline that will run your performance tests. The pipeline configuration will trigger a simulation using the provided **`simulation Id`**.
86
94
87
-
In this example, we configure a workflow which will only start a simulation as already configured and uploaded on Gatling Enterprise.
If you wish to customize this workflow further, refer to our [Gitlab documentation]({{< ref "../reference/integrations/ci-cd/gitlab-ci" >}}) for more details and options.
112
+
For advanced pipeline customization options, check our [GitLab CI documentation]({{< ref "../reference/integrations/ci-cd/gitlab-ci" >}}).
105
113
106
-
### Launch the Workflow
114
+
### Run the Pipeline
107
115
108
-
Now that our requirements are set up, go to Gitlab → Build → Pipeline and click on `new pipeline`. On variable put `SIMULATION_ID` on key and your `simulation Id` you copied before as value and click on `New pipeline`.
116
+
With everything configured, you can now trigger the pipeline from GitLab CI/CD. Provide your **`simulation Id`** when running the pipeline, and you'll be able to monitor the test execution both in GitLab and Gatling Enterprise.
109
117
110
-
{{< youtube Ocv66gH5ZjM >}}
118
+
{{< youtube UqRzLjJqkds >}}
111
119
112
120
## Conclusion
113
121
114
-
Integrating Gatling with Gitlab CI offers a solution for automating performance testing. By adopting this shift-left approach, you can identify and address performance issues early in the development cycle, ensuring higher application quality and reliability.
122
+
Integrating Gatling with GitLab CI provides a robust solution for automated performance testing in your development pipeline. By implementing this shift-left approach, you can identify and address performance issues early in the development cycle, ensuring higher application quality and reliability.
115
123
116
-
This integration streamlines the testing process and enhances efficiency between development teams. With Gatling Enterprise and Gitlab CI, you can create a workflow that monitors your application's performance
124
+
This integration streamlines the testing process and enhances collaboration between development teams. With Gatling Enterprise and GitLab CI, you can create a seamless pipeline that continuously monitors your application's performance, making it easier to maintain high standards of application quality throughout the development lifecycle.
0 commit comments