diff options
Diffstat (limited to 'scripts/test-mssql.sh')
| -rwxr-xr-x | scripts/test-mssql.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/test-mssql.sh b/scripts/test-mssql.sh new file mode 100755 index 0000000..1569992 --- /dev/null +++ b/scripts/test-mssql.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -e + +echo "Running MSSQL tests..." +env $(cat .env.mssql | xargs) docker-compose -f docker-compose.mssql.yml up -d + +echo "Waiting for MSSQL to be ready..." +sleep 20 + +# Read password from .env.mssql if available +MSSQL_PASSWORD="${MSSQL_SA_PASSWORD:-YourStrong@Passw0rd}" + +until docker exec bolt_mssql_db /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$MSSQL_PASSWORD" -Q "SELECT 1" &>/dev/null; do + echo "Waiting for MSSQL..." + sleep 5 +done +echo "MSSQL is ready." + +env $(cat .env.mssql | xargs) go test -p 1 -tags "mssql" -covermode=count -coverprofile=coverage-mssql.out ./... + +docker-compose -f docker-compose.mssql.yml down +echo "MSSQL tests completed." |