diff --git a/services/commtest/tests/backup_performance_test.rs b/services/commtest/tests/backup_performance_test.rs new file mode 100644 index 000000000..2ba9adaf0 --- /dev/null +++ b/services/commtest/tests/backup_performance_test.rs @@ -0,0 +1,7 @@ +#[path = "./lib/tools.rs"] +mod tools; + +#[tokio::test] +async fn backup_performance_test() { + assert!(false, "not implemented"); +} diff --git a/services/commtest/tests/blob_performance_test.rs b/services/commtest/tests/blob_performance_test.rs new file mode 100644 index 000000000..209ae5e91 --- /dev/null +++ b/services/commtest/tests/blob_performance_test.rs @@ -0,0 +1,7 @@ +#[path = "./lib/tools.rs"] +mod tools; + +#[tokio::test] +async fn blob_performance_test() { + assert!(false, "not implemented"); +} diff --git a/services/package.json b/services/package.json index 3777de5e3..24f311544 100644 --- a/services/package.json +++ b/services/package.json @@ -1,25 +1,26 @@ { "name": "services", "version": "1.0.0", "private": true, "license": "BSD-3-Clause", "scripts": { "build-all": "./scripts/build_base_image.sh && docker-compose build", "build-base-image": "./scripts/build_base_image.sh", "run-tunnelbroker-service": "./scripts/run_server_image.sh tunnelbroker", "run-tunnelbroker-service-in-sandbox": "COMM_SERVICES_SANDBOX=1 ./scripts/run_server_image.sh tunnelbroker", "build-backup-base": "./scripts/build_base_image.sh && docker-compose build backup-base", "run-backup-service": "./scripts/run_server_image.sh backup", "run-backup-service-in-sandbox": "COMM_SERVICES_SANDBOX=1 ./scripts/run_server_image.sh backup", "build-blob-base": "./scripts/build_base_image.sh && docker-compose build blob-base", "run-blob-service": "./scripts/run_server_image.sh blob", "run-blob-service-in-sandbox": "COMM_SERVICES_SANDBOX=1 ./scripts/run_server_image.sh blob", "run-all-services": "./scripts/run_all_services.sh", "run-unit-tests": "./scripts/run_unit_tests.sh", "run-integration-tests": "./scripts/run_integration_tests.sh", + "run-performance-tests": "./scripts/run_performance_tests.sh", "run-all-services-in-sandbox": "COMM_SERVICES_SANDBOX=1 ./scripts/run_all_services.sh", "init-local-cloud": "./scripts/init_local_cloud.sh", "delete-local-cloud": "docker-compose down -v", "reset-local-cloud": "yarn delete-local-cloud && yarn init-local-cloud" } } diff --git a/services/scripts/run_performance_tests.sh b/services/scripts/run_performance_tests.sh new file mode 100755 index 000000000..1910002ef --- /dev/null +++ b/services/scripts/run_performance_tests.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +set -e + +SERVICES=$(./scripts/list_services.sh) + +run_performance_test () { + echo "performance tests tests will be run for the $1 service" + # add -- --nocapture in the end to enable logs + cargo test "$1"_performance_test --test '*' --manifest-path=commtest/Cargo.toml #-- --nocapture +} + +list_expected () { + echo "Expected one of these:"; + echo "$SERVICES"; + echo "all"; +} + +if [[ -z "$1" ]]; then + echo "No service specified" >&2 + list_expected; + exit 1 +fi + +if [[ "$1" == "all" ]]; then + for SERVICE in "$SERVICES"; do + run_performance_test "$SERVICE" + done + exit 0; +fi; + +SERVICE=$(grep "$1" <<< "$SERVICES") + +if [[ "$SERVICE" != "$1" ]]; then + echo "No such service: $1"; + list_expected; + exit 1; +fi; + +SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd -P) + +set -o allexport +source "$SCRIPT_DIR/../.env" +set +o allexport + +run_performance_test "$SERVICE"