Skip to content

Commit abf35fc

Browse files
committed
Add a version check
1 parent 81b45f9 commit abf35fc

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Diff for: .github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ jobs:
6060
env:
6161
FORCE_ENCRYPTION: ${{ matrix.force-encryption }}
6262
SA_PASSWORD: "bHuZH81%cGC6"
63+
VERSION: ${{ matrix.version }}

Diff for: test.ps1

+13
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ else {
99
Write-Output "Checking if SQL Server is available ..."
1010
& sqlcmd -S 127.0.0.1 -U sa -P $env:SA_PASSWORD -Q "SELECT 1"
1111

12+
Write-Output "Check if requested version was installed ..."
13+
$sqlcmdOutput = & sqlcmd -S 127.0.0.1 -U sa -P $env:SA_PASSWORD -Q "SELECT @@VERSION" -h -1
14+
$result = $sqlcmdOutput | Select-String -Pattern "Microsoft SQL Server (\d+)"
15+
16+
if ($result.Matches.Groups[1].Value -Eq $env:VERSION) {
17+
Write-Output "Installled version matches expected version $env:VERSION"
18+
}
19+
else {
20+
Write-Error "Installed version does not match expected version $env:VERSION"
21+
Write-Error "sqlcmd output: $sqlcmdOutput"
22+
exit 1
23+
}
24+
1225
Write-Output "Check status of connection encryption ..."
1326

1427
$sqlQuery = @"

0 commit comments

Comments
 (0)