Skip to content

Commit 2c52ade

Browse files
authored
Merge pull request #464 from ansforge/tmc/poc-gatling
Feat : tmc initial setup
2 parents 36c348d + 95756c6 commit 2c52ade

19 files changed

Lines changed: 1177 additions & 0 deletions

tools/tmc/.env.template

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
KEY_PASSPHRASE=
2+
CERTIFICATE_PATH=
3+
TRUST_STORE_PASSWORD=
4+
TRUST_STORE_PATH=
5+
RABBITMQ_HOST=
6+
RABBITMQ_PORT=
7+
EXCHANGE_NAME=

tools/tmc/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.gradle
2+
build
3+
.env

tools/tmc/README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Hub Santé load testing
2+
3+
## Description
4+
5+
TODO :
6+
7+
- [] Lister les scénarios implémentés et avec quelle charge
8+
9+
## Utilisation en local
10+
11+
### Prérequis
12+
13+
- Java 21
14+
- Droits de connexion :
15+
- Disposer du certificat client associé à l'utilisateur des tmc
16+
- Génerer un trustStore avec la root CA IGC Santé (TEST/PROD en fonction de l'environnement visé)
17+
18+
### Environnement
19+
20+
- Dans `tools/tmc`, uppliquer le fichier `.env.template` en le renommant `.env` :
21+
22+
```bash
23+
cp .env.template .env
24+
```
25+
26+
- Remplir le fichier `.env` en référençant
27+
- les paths **absolus** du certificat et du truststore (respectivement `CERTIFICATE_PATH` et `TRUST_STORE_PASSWORD`)
28+
- les mots de passe associés (respectivement `KEY_PASSPHRASE` et `TRUST_STORE_PASSWORD`)
29+
- le host du server RabbitMQ visé (`RABBITMQ_HOST`)
30+
- le port du server RabbitMQ visé (`RABBITMQ_PORT`)
31+
- le nom de l'exchange visé pour la publication des messages sur le server RabbitMQ (`EXCHANGE_NAME`)
32+
33+
Note : l'exposition des variables d'environnement via fichier `.env` est géré en dev local par la librairie [dotenv-java](https://github.com/cdimascio/dotenv-java).
34+
35+
### Lancement des tests
36+
37+
Pour lancer la simulation `PublishExample` utiliser la commande :
38+
39+
```bash
40+
./gradlew gatlingRun --simulation example.PublishExample
41+
```
42+
43+
## Architecture technique
44+
45+
Sur Confluence sont disponibles [l'expression de besoin](https://ans-esante.atlassian.net/wiki/spaces/HUB/pages/1256292572/Expression+de+besoin) et la [stratégie technique](https://ans-esante.atlassian.net/wiki/spaces/HUB/pages/1257865233/Strat+gie+Technique) retenue pour l'implémentation des tests de montée en charge sur le Hub Santé.
46+
47+
Le document de stratégie technique contient notamment un ADR sur le choix de Gatling par rapport aux autres offres disponibles sur le marché.
48+
49+
Note : la version de Gatling utilisée ici est la `3.11.3`. Il en est ainsi car il s'agit la version la plus récente utilisable avec le plugin [gatling-amqp](https://github.com/galax-io/gatling-amqp-plugin).
50+
51+
## Archive : Gatling default readme
52+
53+
Gatling plugin for Gradle - Java demo project
54+
55+
=============================================
56+
57+
A simple showcase of a Gradle project using the Gatling plugin for Gradle. Refer to the plugin documentation
58+
[on the Gatling website](https://gatling.io/docs/current/extensions/gradle_plugin/) for usage.
59+
60+
This project includes:
61+
62+
- Gradle Wrapper, so you don't need to install Gradle (a JDK must be installed and $JAVA_HOME configured)
63+
- minimal `build.gradle` leveraging Gradle wrapper
64+
- latest version of `io.gatling.gradle` plugin applied
65+
- sample [Simulation](https://gatling.io/docs/gatling/reference/current/general/concepts/#simulation) class,
66+
demonstrating sufficient Gatling functionality
67+
- proper source file layout

tools/tmc/build.gradle

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
plugins {
2+
id 'java'
3+
// The following line allows to load io.gatling.gradle plugin and directly apply it
4+
id 'io.gatling.gradle' version '3.11.3'
5+
}
6+
7+
dependencies {
8+
gatling("org.galaxio:gatling-amqp-plugin_2.13:0.14.0")
9+
gatling("io.github.cdimascio:dotenv-java:3.2.0")
10+
}
11+
12+
gatling {
13+
enterprise {
14+
// Enterprise Cloud (https://cloud.gatling.io/) configuration reference: https://gatling.io/docs/gatling/reference/current/extensions/gradle_plugin/#working-with-gatling-enterprise-cloud
15+
// Enterprise Self-Hosted configuration reference: https://gatling.io/docs/gatling/reference/current/extensions/gradle_plugin/#working-with-gatling-enterprise-self-hosted
16+
}
17+
}
18+
19+
repositories {
20+
mavenCentral()
21+
}
61.9 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

tools/tmc/gradlew

Lines changed: 248 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)