Skip to content

Stand-alone uber-jar for performance-test #5552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions performance-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ Setup your AWS credentials to meet your needs. Then run a command similar to the
./gradlew :performance-test:compileGatlingJava
```

### Deploying

You can also create an uber-jar that has everything needed to run the Gatling performance tests so that you can
deploy them easily.

```shell
./gradlew :performance-test:assemble
```

This will create an uber jar in `performance-test/build/libs` with the name `opensearch-data-prepper-performance-test-${VERSION}.jar`

You can run this using a command similar to the following.

```shell
java -jar performance-test/build/libs/opensearch-data-prepper-performance-test-2.11.0-SNAPSHOT.jar -s org.opensearch.dataprepper.test.performance.StaticRequestSimulation
```

# Gatling Documentation
[Gatling Quickstart](https://gatling.io/docs/gatling/tutorials/quickstart/)
[Gatling Advanced Simulations](https://gatling.io/docs/gatling/tutorials/advanced/)
Expand Down
25 changes: 24 additions & 1 deletion performance-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
plugins {
id 'java'
id 'io.gatling.gradle' version '3.10.4'
id 'com.gradleup.shadow' version '8.3.6'
}

configurations.all {
Expand Down Expand Up @@ -47,6 +48,28 @@ dependencies {
}
}

jar {
from(sourceSets.gatling.output)
}

tasks.shadowJar {
archiveBaseName = "${project.rootProject.name}-${project.name}"
archiveClassifier = ''
archiveVersion = "${project.rootProject.version}"
configurations = [project.configurations.gatlingRuntimeClasspath]
manifest {
attributes 'Main-Class': 'io.gatling.app.Gatling'
}
}

tasks.named('shadowJar').configure {
dependsOn 'jar'
}

tasks.named('assemble').configure {
dependsOn('shadowJar')
}

test {
useJUnitPlatform()
}
}
Loading