Skip to content

Commit 0519877

Browse files
trentmPeterEinberger
authored andcommitted
test: modernize our mssql/server Docker image usage (elastic#4150)
- 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: elastic#4147
1 parent 6f2e492 commit 0519877

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

.ci/docker/docker-compose.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@ services:
3131
retries: 30
3232

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

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
image: mcr.microsoft.com/mssql/server
9797
env:
9898
ACCEPT_EULA: 'Y'
99-
SA_PASSWORD: 'Very(!)Secure'
99+
MSSQL_SA_PASSWORD: 'Very(!)Secure'
100100
MSSQL_PID: 'Developer'
101101
ports:
102102
- 1433:1433

examples/trace-tedious.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const apm = require('../').start({
2020
const tedious = require('tedious');
2121

2222
const host = process.env.MSSQL_HOST || 'localhost';
23-
const passwd = process.env.SA_PASSWORD || 'Very(!)Secure';
23+
const passwd = process.env.MSSQL_SA_PASSWORD || 'Very(!)Secure';
2424
const connOpts = {
2525
server: host,
2626
authentication: {

test/docker-compose.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@ services:
3131
retries: 30
3232

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

test/instrumentation/modules/tedious.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if (semver.gte(version, '4.0.0')) {
5151
type: 'default',
5252
options: {
5353
userName: 'SA',
54-
password: process.env.SA_PASSWORD || 'Very(!)Secure',
54+
password: process.env.MSSQL_SA_PASSWORD || 'Very(!)Secure',
5555
},
5656
},
5757
options: {
@@ -65,7 +65,7 @@ if (semver.gte(version, '4.0.0')) {
6565
connOpts = {
6666
server: hostname,
6767
userName: 'SA',
68-
password: process.env.SA_PASSWORD || 'Very(!)Secure',
68+
password: process.env.MSSQL_SA_PASSWORD || 'Very(!)Secure',
6969
};
7070
}
7171

0 commit comments

Comments
 (0)