From a835667f0cbdd66e1781424691def58c74137778 Mon Sep 17 00:00:00 2001 From: Nathan Lie Date: Thu, 1 Aug 2024 13:53:14 -0700 Subject: [PATCH] feat: run script in docker container --- test/performance/README.md | 2 +- test/performance/package.json | 3 ++- test/performance/scripts/run-tests.sh | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/performance/README.md b/test/performance/README.md index caee94ef51..55c98987af 100644 --- a/test/performance/README.md +++ b/test/performance/README.md @@ -23,5 +23,5 @@ The test makes a few checks to verify the local playground is running, then runs The test can also be run inside of a Docker container on the same Docker network as the Local Playground: ``` -pnpm --filter performance run-docker-tests +pnpm --filter performance run-tests-docker ``` diff --git a/test/performance/package.json b/test/performance/package.json index 9d350c62e0..64414cd095 100644 --- a/test/performance/package.json +++ b/test/performance/package.json @@ -4,8 +4,9 @@ "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", - "docker-run-tests": "./scripts/run-docker-tests.sh", + "run-tests-docker": "./scripts/run-tests.sh --docker", "hostile": "hostile" }, "keywords": [], diff --git a/test/performance/scripts/run-tests.sh b/test/performance/scripts/run-tests.sh index 1c27d17954..f08d8486a5 100755 --- a/test/performance/scripts/run-tests.sh +++ b/test/performance/scripts/run-tests.sh @@ -49,5 +49,9 @@ addHost "happy-life-bank-backend" addHost "happy-life-bank-auth" # run tests -pnpm --filter performance test +if [[ $* == *--docker* ]]; then + pnpm --filter performance test-docker +else + pnpm --filter performance test +fi exit $?