-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tests): initial performance test (#2828)
* feat(tests): initial performance test * feat: add test shell scripts, run inside docker network * feat: run script in docker container * chore: formatting * chore: remove unused script * fix: update test script parameters * fix: ping wallet address hosts instead of wallet addresses * fix README * feat: move wallet address retrieval into setup function * feat: add another error condition * formatting * fix: typechecks * chore: remove comments * chore: remove empty metadata object
- Loading branch information
Showing
6 changed files
with
301 additions
and
39 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
packages: | ||
- 'packages/*' | ||
- 'localenv/mock-account-servicing-entity' | ||
- 'test/integration' | ||
- 'test/*' | ||
- 'bruno/collections/Rafiki' |
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,30 @@ | ||
# Performance Tests | ||
|
||
This package contains a script that will determine the performance of Rafiki by repeatedly making a series of requests to a Rafiki instance to create several kinds of resources (receivers, quotes, outgoing payments). | ||
|
||
## Prerequisites | ||
|
||
- [Grafana k6](https://grafana.com/docs/k6/latest/set-up/install-k6/) | ||
|
||
- [Grafana k6](https://grafana.com/docs/k6/latest/) is used to run performance test scripts against Rafiki. | ||
|
||
- [Running local playground for Rafiki](../../localenv/README.md) | ||
- It is recommended to start the local playground with Telemetry running in order to see the impact of a performance test. | ||
|
||
If the local environment isn't running it may be started by using the command `pnpm localenv:compose:telemetry:up`. | ||
|
||
## Run tests | ||
|
||
To run the performance tests (of which there is currently only one): | ||
|
||
``` | ||
pnpm --filter performance run-tests | ||
``` | ||
|
||
The test makes a few checks to verify the local playground is running, then runs the k6 binary on the [create-outgoing-payments.js](./scripts/create-outgoing-payments.js) script. | ||
|
||
The test can also be run inside of a Docker container on the same Docker network as the Local Playground: | ||
|
||
``` | ||
pnpm --filter performance run-tests-docker | ||
``` |
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,18 @@ | ||
{ | ||
"name": "performance", | ||
"version": "1.0.0", | ||
"description": "", | ||
"scripts": { | ||
"test": "k6 run ./scripts/create-outgoing-payments.js", | ||
"test-docker": "docker run --rm --network=rafiki_rafiki -v ./scripts:/scripts -i grafana/k6 run /scripts/create-outgoing-payments.js", | ||
"run-tests": "./scripts/run-tests.sh", | ||
"run-tests-docker": "./scripts/run-tests.sh --docker", | ||
"hostile": "hostile" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"hostile": "^1.4.0" | ||
} | ||
} |
Oops, something went wrong.