Skip to content

Commit

Permalink
Try to fix MS SQL Server integration tests (see: microsoft/mssql-dock…
Browse files Browse the repository at this point in the history
  • Loading branch information
eputtone committed Sep 11, 2024
1 parent 43368f4 commit 1f719ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/setup-db-sqlserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ DB_VERSION=${DB_VERSION:-latest}
case $DB_VERSION in
old)
DB_VERSION=2017-latest # supported until 2027
SQLCMD_EXEC=/opt/mssql-tools/bin/sqlcmd
;;
latest)
DB_VERSION=2022-latest
SQLCMD_EXEC="/opt/mssql-tools18/bin/sqlcmd -C"
;;
esac

$tool run --pull=always --rm --name mssql -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=passWord1%' --publish 1433:1433 --detach mcr.microsoft.com/mssql/server:$DB_VERSION

grep -F -m1 'Recovery is complete' <(timeout 240 $tool logs -f mssql 2>&1)

sqlcmd="$tool exec -t mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x"
sqlcmd="$tool exec -t mssql $SQLCMD_EXEC -S localhost -U sa -P passWord1% -e -x"
$sqlcmd -Q "create database nflow"
$sqlcmd -d nflow -Q "create login [nflow] with password='FC8%1knw', default_database=[nflow]"
$sqlcmd -d nflow -Q "create user [nflow] for login [nflow] with default_schema=[nflow]"
Expand Down

0 comments on commit 1f719ff

Please sign in to comment.