Skip to content

Commit

Permalink
Add the application and the simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
SamirPS committed Sep 27, 2024
0 parents commit 4b4c0a9
Show file tree
Hide file tree
Showing 60 changed files with 1,003,056 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/gatling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Run Gatling Enterprise Simulation

on:
workflow_dispatch:
inputs:
simulation_id:
type: string
required: true

jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Gatling Enterprise Action
uses: gatling/enterprise-action@v1
working-directory: ./gatling
with:
api_token: ${{ secrets.GATLING_ENTERPRISE_API_TOKEN }}
simulation_id: ${{ inputs.simulation_id }}
24 changes: 24 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build

on:
push:
branches:
- '**'

jobs:
test:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Test
working-directory: ./testcontainers
run: ./mvnw test
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

# Gatling X Testcontainer

This GitHub repository hosts the Gatling simulation and application from TestContainer that we showcased during our webinar featuring speakers @shelajev and @SamirPS.

## Webinar Details

You can watch the webinar recording here:
[Boost Your App's Performance: Effective Load Testing with Gatling, Testcontainers, and Docker](https://app.livestorm.co/gatling/boost-your-apps-performance-effective-load-testing-with-gatling-testcontainers-and-docker/live#/)

## Running the Simulation and the ProjectÒ

For detailed instructions on how to run this simulation, please refer to our comprehensive article: [Link to be added]

## Prerequisites

- Gatling
- TestContainers
- Docker

## To Go Further

* [Testcontainers Official Website](https://testcontainers.com/)
* [Link to Gatling Documentation](https://docs.gatling.io/)

## Support

If you encounter any issues or have questions, please open an issue on this repository.

## Acknowledgements

Special thanks to @shelajev and @SamirPS for their contributions to the webinar and this project.
Binary file added gatling/.DS_Store
Binary file not shown.
55 changes: 55 additions & 0 deletions gatling/.gatling/example.package.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Learn more about Configuration as Code: https://docs.gatling.io/reference/execute/cloud/user/configuration-as-code
# This file is full deployment configuration file example.
# Please note all these configuration fields, or even this file, are optional.

gatling.enterprise.package {
# Consistent deployment using an existing package ID
# https://docs.gatling.io/reference/execute/cloud/user/configuration-as-code/#consistent-deployment-with-id
# id = "00000000-0000-0000-0000-000000000000"
name = "My package name"
team = "Default team" # or ID with team = "00000000-0000-0000-0000-000000000000"
default {
simulation {
locations = [
{
name: "Europe - Paris",
size: 2,
weight: 30
},
{
name: "AP Pacific - Mumbai",
size: 2,
weight: 70
}
]
parameters {
ignoreDefaults = false
systemProperties {
# System properties names should be surrounded by quotes
# Otherwise, it would be interpreted as HOCON keys
"com.example.prop.1" = "default value from system prop 1"
"com.example.prop.2" = "default value from system prop 2"
}
environmentVariables {
MY_SIMULATION_ENV_VAR_1 = "default value from environment 1"
MY_SIMULATION_ENV_VAR_2 = "default value from environment 2"
}
}
timeWindow {
rampUp = 10 # in seconds
rampDown = 10 # in seconds
}
}
}
simulations = [
{
# Consistent deployment using an existing simulation ID
# https://docs.gatling.io/reference/execute/cloud/user/configuration-as-code/#consistent-deployment-with-id
# id = "00000000-0000-0000-0000-000000000001"
name = "My simulation name"
# FQCN Fully Qualified Class Name
classname = "gatlingandtestcontainers.GatlingAndTestContainersSimulation"
}
]
}

3 changes: 3 additions & 0 deletions gatling/.gatling/package.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# See `example.package.conf` for a full deployment configuration file example
# Learn more about Configuration as Code: https://docs.gatling.io/reference/execute/cloud/user/configuration-as-code

2 changes: 2 additions & 0 deletions gatling/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
/.mvn/wrapper/*.jar
18 changes: 18 additions & 0 deletions gatling/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar
18 changes: 18 additions & 0 deletions gatling/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Gatling Simulation
============================================

A simple showcase of a Maven project using the Gatling plugin for Maven. Refer to the plugin documentation
[on the Gatling website](https://gatling.io/docs/current/extensions/maven_plugin/) for usage.

This project is written in Java, others are available for [Kotlin](https://github.com/gatling/gatling-maven-plugin-demo-kotlin)
and [Scala](https://github.com/gatling/gatling-maven-plugin-demo-scala).

It includes:

* [Maven Wrapper](https://maven.apache.org/wrapper/), so that you can immediately run Maven with `./mvnw` without having
to install it on your computer
* minimal `pom.xml`
* latest version of `io.gatling:gatling-maven-plugin` applied
* sample [Simulation](https://gatling.io/docs/gatling/reference/current/general/concepts/#simulation) class,
demonstrating sufficient Gatling functionality
* proper source file layout
Loading

0 comments on commit 4b4c0a9

Please sign in to comment.