Skip to content

Commit 9f3007e

Browse files
committed
Fix integ test
1 parent cfcb682 commit 9f3007e

File tree

4 files changed

+48
-40
lines changed

4 files changed

+48
-40
lines changed

azure-pipelines.yml

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ stages:
119119
testResultsFormat: 'NUnit'
120120
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
121121
testRunTitle: 'HQRM'
122-
123122
- job: Test_Unit
124123
displayName: 'Unit'
125124
pool:
@@ -156,7 +155,6 @@ stages:
156155
targetPath: '$(buildFolderName)/$(testResultFolderName)/'
157156
artifactName: $(testArtifactName)
158157
parallel: true
159-
160158
- job: Code_Coverage
161159
displayName: 'Publish Code Coverage'
162160
dependsOn: Test_Unit
@@ -195,7 +193,7 @@ stages:
195193
196194
- stage: Integration_Test_Commands_SqlServer
197195
displayName: 'Integration Test Commands - SQL Server'
198-
dependsOn: Build
196+
dependsOn: Quality_Test_and_Unit_Test
199197
jobs:
200198
- job: Test_Integration
201199
displayName: 'Commands'
@@ -352,30 +350,12 @@ stages:
352350
displayName: 'Commands'
353351
strategy:
354352
matrix:
355-
SQL2016_WIN2019:
356-
JOB_VMIMAGE: 'windows-2019'
357-
TEST_CONFIGURATION: 'Integration_SQL2016'
358-
SQL2016_WIN2022:
359-
JOB_VMIMAGE: 'windows-2022'
360-
TEST_CONFIGURATION: 'Integration_SQL2016'
361-
SQL2017_WIN2019:
362-
JOB_VMIMAGE: 'windows-2019'
363-
TEST_CONFIGURATION: 'Integration_SQL2017'
364-
SQL2017_WIN2022:
365-
JOB_VMIMAGE: 'windows-2022'
366-
TEST_CONFIGURATION: 'Integration_SQL2017'
367-
SQL2019_WIN2019:
368-
JOB_VMIMAGE: 'windows-2019'
369-
TEST_CONFIGURATION: 'Integration_SQL2019'
370-
SQL2019_WIN2022:
371-
JOB_VMIMAGE: 'windows-2022'
372-
TEST_CONFIGURATION: 'Integration_SQL2019'
373353
SQL2022_WIN2019:
374354
JOB_VMIMAGE: 'windows-2019'
375-
TEST_CONFIGURATION: 'Integration_SQL2022'
355+
TEST_CONFIGURATION: 'Integration_PowerBI'
376356
SQL2022_WIN2022:
377357
JOB_VMIMAGE: 'windows-2022'
378-
TEST_CONFIGURATION: 'Integration_SQL2022'
358+
TEST_CONFIGURATION: 'Integration_PowerBI'
379359
pool:
380360
vmImage: $(JOB_VMIMAGE)
381361
timeoutInMinutes: 0
@@ -421,7 +401,7 @@ stages:
421401

422402
- stage: Integration_Test_Resources_SqlServer
423403
displayName: 'Integration Test Resources - SQL Server'
424-
dependsOn: Build
404+
dependsOn: Quality_Test_and_Unit_Test
425405
jobs:
426406
- job: Test_Integration
427407
displayName: 'Integration'
@@ -523,7 +503,7 @@ stages:
523503

524504
- stage: Integration_Test_Resources_SqlServer_dbatools
525505
displayName: 'Integration Test Resources - SQL Server (dbatools)'
526-
dependsOn: Build
506+
dependsOn: Quality_Test_and_Unit_Test
527507
jobs:
528508
- job: Test_Integration
529509
displayName: 'Integration'

tests/Integration/Commands/Install-SqlDscBIReportServer.Integration.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ BeforeDiscovery {
2323
}
2424
}
2525

