Skip to content

Commit

Permalink
Add a version check
Browse files Browse the repository at this point in the history
  • Loading branch information
andyundso committed Jul 28, 2024
1 parent 81b45f9 commit abf35fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ jobs:
env:
FORCE_ENCRYPTION: ${{ matrix.force-encryption }}
SA_PASSWORD: "bHuZH81%cGC6"
VERSION: ${{ matrix.version }}
13 changes: 13 additions & 0 deletions test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ else {
Write-Output "Checking if SQL Server is available ..."
& sqlcmd -S 127.0.0.1 -U sa -P $env:SA_PASSWORD -Q "SELECT 1"

Write-Output "Check if requested version was installed ..."
$sqlcmdOutput = & sqlcmd -S 127.0.0.1 -U sa -P $env:SA_PASSWORD -Q "SELECT @@VERSION" -h -1
$result = $sqlcmdOutput | Select-String -Pattern "Microsoft SQL Server (\d+)"

if ($result.Matches.Groups[1].Value -Eq $env:VERSION) {
Write-Output "Installled version matches expected version $env:VERSION"
}
else {
Write-Error "Installed version does not match expected version $env:VERSION"
Write-Error "sqlcmd output: $sqlcmdOutput"
exit 1
}

Write-Output "Check status of connection encryption ..."

$sqlQuery = @"
Expand Down

0 comments on commit abf35fc

Please sign in to comment.