Skip to content

Commit

Permalink
Merge pull request #298 from opensafely-core/fix-mssql-ci
Browse files Browse the repository at this point in the history
Update the version of mssql used in tests
  • Loading branch information
rebkwok authored Oct 8, 2024
2 parents 56403f6 + 504d88d commit aa69672
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion tests/databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ def make_mssql_database(containers):
def run_mssql(container_name, containers, password, mssql_port): # pragma: no cover
containers.run_bg(
name=container_name,
image="mcr.microsoft.com/mssql/server:2017-CU25-ubuntu-16.04",
# This is *not* the version that TPP run for us in production which, as of
# 2024-09-24, is SQL Server 2016 (13.0.5893.48). That version is not available
# as a Docker image, so we run the oldest supported version instead. Both the
# production server and our test server set the "compatibility level" to the
# same value so the same feature set should be supported.
image="mcr.microsoft.com/mssql/server:2019-CU28-ubuntu-20.04",
volumes={
MSSQL_SETUP_DIR: {"bind": "/mssql", "mode": "ro"},
},
Expand Down
2 changes: 1 addition & 1 deletion tests/support/mssql/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if [ "$1" = '/opt/mssql/bin/sqlservr' ]; then
timeout=20
limit="$((SECONDS + timeout))"
# Run the setup script to create the DB and the schema in the DB
until /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "Your_password123!" -d master -i /mssql/setup.sql; do
until /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P "Your_password123!" -d master -C -i /mssql/setup.sql; do
# Wait a bit for SQL Server to start. SQL Server's process
# doesn't provide a clever way to check if it's up or not, and
# it needs to be up before we can import the application
Expand Down

0 comments on commit aa69672

Please sign in to comment.