aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/test-mssql.sh
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2025-10-08 21:46:23 -0400
committerEugene Triguba <hello@eugenetriguba.com>2025-10-08 21:46:23 -0400
commitf4f45436b479d8c6eebcf7a503d3c1e3a73c68b1 (patch)
treeecf372e43c7a6303c59366620c590c544c273988 /scripts/test-mssql.sh
parentUpdate homebrew instructions (diff)
downloadcli-f4f45436b479d8c6eebcf7a503d3c1e3a73c68b1.zip
Add test pipeline with sourcehut
Diffstat (limited to 'scripts/test-mssql.sh')
-rwxr-xr-xscripts/test-mssql.sh22
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."