26-
Describe 'Install-SqlDscBIReportServer' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') {
26+
Describe 'Install-SqlDscBIReportServer' -Tag @('Integration_PowerBI') {
2727
BeforeAll {
2828
Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose
2929

tests/Integration/Commands/Install-SqlDscReportingService.Integration.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ BeforeDiscovery {
2323
}
2424
}
2525

26-
Describe 'Install-SqlDscReportingService' -Tag @('Integration_SQL2022') {
26+
Describe 'Install-SqlDscReportingService' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') {
2727
BeforeAll {
2828
Write-Verbose -Message ('Running integration test as user ''{0}''.' -f $env:UserName) -Verbose
2929

@@ -33,7 +33,7 @@ Describe 'Install-SqlDscReportingService' -Tag @('Integration_SQL2022') {
3333
$reportingServicesExecutable = Join-Path -Path $script:temporaryFolder -ChildPath 'SQLServerReportingServices.exe'
3434
}
3535

36-
Context 'When installing SQL Server 2022 Reporting Services' {
36+
Context 'When installing Reporting Services' {
3737
It 'Should run the command without throwing' {
3838
{
3939
# Set splatting parameters for Install-SqlDscReportingService
@@ -51,7 +51,7 @@ Describe 'Install-SqlDscReportingService' -Tag @('Integration_SQL2022') {
5151
} | Should -Not -Throw
5252
}
5353

54-
It 'Should have installed SQL Server 2022 Reporting Services' {
54+
It 'Should have installed Reporting Services' {
5555
# Validate the Reporting Services installation
5656
$reportServerService = Get-Service -Name 'SQLServerReportingServices'
5757

tests/Integration/Commands/Prerequisites.Integration.Tests.ps1

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ BeforeDiscovery {
2525

2626
# CSpell: ignore Remoting
2727
Describe 'Prerequisites' {
28-
Context 'Create required local Windows users' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') {
28+
Context 'Create required local Windows users' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI') {
2929
BeforeAll {
3030
$password = ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force
3131
}
@@ -45,7 +45,7 @@ Describe 'Prerequisites' {
4545
}
4646
}
4747

48-
Context 'Should create required local Windows service accounts' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') {
48+
Context 'Should create required local Windows service accounts' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI') {
4949
BeforeAll {
5050
$password = ConvertTo-SecureString -String 'yig-C^Equ3' -AsPlainText -Force
5151
}
@@ -79,7 +79,7 @@ Describe 'Prerequisites' {
7979
}
8080
}
8181

82-
Context 'Add local Windows users to local groups' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') {
82+
Context 'Add local Windows users to local groups' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI') {
8383
It 'Should add SqlInstall to local administrator group' {
8484
# Add user to local administrator group
8585
Add-LocalGroupMember -Group 'Administrators' -Member 'SqlInstall'
@@ -116,7 +116,7 @@ Describe 'Prerequisites' {
116116
$mediaFile.Name | Should -Be 'media.iso'
117117
}
118118

119-
It 'Should download SQL Server 2022 media' -Tag @('Integration_SQL2022') {
119+
It 'Should download SQL Server 2022 media' -Tag @('Integration_SQL2022', 'Integration_PowerBI') {
120120
$url = 'https://download.microsoft.com/download/c/c/9/cc9c6797-383c-4b24-8920-dc057c1de9d3/SQL2022-SSEI-Dev.exe'
121121

122122
$script:mediaFile = Save-SqlDscSqlServerMediaFile -Url $url -DestinationPath $env:TEMP -Force -Quiet -ErrorAction 'Stop'
@@ -125,7 +125,7 @@ Describe 'Prerequisites' {
125125
}
126126
}
127127

128-
Context 'Mount SQL Server media' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') {
128+
Context 'Mount SQL Server media' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI') {
129129
It 'Should mount the media to a drive letter' {
130130
$mountedImage = Mount-DiskImage -ImagePath $script:mediaFile
131131
$mountedImage | Should -BeOfType 'Microsoft.Management.Infrastructure.CimInstance'
@@ -150,14 +150,14 @@ Describe 'Prerequisites' {
150150
}
151151

152152
Context 'Install correct version of module SqlServer' {
153-
It 'Should have the minimum required version of Microsoft.PowerShell.PSResourceGet' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') {
153+
It 'Should have the minimum required version of Microsoft.PowerShell.PSResourceGet' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI') {
154154
$module = Get-Module -Name 'Microsoft.PowerShell.PSResourceGet' -ListAvailable
155155

156156
$module | Should -HaveCount 1
157157
$module.Version -ge '1.0.4.1' | Should -BeTrue
158158
}
159159

160-
It 'Should have a resource repository PSGallery with correct URI' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') {
160+
It 'Should have a resource repository PSGallery with correct URI' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI') {
161161
$resourceRepository = Get-PSResourceRepository -Name 'PSGallery'
162162

163163
$resourceRepository | Should -HaveCount 1
@@ -179,23 +179,23 @@ Describe 'Prerequisites' {
179179
$module.Version -eq '21.1.18256' | Should -BeTrue
180180
}
181181

182-
It 'Should install SqlServer module version 22.2.0' -Tag @('Integration_SQL2022') {
182+
It 'Should install SqlServer module version 22.2.0' -Tag @('Integration_SQL2022', 'Integration_PowerBI') {
183183
#Install-Module -Name 'SqlServer' -RequiredVersion '22.2.0' -Force -ErrorAction 'Stop'
184184
$module = Install-PSResource -Name 'SqlServer' -Version '22.2.0' -Scope 'AllUsers' -TrustRepository -ErrorAction 'Stop' -Confirm:$false -PassThru
185185

186186
$module | Should -HaveCount 1
187187
$module.Version -eq '22.2.0' | Should -BeTrue
188188
}
189189

190-
It 'Should have SqlServer module version 22.2.0 available' -Tag @('Integration_SQL2022') {
190+
It 'Should have SqlServer module version 22.2.0 available' -Tag @('Integration_SQL2022', 'Integration_PowerBI') {
191191
$module = Get-Module -Name 'SqlServer' -ListAvailable
192192

193193
$module | Should -HaveCount 1
194194
$module.Version -eq '22.2.0' | Should -BeTrue
195195
}
196196
}
197197

198-
Context 'Test PS Remoting to localhost' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') {
198+
Context 'Test PS Remoting to localhost' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI') {
199199
It 'Should successfully run a command on localhost using PS Remoting' {
200200
# This is a simple test to verify that PS Remoting is working.
201201
# TODO: This fails on Appveyor, but works locally when debugging on AppVeyor. Investigate why.
@@ -205,8 +205,33 @@ Describe 'Prerequisites' {
205205
}
206206
}
207207

208+
Context 'Download correct SQL Server 2017 Reporting Services installation executable' {
209+
It 'Should download SQL Server 2017 Reporting Services installation executable' -Tag @('Integration_SQL2017') {
210+
# Microsoft SQL Server Reporting Services (October 2017)
211+
$url = 'https://download.microsoft.com/download/E/6/4/E6477A2A-9B58-40F7-8AD6-62BB8491EA78/SQLServerReportingServices.exe'
212+
213+
# Put the executable in a temporary folder that can be accessed by other tests
214+
$script:mediaFile = Save-SqlDscSqlServerMediaFile -SkipExecution -Url $url -FileName 'SQLServerReportingServices.exe' -DestinationPath (Get-TemporaryFolder) -Force -Quiet -ErrorAction 'Stop'
215+
216+
$mediaFile.Name | Should -Be 'SQLServerReportingServices.exe'
217+
}
218+
}
219+
220+
Context 'Download correct SQL Server 2019 Reporting Services installation executable' {
221+
It 'Should download SQL Server 2019 Reporting Services installation executable' -Tag @('Integration_SQL2019') {
222+
# Microsoft SQL Server 2019 Reporting Services (15.0.1102.1047 - 2/6/2023)
223+
$url = 'https://download.microsoft.com/download/1/a/a/1aaa9177-3578-4931-b8f3-373b24f63342/SQLServerReportingServices.exe'
224+
225+
# Put the executable in a temporary folder that can be accessed by other tests
226+
$script:mediaFile = Save-SqlDscSqlServerMediaFile -SkipExecution -Url $url -FileName 'SQLServerReportingServices.exe' -DestinationPath (Get-TemporaryFolder) -Force -Quiet -ErrorAction 'Stop'
227+
228+
$mediaFile.Name | Should -Be 'SQLServerReportingServices.exe'
229+
}
230+
}
231+
208232
Context 'Download correct SQL Server 2022 Reporting Services installation executable' {
209233
It 'Should download SQL Server 2022 Reporting Services installation executable' -Tag @('Integration_SQL2022') {
234+
# Microsoft SQL Server 2022 Reporting Services (16.0.1113.11 - 11/23/2022)
210235
$url = 'https://download.microsoft.com/download/8/3/2/832616ff-af64-42b5-a0b1-5eb07f71dec9/SQLServerReportingServices.exe'
211236

212237
# Put the executable in a temporary folder that can be accessed by other tests
@@ -217,7 +242,10 @@ Describe 'Prerequisites' {
217242
}
218243

219244
Context 'Download correct Power BI Report Server installation executable' {
220-
It 'Should download Power BI Report Server (January 2025) installation executable' -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') {
245+
# This should always use the latest version of Power BI Report Server, and use the latest tag used in pipeline.
246+
It 'Should download Power BI Report Server installation executable' -Tag @('Integration_PowerBI') {
247+
# https://sqlserverbuilds.blogspot.com/2021/04/power-bi-report-server-versions.html
248+
# 15.0.1117.98 - 2025-01-22
221249
$url = 'https://download.microsoft.com/download/2/7/3/2739a88a-4769-4700-8748-1a01ddf60974/PowerBIReportServer.exe'
222250

223251
# Put the executable in a temporary folder that can be accessed by other tests

0 commit comments

Comments
 (0)