-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add prism agent benchmarks project (#334)
Supported simulations: * Connection protocol simulation * Credential Issuance protocol simulation
- Loading branch information
abalias
authored
Jan 31, 2023
1 parent
fda6899
commit 4f35430
Showing
17 changed files
with
1,118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Performance tests | ||
|
||
concurrency: | ||
group: ${{ github.head_ref }}${{ github.ref }}-performance-tests | ||
cancel-in-progress: true | ||
|
||
on: | ||
schedule: | ||
- cron: "0 3 * * *" | ||
pull_request: | ||
paths: | ||
- ".github/workflows/performance-tests.yml" | ||
- "tests/performance-tests/**" | ||
push: | ||
branches: | ||
- "main" | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: "tests/performance-tests/prism-performance-tests" | ||
|
||
jobs: | ||
run-e2e-tests: | ||
name: "Run performance tests" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Java and Scala | ||
uses: olafurpg/setup-scala@v13 | ||
with: | ||
java-version: [email protected] | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.ATALA_GITHUB_ACTOR }} | ||
password: ${{ secrets.ATALA_GITHUB_TOKEN }} | ||
|
||
- name: Install Compose | ||
uses: ndeloof/[email protected] | ||
with: | ||
version: v2.12.2 # defaults to 'latest' | ||
legacy: true # will also install in PATH as `docker-compose` | ||
|
||
- name: Start services for issuer | ||
env: | ||
PORT: 8080 | ||
uses: isbang/[email protected] | ||
with: | ||
compose-file: "./infrastructure/shared/docker-compose.yml" | ||
compose-flags: "--env-file ./infrastructure/local/.env -p issuer" | ||
up-flags: "--wait" | ||
down-flags: "--volumes" | ||
|
||
- name: Start services for holder | ||
env: | ||
PORT: 8090 | ||
uses: isbang/[email protected] | ||
with: | ||
compose-file: "./infrastructure/shared/docker-compose.yml" | ||
compose-flags: "--env-file ./infrastructure/local/.env -p holder" | ||
up-flags: "--wait" | ||
down-flags: "--volumes" | ||
|
||
- name: Run performance tests | ||
run: | | ||
./gradlew gatlingRun | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: performance-tests-results | ||
path: tests/performance-tests/prism-performance-tests/build/reports |
21 changes: 21 additions & 0 deletions
21
tests/performance-tests/prism-performance-tests/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.gradle | ||
**/build/ | ||
!src/**/build/ | ||
|
||
# Ignore Gradle GUI config | ||
gradle-app.setting | ||
|
||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||
!gradle-wrapper.jar | ||
|
||
# Avoid ignore Gradle wrappper properties | ||
!gradle-wrapper.properties | ||
|
||
# Cache of project | ||
.gradletasknamecache | ||
|
||
# Eclipse Gradle plugin generated files | ||
# Eclipse Core | ||
.project | ||
# JDT-specific (Eclipse Java Development Tools) | ||
.classpath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Atala PRISM V2 Performance Gatling Project | ||
|
||
Welcome to performance measurements project for Atala PRISM V2. | ||
|
||
The project is written on Kotlin and uses [Gatling](https://gatling.io/) load test framework. | ||
|
||
## Project structure | ||
|
||
The project is divided by the following main modules: | ||
* `common`: general module for constants and utility functions | ||
* `simulations`: Gatling simulations | ||
* `steps`: simulation steps that can be combined into simulations later | ||
|
||
## Running simulations | ||
|
||
To run all simulations, use the following command: | ||
```shell | ||
./gradlew gatlingRun | ||
``` | ||
|
||
To run a specific simulation, specify the full path to the required simulation file. | ||
For example, running `ConnectionSimulation` from `simulations` package: | ||
```shell | ||
./gradlew gatlingRun-simulations.ConnectionSimulation | ||
``` | ||
|
||
## Environments configuration | ||
|
||
There are multiple configuration environment variables available through `common.Configuration` module: | ||
* `ISSUER_AGENT_URL`: URL for Issuer Agent, example: `http://localhost:8080/prism-agent` | ||
* `ISSUER_AGENT_API_KEY`: access key for Issuer agent if hosted on remote env | ||
* `HOLDER_AGENT_URL`: URL for Holder Agent, example: `http://localhost:8090/prism-agent` | ||
* `HOLDER_AGENT_API_KEY`: access key for Holder agent if hosted on remote env |
31 changes: 31 additions & 0 deletions
31
tests/performance-tests/prism-performance-tests/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
kotlin("jvm") version "1.7.21" | ||
id("io.gatling.gradle") version "3.9.0.2" | ||
} | ||
|
||
group = "io.atala.prism" | ||
version = "0.1.0" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
gatling { | ||
logLevel = "WARN" | ||
// set to 'ALL' for all HTTP traffic in TRACE, 'FAILURES' for failed HTTP traffic in DEBUG | ||
logHttp = io.gatling.gradle.LogHttp.NONE | ||
} | ||
|
||
dependencies { | ||
testImplementation(kotlin("test")) | ||
} | ||
|
||
tasks.test { | ||
useJUnitPlatform() | ||
} | ||
|
||
tasks.withType<KotlinCompile> { | ||
kotlinOptions.jvmTarget = "1.8" | ||
} |
1 change: 1 addition & 0 deletions
1
tests/performance-tests/prism-performance-tests/gradle.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
kotlin.code.style=official |
Binary file added
BIN
+58.4 KB
tests/performance-tests/prism-performance-tests/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions
5
tests/performance-tests/prism-performance-tests/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.