diff --git a/internal/infrastructure/connector/az_blob.go b/internal/infrastructure/connector/az_blob.go index e69de29..9e29bcb 100644 --- a/internal/infrastructure/connector/az_blob.go +++ b/internal/infrastructure/connector/az_blob.go @@ -0,0 +1 @@ +package connector diff --git a/internal/infrastructure/connector/az_postgres.go b/internal/infrastructure/connector/az_postgres.go index e69de29..9e29bcb 100644 --- a/internal/infrastructure/connector/az_postgres.go +++ b/internal/infrastructure/connector/az_postgres.go @@ -0,0 +1 @@ +package connector diff --git a/internal/infrastructure/connector/az_vault.go b/internal/infrastructure/connector/az_vault.go index e69de29..9e29bcb 100644 --- a/internal/infrastructure/connector/az_vault.go +++ b/internal/infrastructure/connector/az_vault.go @@ -0,0 +1 @@ +package connector diff --git a/scripts/run-test.sh b/scripts/run-test.sh new file mode 100644 index 0000000..e7b4d85 --- /dev/null +++ b/scripts/run-test.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +set -euo pipefail + +SCRIPT_DIR=$(dirname "$BASH_SOURCE") +ROOT_PROJECT_DIR=$SCRIPT_DIR/.. + +cd $ROOT_PROJECT_DIR + +BLUE='\033[0;34m' +NC='\033[0m' + +# Default flag values +RUN_UNIT_TESTS=true +RUN_INTEGRATION_TESTS=true + +# Parse arguments +while getopts "ui" opt; do + case ${opt} in + u) + RUN_UNIT_TESTS=true + RUN_INTEGRATION_TESTS=false + ;; + i) + RUN_UNIT_TESTS=false + RUN_INTEGRATION_TESTS=true + ;; + *) + echo "Usage: $0 [-u] (for unit tests) [-i] (for integration tests)" + exit 1 + ;; + esac +done + +echo "#####################################################################################################" +echo -e "$BLUE INFO: $NC About to run tests based on the flags" + +if [ "$RUN_UNIT_TESTS" = true ]; then + echo -e "$BLUE INFO: $NC Running unit tests..." + go test ./test/unit/... +fi + +if [ "$RUN_INTEGRATION_TESTS" = true ]; then + echo -e "$BLUE INFO: $NC Running integration tests..." + go test ./test/integration +fi + +cd $SCRIPT_DIR diff --git a/test/unit/infrastructure/connector/az_blob_test.go b/test/unit/infrastructure/connector/az_blob_test.go index e69de29..9e29bcb 100644 --- a/test/unit/infrastructure/connector/az_blob_test.go +++ b/test/unit/infrastructure/connector/az_blob_test.go @@ -0,0 +1 @@ +package connector diff --git a/test/unit/infrastructure/connector/az_postgres_test.go b/test/unit/infrastructure/connector/az_postgres_test.go index e69de29..9e29bcb 100644 --- a/test/unit/infrastructure/connector/az_postgres_test.go +++ b/test/unit/infrastructure/connector/az_postgres_test.go @@ -0,0 +1 @@ +package connector diff --git a/test/unit/infrastructure/connector/az_vault_test.go b/test/unit/infrastructure/connector/az_vault_test.go index e69de29..9e29bcb 100644 --- a/test/unit/infrastructure/connector/az_vault_test.go +++ b/test/unit/infrastructure/connector/az_vault_test.go @@ -0,0 +1 @@ +package connector