Skip to content

Commit

Permalink
test: modernize our mssql/server Docker image usage
Browse files Browse the repository at this point in the history
- move to the latest CU (cumulative update) of SQLServer 2022
  (which involves updating the healthcheck for internal changes)
- use MSSQL_SA_PASSWORD rather than the long since deprecated SA_PASSWORD

Refs: #4147
  • Loading branch information
trentm committed Jul 25, 2024
1 parent 4818c65 commit f640b1d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions .ci/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ services:
retries: 30

mssql:
# Cumulative update 14 (CU14), released 2024-07-23, breaks the healthcheck.
# See https://github.com/elastic/apm-agent-nodejs/issues/4147
image: mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04
# Tags listed at https://hub.docker.com/r/microsoft/mssql-server
# Docs: https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker
image: mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04
platform: linux/amd64
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=Very(!)Secure
- MSSQL_SA_PASSWORD=Very(!)Secure
- MSSQL_PID=Developer
ports:
- "1433:1433"
volumes:
- nodemssqldata:/var/opt/mssql
healthcheck:
test: ["CMD", "/opt/mssql-tools/bin/sqlcmd", "-S", "mssql", "-U", "sa", "-P", "Very(!)Secure", "-Q", "select 1"]
interval: 30s
test: ["CMD", "/opt/mssql-tools18/bin/sqlcmd", "-C", "-S", "mssql", "-U", "sa", "-P", "Very(!)Secure", "-Q", "select 1"]
interval: 10s
timeout: 10s
retries: 5

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
image: mcr.microsoft.com/mssql/server
env:
ACCEPT_EULA: 'Y'
SA_PASSWORD: 'Very(!)Secure'
MSSQL_SA_PASSWORD: 'Very(!)Secure'
MSSQL_PID: 'Developer'
ports:
- 1433:1433
Expand Down
2 changes: 1 addition & 1 deletion examples/trace-tedious.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const apm = require('../').start({
const tedious = require('tedious');

const host = process.env.MSSQL_HOST || 'localhost';
const passwd = process.env.SA_PASSWORD || 'Very(!)Secure';
const passwd = process.env.MSSQL_SA_PASSWORD || 'Very(!)Secure';
const connOpts = {
server: host,
authentication: {
Expand Down
12 changes: 6 additions & 6 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ services:
retries: 30

mssql:
# Cumulative update 14 (CU14), released 2024-07-23, breaks the healthcheck.
# See https://github.com/elastic/apm-agent-nodejs/issues/4147
image: mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04
# Tags listed at https://hub.docker.com/r/microsoft/mssql-server
# Docs: https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker
image: mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04
platform: linux/amd64
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=Very(!)Secure
- MSSQL_SA_PASSWORD=Very(!)Secure
- MSSQL_PID=Developer
ports:
- "1433:1433"
volumes:
- nodemssqldata:/var/opt/mssql
healthcheck:
test: ["CMD", "/opt/mssql-tools/bin/sqlcmd", "-S", "mssql", "-U", "sa", "-P", "Very(!)Secure", "-Q", "select 1"]
interval: 30s
test: ["CMD", "/opt/mssql-tools18/bin/sqlcmd", "-C", "-S", "mssql", "-U", "sa", "-P", "Very(!)Secure", "-Q", "select 1"]
interval: 10s
timeout: 10s
retries: 5

Expand Down
4 changes: 2 additions & 2 deletions test/instrumentation/modules/tedious.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if (semver.gte(version, '4.0.0')) {
type: 'default',
options: {
userName: 'SA',
password: process.env.SA_PASSWORD || 'Very(!)Secure',
password: process.env.MSSQL_SA_PASSWORD || 'Very(!)Secure',
},
},
options: {
Expand All @@ -65,7 +65,7 @@ if (semver.gte(version, '4.0.0')) {
connOpts = {
server: hostname,
userName: 'SA',
password: process.env.SA_PASSWORD || 'Very(!)Secure',
password: process.env.MSSQL_SA_PASSWORD || 'Very(!)Secure',
};
}

Expand Down

0 comments on commit f640b1d

Please sign in to comment.